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 void SetModifiers(Modifiers mods) { modifiers = mods; }
|
||||||
public Modifiers GetModifiers() { return modifiers; }
|
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')
|
if (c >= '0' && c <= '9')
|
||||||
Game.controller.selection.DoControlGroup(world,
|
Game.controller.selection.DoControlGroup(world,
|
||||||
c - '0', modifiers);
|
c - '0', modifiers);
|
||||||
|
|
||||||
|
if (c == 'h')
|
||||||
|
Game.controller.GotoNextBase();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sync != Game.world.SyncHash() )
|
if( sync != Game.world.SyncHash() )
|
||||||
|
|||||||
@@ -71,4 +71,9 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
class MustBeDestroyedInfo : TraitInfo<MustBeDestroyed> { }
|
class MustBeDestroyedInfo : TraitInfo<MustBeDestroyed> { }
|
||||||
class MustBeDestroyed { }
|
class MustBeDestroyed { }
|
||||||
|
|
||||||
|
/* tag trait for "bases": mcv/fact */
|
||||||
|
|
||||||
|
class BaseBuildingInfo : TraitInfo<BaseBuilding> { }
|
||||||
|
class BaseBuilding { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,6 +415,7 @@ FACT:
|
|||||||
Description: Construction Yard
|
Description: Construction Yard
|
||||||
CustomSellValue:
|
CustomSellValue:
|
||||||
Value: 2500
|
Value: 2500
|
||||||
|
BaseBuilding:
|
||||||
|
|
||||||
PROC:
|
PROC:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ MCV:
|
|||||||
NoTransformSounds: nodeply1.aud
|
NoTransformSounds: nodeply1.aud
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
MustBeDestroyed:
|
MustBeDestroyed:
|
||||||
|
BaseBuilding:
|
||||||
|
|
||||||
JEEP:
|
JEEP:
|
||||||
Inherits: ^Vehicle
|
Inherits: ^Vehicle
|
||||||
|
|||||||
Reference in New Issue
Block a user