Skip to content

Commit

Permalink
Hide Chrome once we have Won or Lost
Browse files Browse the repository at this point in the history
  • Loading branch information
markolson authored and chrisforbes committed Nov 25, 2011
1 parent bf22242 commit 2bb968d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs
Expand Up @@ -24,6 +24,10 @@ public OrderButtonsChromeLogic(World world)
var gameRoot = r.GetWidget("INGAME_ROOT");

var moneybin = gameRoot.GetWidget("INGAME_MONEY_BIN");
moneybin.IsVisible = () => {
return world.LocalPlayer.WinState == WinState.Undefined;
};

BindOrderButton<SellOrderGenerator>(world, moneybin, "SELL");
BindOrderButton<PowerDownOrderGenerator>(world, moneybin, "POWER_DOWN");
BindOrderButton<RepairOrderGenerator>(world, moneybin, "REPAIR");
Expand Down
1 change: 1 addition & 0 deletions OpenRA.Mods.RA/Widgets/MoneyBinWidget.cs
Expand Up @@ -30,6 +30,7 @@ public MoneyBinWidget(World world)
public override void Draw()
{
if( world.LocalPlayer == null ) return;
if( world.LocalPlayer.WinState != WinState.Undefined ) return;

var digitCollection = "digits-" + world.LocalPlayer.Country.Race;
var chromeCollection = "chrome-" + world.LocalPlayer.Country.Race;
Expand Down
1 change: 1 addition & 0 deletions OpenRA.Mods.RA/Widgets/PowerBinWidget.cs
Expand Up @@ -51,6 +51,7 @@ static Color GetPowerColor(PowerManager pm)
public override void Draw()
{
if( world.LocalPlayer == null ) return;
if( world.LocalPlayer.WinState != WinState.Undefined ) return;

var radarBin = Widget.RootWidget.GetWidget<RadarBinWidget>(RadarBin);

Expand Down
1 change: 1 addition & 0 deletions OpenRA.Mods.RA/Widgets/RadarBinWidget.cs
Expand Up @@ -131,6 +131,7 @@ public override Rectangle EventBounds
public override void Draw()
{
if( world == null || world.LocalPlayer == null ) return;
if( world.LocalPlayer.WinState != WinState.Undefined ) return;

radarCollection = "radar-" + world.LocalPlayer.Country.Race;
var rsr = Game.Renderer.RgbaSpriteRenderer;
Expand Down
1 change: 1 addition & 0 deletions OpenRA.Mods.RA/Widgets/RadarWidget.cs
Expand Up @@ -124,6 +124,7 @@ public override Rectangle EventBounds
public override void Draw()
{
if (world == null) return;
if( world.LocalPlayer.WinState != WinState.Undefined ) return;

var o = new float2(mapRect.Location.X, mapRect.Location.Y + world.Map.Bounds.Height * previewScale * (1 - radarMinimapHeight)/2);
var s = new float2(mapRect.Size.Width, mapRect.Size.Height*radarMinimapHeight);
Expand Down

0 comments on commit 2bb968d

Please sign in to comment.