Ingame options: chrome -> widgets

This commit is contained in:
Paul Chote
2010-04-10 13:05:20 +12:00
committed by Chris Forbes
parent 8f10e3ac81
commit c568be255a
6 changed files with 121 additions and 41 deletions

View File

@@ -63,6 +63,7 @@ namespace OpenRA.Graphics
}
ConnectionState lastConnectionState = ConnectionState.PreConnecting;
bool gameWasStarted = false;
public void DrawRegions( World world )
{
world.WorldRenderer.palette.Update(
@@ -73,10 +74,15 @@ namespace OpenRA.Graphics
renderer.BeginFrame(r1, r2, scrollPosition.ToInt2());
world.WorldRenderer.Draw();
if( Game.orderManager.GameStarted )
if( Game.orderManager.GameStarted && world.LocalPlayer != null)
{
if (world.LocalPlayer != null)
Game.chrome.Draw( world );
if (!gameWasStarted)
{
Chrome.rootWidget.ShowMenu("INGAME_ROOT");
gameWasStarted = true;
}
Game.chrome.Draw( world );
if( Game.orderManager.Connection.ConnectionState == ConnectionState.NotConnected )
Game.chrome.DrawDialog("Connection lost.");