From 11ab45d9ee41252dc5c7d2ba0f3609b7a2f68f63 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sat, 26 May 2012 18:57:16 -0500 Subject: [PATCH] Adding code to keep track of the console in AxiosGameScreen --HG-- branch : xnacc-integration --- axios/Engine/AxiosGameScreen.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/axios/Engine/AxiosGameScreen.cs b/axios/Engine/AxiosGameScreen.cs index 211795f..ff1f445 100644 --- a/axios/Engine/AxiosGameScreen.cs +++ b/axios/Engine/AxiosGameScreen.cs @@ -41,6 +41,10 @@ namespace Axios.Engine private Camera camera; +#if WINDOWS + AxiosCommandConsole _console = null; +#endif + public AxiosGameScreen() : base() { @@ -95,6 +99,20 @@ namespace Axios.Engine public void AddGameObject(object obj) { +#if WINDOWS + if (obj is AxiosCommandConsole) + { + if (_console != null) + { + //remove the current one first + ScreenManager.Game.Components.Remove(_console); + _console.Dispose(); + _console = null; + } + _console = (AxiosCommandConsole)obj; + ScreenManager.Game.Components.Add(_console); + } +#endif if (obj is AxiosGameObject || obj is AxiosUIObject || obj is AxiosTimer) { AxiosGameObject tmp = obj as AxiosGameObject;