Merge pull request #3999 from Mailaender/moveflash
Brought back the MoveFlash
This commit is contained in:
@@ -11,6 +11,7 @@ NEW:
|
|||||||
Fixed base attack notification playing when allied engineers repaired your buildings.
|
Fixed base attack notification playing when allied engineers repaired your buildings.
|
||||||
Improved the ingame chat interface and input, with it defaulting to Team Chat.
|
Improved the ingame chat interface and input, with it defaulting to Team Chat.
|
||||||
Redesigned the settings panel.
|
Redesigned the settings panel.
|
||||||
|
Re-added move flashes.
|
||||||
Red Alert:
|
Red Alert:
|
||||||
Added MAD Tank.
|
Added MAD Tank.
|
||||||
Fixed a crash in Monster Tank Madness.
|
Fixed a crash in Monster Tank Madness.
|
||||||
|
|||||||
41
OpenRA.Game/Effects/MoveFlash.cs
Normal file
41
OpenRA.Game/Effects/MoveFlash.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see COPYING.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenRA.Effects;
|
||||||
|
using OpenRA.FileFormats;
|
||||||
|
using OpenRA.Graphics;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
|
||||||
|
namespace OpenRA.Effects
|
||||||
|
{
|
||||||
|
public class MoveFlash : IEffect
|
||||||
|
{
|
||||||
|
Animation anim;
|
||||||
|
WPos pos;
|
||||||
|
|
||||||
|
public MoveFlash(WPos pos, World world)
|
||||||
|
{
|
||||||
|
this.pos = pos;
|
||||||
|
anim = new Animation("moveflsh");
|
||||||
|
anim.PlayThen("idle", () => world.AddFrameEndTask(w => w.Remove(this)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Tick(World world)
|
||||||
|
{
|
||||||
|
anim.Tick();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||||
|
{
|
||||||
|
return anim.Render(pos, WVec.Zero, 0, wr.Palette("moveflash"), 1f / wr.Viewport.Zoom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -94,11 +94,6 @@ namespace OpenRA.Graphics
|
|||||||
Zoom = Game.Settings.Graphics.PixelDouble ? 2 : 1;
|
Zoom = Game.Settings.Graphics.PixelDouble ? 2 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPos ViewToWorld(int2 view)
|
|
||||||
{
|
|
||||||
return worldRenderer.Position(ViewToWorldPx(view)).ToCPos();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int2 ViewToWorldPx(int2 view) { return (1f / Zoom * view.ToFloat2()).ToInt2() + TopLeft; }
|
public int2 ViewToWorldPx(int2 view) { return (1f / Zoom * view.ToFloat2()).ToInt2() + TopLeft; }
|
||||||
public int2 WorldToViewPx(int2 world) { return (Zoom * (world - TopLeft).ToFloat2()).ToInt2(); }
|
public int2 WorldToViewPx(int2 world) { return (Zoom * (world - TopLeft).ToFloat2()).ToInt2(); }
|
||||||
|
|
||||||
|
|||||||
@@ -236,6 +236,7 @@
|
|||||||
<Compile Include="Traits\World\ScreenMap.cs" />
|
<Compile Include="Traits\World\ScreenMap.cs" />
|
||||||
<Compile Include="Traits\World\ActorMap.cs" />
|
<Compile Include="Traits\World\ActorMap.cs" />
|
||||||
<Compile Include="Widgets\HotkeyEntryWidget.cs" />
|
<Compile Include="Widgets\HotkeyEntryWidget.cs" />
|
||||||
|
<Compile Include="Effects\MoveFlash.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||||
|
|||||||
@@ -41,16 +41,15 @@ namespace OpenRA.Orders
|
|||||||
.Where(o => o != null)
|
.Where(o => o != null)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
var actorsInvolved = orders.Select(o => o.self).Distinct();
|
var actorsInvolved = orders.Select(o => o.Actor).Distinct();
|
||||||
if (actorsInvolved.Any())
|
if (actorsInvolved.Any())
|
||||||
yield return new Order("CreateGroup", actorsInvolved.First().Owner.PlayerActor, false)
|
yield return new Order("CreateGroup", actorsInvolved.First().Owner.PlayerActor, false)
|
||||||
{
|
{
|
||||||
TargetString = actorsInvolved.Select(a => a.ActorID).JoinWith(",")
|
TargetString = actorsInvolved.Select(a => a.ActorID).JoinWith(",")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
foreach (var o in orders)
|
foreach (var o in orders)
|
||||||
yield return CheckSameOrder(o.iot, o.trait.IssueOrder(o.self, o.iot, o.target, mi.Modifiers.HasModifier(Modifiers.Shift)));
|
yield return CheckSameOrder(o.Order, o.Trait.IssueOrder(o.Actor, o.Order, o.Target, mi.Modifiers.HasModifier(Modifiers.Shift)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(World world) { }
|
public void Tick(World world) { }
|
||||||
@@ -89,7 +88,7 @@ namespace OpenRA.Orders
|
|||||||
.Where(o => o != null)
|
.Where(o => o != null)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
var cursorName = orders.Select(o => o.cursor).FirstOrDefault();
|
var cursorName = orders.Select(o => o.Cursor).FirstOrDefault();
|
||||||
return cursorName ?? (useSelect ? "select" : "default");
|
return cursorName ?? (useSelect ? "select" : "default");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,9 +102,9 @@ namespace OpenRA.Orders
|
|||||||
|
|
||||||
if (mi.Button == Game.mouseButtonPreference.Action)
|
if (mi.Button == Game.mouseButtonPreference.Action)
|
||||||
{
|
{
|
||||||
foreach( var o in self.TraitsImplementing<IIssueOrder>()
|
foreach (var o in self.TraitsImplementing<IIssueOrder>()
|
||||||
.SelectMany(trait => trait.Orders
|
.SelectMany(trait => trait.Orders
|
||||||
.Select(x => new { Trait = trait, Order = x } ))
|
.Select(x => new { Trait = trait, Order = x }))
|
||||||
.OrderByDescending(x => x.Order.OrderPriority))
|
.OrderByDescending(x => x.Order.OrderPriority))
|
||||||
{
|
{
|
||||||
var actorsAt = self.World.ActorMap.GetUnitsAt(target.CenterPosition.ToCPos()).ToList();
|
var actorsAt = self.World.ActorMap.GetUnitsAt(target.CenterPosition.ToCPos()).ToList();
|
||||||
@@ -138,19 +137,19 @@ namespace OpenRA.Orders
|
|||||||
|
|
||||||
class UnitOrderResult
|
class UnitOrderResult
|
||||||
{
|
{
|
||||||
public readonly Actor self;
|
public readonly Actor Actor;
|
||||||
public readonly IOrderTargeter iot;
|
public readonly IOrderTargeter Order;
|
||||||
public readonly IIssueOrder trait;
|
public readonly IIssueOrder Trait;
|
||||||
public readonly string cursor;
|
public readonly string Cursor;
|
||||||
public readonly Target target;
|
public readonly Target Target;
|
||||||
|
|
||||||
public UnitOrderResult(Actor self, IOrderTargeter iot, IIssueOrder trait, string cursor, Target target)
|
public UnitOrderResult(Actor actor, IOrderTargeter order, IIssueOrder trait, string cursor, Target target)
|
||||||
{
|
{
|
||||||
this.self = self;
|
this.Actor = actor;
|
||||||
this.iot = iot;
|
this.Order = order;
|
||||||
this.trait = trait;
|
this.Trait = trait;
|
||||||
this.cursor = cursor;
|
this.Cursor = cursor;
|
||||||
this.target = target;
|
this.Target = target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,9 +97,6 @@ namespace OpenRA.Traits
|
|||||||
if (self.Destroyed)
|
if (self.Destroyed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (target.Type == TargetType.Actor && display)
|
|
||||||
w.Add(new FlashTarget(target.Actor));
|
|
||||||
|
|
||||||
var line = self.TraitOrDefault<DrawLineToTarget>();
|
var line = self.TraitOrDefault<DrawLineToTarget>();
|
||||||
if (line != null)
|
if (line != null)
|
||||||
line.SetTarget(self, target, color, display);
|
line.SetTarget(self, target, color, display);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace OpenRA.Widgets
|
|||||||
public void UpdateMouseover()
|
public void UpdateMouseover()
|
||||||
{
|
{
|
||||||
TooltipType = WorldTooltipType.None;
|
TooltipType = WorldTooltipType.None;
|
||||||
var cell = worldRenderer.Viewport.ViewToWorld(Viewport.LastMousePos);
|
var cell = worldRenderer.Position(worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||||
if (!world.Map.IsInMap(cell))
|
if (!world.Map.IsInMap(cell))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using OpenRA.Effects;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Orders;
|
using OpenRA.Orders;
|
||||||
@@ -21,14 +22,16 @@ namespace OpenRA.Widgets
|
|||||||
{
|
{
|
||||||
public class WorldInteractionControllerWidget : Widget
|
public class WorldInteractionControllerWidget : Widget
|
||||||
{
|
{
|
||||||
protected readonly World world;
|
static readonly Actor[] NoActors = { };
|
||||||
|
|
||||||
|
protected readonly World World;
|
||||||
readonly WorldRenderer worldRenderer;
|
readonly WorldRenderer worldRenderer;
|
||||||
int2 dragStart, dragEnd;
|
int2 dragStart, dragEnd;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public WorldInteractionControllerWidget(World world, WorldRenderer worldRenderer)
|
public WorldInteractionControllerWidget(World world, WorldRenderer worldRenderer)
|
||||||
{
|
{
|
||||||
this.world = world;
|
this.World = world;
|
||||||
this.worldRenderer = worldRenderer;
|
this.worldRenderer = worldRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,14 +40,14 @@ namespace OpenRA.Widgets
|
|||||||
var selbox = SelectionBox;
|
var selbox = SelectionBox;
|
||||||
if (selbox == null)
|
if (selbox == null)
|
||||||
{
|
{
|
||||||
foreach (var u in SelectActorsInBox(world, dragStart, dragStart, _ => true))
|
foreach (var u in SelectActorsInBox(World, dragStart, dragStart, _ => true))
|
||||||
worldRenderer.DrawRollover(u);
|
worldRenderer.DrawRollover(u);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Game.Renderer.WorldLineRenderer.DrawRect(selbox.Value.First.ToFloat2(), selbox.Value.Second.ToFloat2(), Color.White);
|
Game.Renderer.WorldLineRenderer.DrawRect(selbox.Value.First.ToFloat2(), selbox.Value.Second.ToFloat2(), Color.White);
|
||||||
foreach (var u in SelectActorsInBox(world, selbox.Value.First, selbox.Value.Second, _ => true))
|
foreach (var u in SelectActorsInBox(World, selbox.Value.First, selbox.Value.Second, _ => true))
|
||||||
worldRenderer.DrawRollover(u);
|
worldRenderer.DrawRollover(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,10 +55,10 @@ namespace OpenRA.Widgets
|
|||||||
{
|
{
|
||||||
var xy = worldRenderer.Viewport.ViewToWorldPx(mi.Location);
|
var xy = worldRenderer.Viewport.ViewToWorldPx(mi.Location);
|
||||||
|
|
||||||
var UseClassicMouseStyle = Game.Settings.Game.UseClassicMouseStyle;
|
var useClassicMouseStyle = Game.Settings.Game.UseClassicMouseStyle;
|
||||||
|
|
||||||
var HasBox = (SelectionBox != null) ? true : false;
|
var hasBox = (SelectionBox != null) ? true : false;
|
||||||
var MultiClick = (mi.MultiTapCount >= 2) ? true : false;
|
var multiClick = (mi.MultiTapCount >= 2) ? true : false;
|
||||||
|
|
||||||
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down)
|
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down)
|
||||||
{
|
{
|
||||||
@@ -64,9 +67,9 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
dragStart = dragEnd = xy;
|
dragStart = dragEnd = xy;
|
||||||
|
|
||||||
//place buildings
|
// place buildings
|
||||||
if (!UseClassicMouseStyle || (UseClassicMouseStyle && !world.Selection.Actors.Any()) )
|
if (!useClassicMouseStyle || (useClassicMouseStyle && !World.Selection.Actors.Any()))
|
||||||
ApplyOrders(world, xy, mi);
|
ApplyOrders(World, xy, mi);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Move)
|
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Move)
|
||||||
@@ -74,31 +77,31 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up)
|
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up)
|
||||||
{
|
{
|
||||||
if (UseClassicMouseStyle && HasMouseFocus)
|
if (useClassicMouseStyle && HasMouseFocus)
|
||||||
{
|
{
|
||||||
//order units around
|
// order units around
|
||||||
if (!HasBox && world.Selection.Actors.Any() && !MultiClick)
|
if (!hasBox && World.Selection.Actors.Any() && !multiClick)
|
||||||
{
|
{
|
||||||
ApplyOrders(world, xy, mi);
|
ApplyOrders(World, xy, mi);
|
||||||
YieldMouseFocus(mi);
|
YieldMouseFocus(mi);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.OrderGenerator is UnitOrderGenerator)
|
if (World.OrderGenerator is UnitOrderGenerator)
|
||||||
{
|
{
|
||||||
if (MultiClick)
|
if (multiClick)
|
||||||
{
|
{
|
||||||
var unit = world.ScreenMap.ActorsAt(xy).FirstOrDefault();
|
var unit = World.ScreenMap.ActorsAt(xy).FirstOrDefault();
|
||||||
var newSelection2 = SelectActorsInBox(world, worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.BottomRight,
|
var newSelection2 = SelectActorsInBox(World, worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.BottomRight,
|
||||||
a => unit != null && a.Info.Name == unit.Info.Name && a.Owner == unit.Owner);
|
a => unit != null && a.Info.Name == unit.Info.Name && a.Owner == unit.Owner);
|
||||||
|
|
||||||
world.Selection.Combine(world, newSelection2, true, false);
|
World.Selection.Combine(World, newSelection2, true, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var newSelection = SelectActorsInBox(world, dragStart, xy, _ => true);
|
var newSelection = SelectActorsInBox(World, dragStart, xy, _ => true);
|
||||||
world.Selection.Combine(world, newSelection, mi.Modifiers.HasModifier(Modifiers.Shift), dragStart == xy);
|
World.Selection.Combine(World, newSelection, mi.Modifiers.HasModifier(Modifiers.Shift), dragStart == xy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,17 +114,16 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
if (mi.Button == MouseButton.Right && mi.Event == MouseInputEvent.Down)
|
if (mi.Button == MouseButton.Right && mi.Event == MouseInputEvent.Down)
|
||||||
{
|
{
|
||||||
if (UseClassicMouseStyle)
|
if (useClassicMouseStyle)
|
||||||
world.Selection.Clear();
|
World.Selection.Clear();
|
||||||
|
|
||||||
if (!HasBox) // don't issue orders while selecting
|
if (!hasBox) // don't issue orders while selecting
|
||||||
ApplyOrders(world, xy, mi);
|
ApplyOrders(World, xy, mi);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Pair<int2, int2>? SelectionBox
|
public Pair<int2, int2>? SelectionBox
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -137,14 +139,33 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
var pos = worldRenderer.Position(xy);
|
var pos = worldRenderer.Position(xy);
|
||||||
var orders = world.OrderGenerator.Order(world, pos.ToCPos(), mi).ToArray();
|
var orders = world.OrderGenerator.Order(world, pos.ToCPos(), mi).ToArray();
|
||||||
orders.Do(o => world.IssueOrder(o));
|
|
||||||
|
|
||||||
world.PlayVoiceForOrders(orders);
|
world.PlayVoiceForOrders(orders);
|
||||||
|
|
||||||
|
var flashed = false;
|
||||||
|
foreach (var o in orders)
|
||||||
|
{
|
||||||
|
if (!flashed)
|
||||||
|
{
|
||||||
|
if (o.TargetActor != null)
|
||||||
|
{
|
||||||
|
world.AddFrameEndTask(w => w.Add(new FlashTarget(o.TargetActor)));
|
||||||
|
flashed = true;
|
||||||
|
}
|
||||||
|
else if (o.Subject != world.LocalPlayer.PlayerActor && o.TargetLocation != CPos.Zero) // TODO: this filters building placement, but also suppport powers :(
|
||||||
|
{
|
||||||
|
world.AddFrameEndTask(w => w.Add(new MoveFlash(worldRenderer.Position(worldRenderer.Viewport.ViewToWorldPx(mi.Location)), world)));
|
||||||
|
flashed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
world.IssueOrder(o);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string GetCursor(int2 screenPos)
|
public override string GetCursor(int2 screenPos)
|
||||||
{
|
{
|
||||||
return Sync.CheckSyncUnchanged(world, () =>
|
return Sync.CheckSyncUnchanged(World, () =>
|
||||||
{
|
{
|
||||||
// Always show an arrow while selecting
|
// Always show an arrow while selecting
|
||||||
if (SelectionBox != null)
|
if (SelectionBox != null)
|
||||||
@@ -161,7 +182,7 @@ namespace OpenRA.Widgets
|
|||||||
Modifiers = Game.GetModifierKeys()
|
Modifiers = Game.GetModifierKeys()
|
||||||
};
|
};
|
||||||
|
|
||||||
return world.OrderGenerator.GetCursor(world, cell, mi);
|
return World.OrderGenerator.GetCursor(World, cell, mi);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,18 +193,16 @@ namespace OpenRA.Widgets
|
|||||||
if (e.Key >= Keycode.NUMBER_0 && e.Key <= Keycode.NUMBER_9)
|
if (e.Key >= Keycode.NUMBER_0 && e.Key <= Keycode.NUMBER_9)
|
||||||
{
|
{
|
||||||
var group = (int)e.Key - (int)Keycode.NUMBER_0;
|
var group = (int)e.Key - (int)Keycode.NUMBER_0;
|
||||||
world.Selection.DoControlGroup(world, worldRenderer, group, e.Modifiers, e.MultiTapCount);
|
World.Selection.DoControlGroup(World, worldRenderer, group, e.Modifiers, e.MultiTapCount);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (Hotkey.FromKeyInput(e) == Game.Settings.Keys.PauseKey && World.LocalPlayer != null) // Disable pausing for spectators
|
||||||
// Disable pausing for spectators
|
World.SetPauseState(!World.Paused);
|
||||||
else if (Hotkey.FromKeyInput(e) == Game.Settings.Keys.PauseKey && world.LocalPlayer != null)
|
|
||||||
world.SetPauseState(!world.Paused);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly Actor[] NoActors = {};
|
|
||||||
IEnumerable<Actor> SelectActorsInBox(World world, int2 a, int2 b, Func<Actor, bool> cond)
|
IEnumerable<Actor> SelectActorsInBox(World world, int2 a, int2 b, Func<Actor, bool> cond)
|
||||||
{
|
{
|
||||||
return world.ScreenMap.ActorsInBox(a, b)
|
return world.ScreenMap.ActorsInBox(a, b)
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace OpenRA
|
|||||||
public readonly ActorMap ActorMap;
|
public readonly ActorMap ActorMap;
|
||||||
public readonly ScreenMap ScreenMap;
|
public readonly ScreenMap ScreenMap;
|
||||||
|
|
||||||
public void IssueOrder( Order o ) { orderManager.IssueOrder( o ); } /* avoid exposing the OM to mod code */
|
public void IssueOrder(Order o) { orderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */
|
||||||
|
|
||||||
IOrderGenerator orderGenerator_;
|
IOrderGenerator orderGenerator_;
|
||||||
public IOrderGenerator OrderGenerator
|
public IOrderGenerator OrderGenerator
|
||||||
|
|||||||
@@ -259,7 +259,9 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
{
|
{
|
||||||
if (order is MoveOrderTargeter)
|
if (order is MoveOrderTargeter)
|
||||||
{
|
{
|
||||||
if (Info.OnRails) return null;
|
if (Info.OnRails)
|
||||||
|
return null;
|
||||||
|
|
||||||
return new Order("Move", self, queued) { TargetLocation = target.CenterPosition.ToCPos() };
|
return new Order("Move", self, queued) { TargetLocation = target.CenterPosition.ToCPos() };
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
2
OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs
Executable file → Normal file
2
OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs
Executable file → Normal file
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.RA.Orders
|
|||||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world) { yield break; }
|
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world) { yield break; }
|
||||||
public void RenderAfterWorld(WorldRenderer wr, World world)
|
public void RenderAfterWorld(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var position = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
|
var position = wr.Position(wr.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||||
var topLeft = position - FootprintUtils.AdjustForBuildingSize(BuildingInfo);
|
var topLeft = position - FootprintUtils.AdjustForBuildingSize(BuildingInfo);
|
||||||
|
|
||||||
var actorInfo = Rules.Info[Building];
|
var actorInfo = Rules.Info[Building];
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA
|
|||||||
// Find the queue with the target actor
|
// Find the queue with the target actor
|
||||||
var queue = w.ActorsWithTrait<ProductionQueue>()
|
var queue = w.ActorsWithTrait<ProductionQueue>()
|
||||||
.Where(p => p.Actor.Owner == self.Owner &&
|
.Where(p => p.Actor.Owner == self.Owner &&
|
||||||
p.Trait.CurrentItem() != null &&
|
p.Trait.CurrentItem() != null &&
|
||||||
p.Trait.CurrentItem().Item == order.TargetString &&
|
p.Trait.CurrentItem().Item == order.TargetString &&
|
||||||
p.Trait.CurrentItem().RemainingTime == 0)
|
p.Trait.CurrentItem().RemainingTime == 0)
|
||||||
.Select(p => p.Trait)
|
.Select(p => p.Trait)
|
||||||
|
|||||||
6
OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs
Executable file → Normal file
6
OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs
Executable file → Normal file
@@ -138,7 +138,7 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public void RenderAfterWorld(WorldRenderer wr, World world)
|
public void RenderAfterWorld(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
|
var xy = wr.Position(wr.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||||
var targetUnits = power.UnitsInRange(xy);
|
var targetUnits = power.UnitsInRange(xy);
|
||||||
foreach (var unit in targetUnits)
|
foreach (var unit in targetUnits)
|
||||||
if (manager.self.Owner.Shroud.IsTargetable(unit) || manager.self.Owner.HasFogVisibility())
|
if (manager.self.Owner.Shroud.IsTargetable(unit) || manager.self.Owner.HasFogVisibility())
|
||||||
@@ -147,7 +147,7 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
|
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
|
var xy = wr.Position(wr.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||||
var tiles = world.FindTilesInCircle(xy, range);
|
var tiles = world.FindTilesInCircle(xy, range);
|
||||||
var pal = wr.Palette("terrain");
|
var pal = wr.Palette("terrain");
|
||||||
foreach (var t in tiles)
|
foreach (var t in tiles)
|
||||||
@@ -226,7 +226,7 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
|
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
|
var xy = wr.Position(wr.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||||
var pal = wr.Palette("terrain");
|
var pal = wr.Palette("terrain");
|
||||||
|
|
||||||
// Source tiles
|
// Source tiles
|
||||||
|
|||||||
4
OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs
Executable file → Normal file
4
OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs
Executable file → Normal file
@@ -90,14 +90,14 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public void RenderAfterWorld(WorldRenderer wr, World world)
|
public void RenderAfterWorld(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
|
var xy = wr.Position(wr.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||||
foreach (var unit in power.UnitsInRange(xy))
|
foreach (var unit in power.UnitsInRange(xy))
|
||||||
wr.DrawSelectionBox(unit, Color.Red);
|
wr.DrawSelectionBox(unit, Color.Red);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
|
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
|
var xy = wr.Position(wr.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||||
var pal = wr.Palette("terrain");
|
var pal = wr.Palette("terrain");
|
||||||
foreach (var t in world.FindTilesInCircle(xy, range))
|
foreach (var t in world.FindTilesInCircle(xy, range))
|
||||||
yield return new SpriteRenderable(tile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true);
|
yield return new SpriteRenderable(tile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true);
|
||||||
|
|||||||
@@ -257,6 +257,12 @@ World:
|
|||||||
G: 255
|
G: 255
|
||||||
B: 255
|
B: 255
|
||||||
A: 128
|
A: 128
|
||||||
|
PaletteFromRGBA@moveflash:
|
||||||
|
Name: moveflash
|
||||||
|
R: 255
|
||||||
|
G: 255
|
||||||
|
B: 255
|
||||||
|
A: 64
|
||||||
PaletteFromRGBA@disabled:
|
PaletteFromRGBA@disabled:
|
||||||
Name: disabled
|
Name: disabled
|
||||||
R: 0
|
R: 0
|
||||||
|
|||||||
@@ -305,3 +305,9 @@ icon:
|
|||||||
Start: 0
|
Start: 0
|
||||||
abomb: atomicnh
|
abomb: atomicnh
|
||||||
Start: 0
|
Start: 0
|
||||||
|
|
||||||
|
moveflsh:
|
||||||
|
idle:
|
||||||
|
Start: 0
|
||||||
|
Length: *
|
||||||
|
Tick: 80
|
||||||
@@ -411,12 +411,11 @@ World:
|
|||||||
G: 255
|
G: 255
|
||||||
B: 255
|
B: 255
|
||||||
A: 128
|
A: 128
|
||||||
PaletteFromRGBA@invuln:
|
PaletteFromR8@moveflash:
|
||||||
Name: invuln
|
Name: moveflash
|
||||||
R: 128
|
Filename: DATA.R8
|
||||||
G: 0
|
Offset: 2572352
|
||||||
B: 0
|
A: 64
|
||||||
A: 128
|
|
||||||
PaletteFromRGBA@disabled:
|
PaletteFromRGBA@disabled:
|
||||||
Name: disabled
|
Name: disabled
|
||||||
R: 0
|
R: 0
|
||||||
|
|||||||
@@ -298,3 +298,10 @@ spicebloom:
|
|||||||
Start: 109
|
Start: 109
|
||||||
ZOffset: -511
|
ZOffset: -511
|
||||||
Offset: -16,-16
|
Offset: -16,-16
|
||||||
|
|
||||||
|
moveflsh:
|
||||||
|
idle: DATA.R8
|
||||||
|
Start: 3621
|
||||||
|
Length: 5
|
||||||
|
Tick: 80
|
||||||
|
BlendMode: Subtractive
|
||||||
@@ -587,6 +587,12 @@ World:
|
|||||||
G: 255
|
G: 255
|
||||||
B: 255
|
B: 255
|
||||||
A: 128
|
A: 128
|
||||||
|
PaletteFromRGBA@moveflash:
|
||||||
|
Name: moveflash
|
||||||
|
R: 255
|
||||||
|
G: 255
|
||||||
|
B: 255
|
||||||
|
A: 64
|
||||||
PaletteFromRGBA@invuln:
|
PaletteFromRGBA@invuln:
|
||||||
Name: invuln
|
Name: invuln
|
||||||
R: 128
|
R: 128
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ moveflsh:
|
|||||||
idle:
|
idle:
|
||||||
Start: 0
|
Start: 0
|
||||||
Length: *
|
Length: *
|
||||||
|
Tick: 80
|
||||||
|
|
||||||
select:
|
select:
|
||||||
repair:
|
repair:
|
||||||
|
|||||||
@@ -85,12 +85,12 @@ World:
|
|||||||
G: 255
|
G: 255
|
||||||
B: 255
|
B: 255
|
||||||
A: 128
|
A: 128
|
||||||
PaletteFromRGBA@invuln:
|
PaletteFromRGBA@moveflash:
|
||||||
Name: invuln
|
Name: moveflash
|
||||||
R: 128
|
R: 255
|
||||||
G: 0
|
G: 255
|
||||||
B: 0
|
B: 255
|
||||||
A: 128
|
A: 64
|
||||||
PaletteFromRGBA@disabled:
|
PaletteFromRGBA@disabled:
|
||||||
Name: disabled
|
Name: disabled
|
||||||
R: 0
|
R: 0
|
||||||
|
|||||||
@@ -243,3 +243,9 @@ torpedo:
|
|||||||
idle:
|
idle:
|
||||||
Start: 0
|
Start: 0
|
||||||
Length: *
|
Length: *
|
||||||
|
|
||||||
|
moveflsh:
|
||||||
|
idle:
|
||||||
|
Start: 0
|
||||||
|
Length: *
|
||||||
|
Tick: 80
|
||||||
Reference in New Issue
Block a user