Replace 'Always show Healthbars' checkbox with dropdown

The player can now cycle between;
-Standard: Health and Status bars display only on mouse hover.
-Show On Damage: Health shows on damaged actors, Status always shows.
-Always Show: Health and Status bars are always displayed.
This commit is contained in:
DArcy Rush
2015-10-16 20:37:08 +01:00
committed by DArcy Rush
parent 70de26557b
commit 8eb34f3cfa
8 changed files with 95 additions and 28 deletions

View File

@@ -183,13 +183,26 @@ namespace OpenRA.Graphics
foreach (var r in g)
r.RenderDebugGeometry(this);
if (World.Type == WorldType.Regular && Game.Settings.Game.AlwaysShowStatusBars)
if (World.Type == WorldType.Regular)
{
foreach (var g in World.ActorsHavingTrait<Selectable>().Where(a => !a.Disposed
&& !World.FogObscures(a)
&& !World.Selection.Actors.Contains(a)))
{
if (Game.Settings.Game.StatusBars == StatusBarsType.Standard)
new SelectionBarsRenderable(g, false, false).Render(this);
DrawRollover(g);
if (Game.Settings.Game.StatusBars == StatusBarsType.AlwaysShow)
new SelectionBarsRenderable(g, true, true).Render(this);
if (Game.Settings.Game.StatusBars == StatusBarsType.DamageShow)
{
if (g.GetDamageState() != DamageState.Undamaged)
new SelectionBarsRenderable(g, true, true).Render(this);
else
new SelectionBarsRenderable(g, false, true).Render(this);
}
}
}
Game.Renderer.Flush();
@@ -198,7 +211,7 @@ namespace OpenRA.Graphics
public void DrawRollover(Actor unit)
{
if (unit.Info.HasTraitInfo<SelectableInfo>())
new SelectionBarsRenderable(unit).Render(this);
new SelectionBarsRenderable(unit, true, true).Render(this);
}
public void DrawRangeCircle(WPos pos, WDist range, Color c)