本文整理汇总了C#中World.CancelInputMode方法的典型用法代码示例。如果您正苦于以下问题:C# World.CancelInputMode方法的具体用法?C# World.CancelInputMode怎么用?C# World.CancelInputMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.CancelInputMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Order
public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
{
if (mi.Button != MouseButton.Left)
world.CancelInputMode();
else if (!world.ShroudObscures(xy))
{
world.CancelInputMode();
yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = xy, SuppressVisualFeedback = true };
}
}
示例2: Order
public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
var ret = InnerOrder(world, xy, mi).ToList();
if (ret.Count > 0)
world.CancelInputMode();
return ret;
}
示例3: Order
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
var ret = InnerOrder( world, xy, mi ).ToList();
foreach( var order in ret )
{
world.CancelInputMode();
break;
}
return ret;
}
示例4: Order
public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
var ret = InnerOrder(world, xy, mi).ToArray();
// If there was a successful placement order
if (ret.Any(o => o.OrderString == "PlaceBuilding"
|| o.OrderString == "LineBuild"
|| o.OrderString == "PlacePlug"))
world.CancelInputMode();
return ret;
}
示例5: Order
public IEnumerable<Order> Order(World world, CPos cell, int2 worldPixel, MouseInput mi)
{
world.CancelInputMode();
if (mi.Button == MouseButton.Left)
yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = cell, SuppressVisualFeedback = true };
}
示例6: Order
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
return OrderInner(world, xy, mi);
}
示例7: OrderInner
protected virtual IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
{
if (mi.Button == ExpectedButton && world.Map.Contains(xy))
{
world.CancelInputMode();
foreach (var subject in Subjects)
yield return new Order(OrderName, subject, false) { TargetLocation = xy };
}
}
示例8: Order
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Left)
{
world.CancelInputMode();
yield break;
}
if (world.LocalPlayer.Shroud.IsExplored(xy))
yield return new Order("ChronoshiftSelf", self, xy);
}
示例9: Order
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Left)
{
world.CancelInputMode();
yield break;
}
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
if (world.LocalPlayer.Shroud.IsExplored(xy))
yield return new Order("ChronoshiftSelf", self, queued) { TargetLocation = xy };
}
示例10: Tick
public void Tick( World world )
{
// Find the queue with the target actor
var queue = Producer.TraitsImplementing<ProductionQueue>()
.Where(p => p.CurrentItem() != null &&
p.CurrentItem().Item == Building &&
p.CurrentItem().RemainingTime == 0)
.FirstOrDefault();
if (queue == null)
world.CancelInputMode();
}
示例11: OrderInner
protected override IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
{
if (mi.Button != ExpectedButton)
yield break;
var target = FriendlyGuardableUnits(world, mi).FirstOrDefault();
if (target == null || Subjects.All(s => s.IsDead))
yield break;
world.CancelInputMode();
foreach (var subject in Subjects)
if (subject != target)
yield return new Order(OrderName, subject, false) { TargetActor = target };
}
示例12: Order
public IEnumerable<Order> Order(World world, CPos cell, int2 worldPixel, MouseInput mi)
{
if (mi.Button == Game.Settings.Game.MouseButtonPreference.Cancel)
{
world.CancelInputMode();
yield break;
}
var underCursor = world.ScreenMap.ActorsAt(mi)
.Where(a => !world.FogObscures(a))
.MaxByOrDefault(a => a.Info.HasTraitInfo<SelectableInfo>()
? a.Info.TraitInfo<SelectableInfo>().Priority : int.MinValue);
if (mi.Button == Game.Settings.Game.MouseButtonPreference.Action && underCursor == null)
{
minelayer.World.CancelInputMode();
yield return new Order("PlaceMinefield", minelayer, false) { TargetLocation = cell };
}
}
示例13: Order
public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
{
world.CancelInputMode();
if (mi.Button == MouseButton.Left && power.UnitsInRange(xy).Any())
yield return new Order(order, manager.Self, false) { TargetLocation = xy, SuppressVisualFeedback = true };
}
示例14: Tick
public void Tick(World world)
{
if (world.LocalPlayer != null &&
world.LocalPlayer.WinState != WinState.Undefined)
world.CancelInputMode();
}
示例15: Order
public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
{
if (mi.Button == Game.mouseButtonPreference.Cancel)
{
world.CancelInputMode();
yield break;
}
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
var cinfo = self.Trait<ChronoshiftDeploy>();
if (cinfo.CanJumpTo(xy, false))
{
self.World.CancelInputMode();
yield return new Order("ChronoshiftJump", self, queued) { TargetLocation = xy };
}
}