Allow keeping empty selection bars visible
This commit is contained in:
@@ -53,7 +53,7 @@ namespace OpenRA.Graphics
|
||||
foreach (var extraBar in actor.TraitsImplementing<ISelectionBar>())
|
||||
{
|
||||
var value = extraBar.GetValue();
|
||||
if (value != 0)
|
||||
if (value != 0 || extraBar.DisplayWhenEmpty)
|
||||
{
|
||||
start.Y += (int)(4 / wr.Viewport.Zoom);
|
||||
end.Y += (int)(4 / wr.Viewport.Zoom);
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace OpenRA.Traits
|
||||
public interface IPips { IEnumerable<PipType> GetPips(Actor self); }
|
||||
|
||||
[RequireExplicitImplementation]
|
||||
public interface ISelectionBar { float GetValue(); Color GetColor(); }
|
||||
public interface ISelectionBar { float GetValue(); Color GetColor(); bool DisplayWhenEmpty { get; } }
|
||||
|
||||
public interface IPositionableInfo : ITraitInfoInterface { }
|
||||
public interface IPositionable : IOccupySpace
|
||||
|
||||
@@ -95,5 +95,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return Color.Purple; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,5 +39,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return Color.Orange; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return Color.Yellow;
|
||||
}
|
||||
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
|
||||
public int GetPowerModifier()
|
||||
{
|
||||
return playerPower.PowerOutageRemainingTicks > 0 ? 0 : 100;
|
||||
|
||||
@@ -81,6 +81,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
|
||||
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||
{
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
|
||||
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||
{
|
||||
|
||||
@@ -57,5 +57,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,5 +79,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
{
|
||||
return info.BarColor;
|
||||
}
|
||||
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return info.TimeBarColor; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
|
||||
public void ModifyDeathActorInit(Actor self, TypeDictionary init)
|
||||
{
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return Color.Magenta; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
}
|
||||
|
||||
class PortableChronoOrderTargeter : IOrderTargeter
|
||||
|
||||
Reference in New Issue
Block a user