add 'h' hotkey to cycle through bases (fact/mcv)
This commit is contained in:
@@ -146,5 +146,23 @@ namespace OpenRA
|
||||
|
||||
public void SetModifiers(Modifiers mods) { modifiers = mods; }
|
||||
public Modifiers GetModifiers() { return modifiers; }
|
||||
|
||||
public void GotoNextBase()
|
||||
{
|
||||
var bases = Game.world.Queries.OwnedBy[Game.world.LocalPlayer].WithTrait<BaseBuilding>().ToArray();
|
||||
if (!bases.Any()) return;
|
||||
|
||||
var next = bases
|
||||
.Select( b => b.Actor )
|
||||
.SkipWhile(b => Game.controller.selection.Actors.Contains(b))
|
||||
.Skip(1)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (next == null)
|
||||
next = bases.Select(b => b.Actor).First();
|
||||
|
||||
Game.controller.selection.Combine(Game.world, new Actor[] { next }, false, true);
|
||||
Game.viewport.Center(Game.controller.selection.Actors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,6 +500,9 @@ namespace OpenRA
|
||||
if (c >= '0' && c <= '9')
|
||||
Game.controller.selection.DoControlGroup(world,
|
||||
c - '0', modifiers);
|
||||
|
||||
if (c == 'h')
|
||||
Game.controller.GotoNextBase();
|
||||
}
|
||||
|
||||
if( sync != Game.world.SyncHash() )
|
||||
|
||||
@@ -71,4 +71,9 @@ namespace OpenRA.Traits
|
||||
|
||||
class MustBeDestroyedInfo : TraitInfo<MustBeDestroyed> { }
|
||||
class MustBeDestroyed { }
|
||||
|
||||
/* tag trait for "bases": mcv/fact */
|
||||
|
||||
class BaseBuildingInfo : TraitInfo<BaseBuilding> { }
|
||||
class BaseBuilding { }
|
||||
}
|
||||
|
||||
@@ -415,6 +415,7 @@ FACT:
|
||||
Description: Construction Yard
|
||||
CustomSellValue:
|
||||
Value: 2500
|
||||
BaseBuilding:
|
||||
|
||||
PROC:
|
||||
Inherits: ^Building
|
||||
|
||||
@@ -280,6 +280,7 @@ MCV:
|
||||
NoTransformSounds: nodeply1.aud
|
||||
RenderUnit:
|
||||
MustBeDestroyed:
|
||||
BaseBuilding:
|
||||
|
||||
JEEP:
|
||||
Inherits: ^Vehicle
|
||||
|
||||
Reference in New Issue
Block a user