Adding code to keep track of the console in AxiosGameScreen

--HG--
branch : xnacc-integration
This commit is contained in:
Nathan Adams 2012-05-26 18:57:16 -05:00
parent 13857f324d
commit 11ab45d9ee

View File

@ -41,6 +41,10 @@ namespace Axios.Engine
private Camera camera; private Camera camera;
#if WINDOWS
AxiosCommandConsole _console = null;
#endif
public AxiosGameScreen() public AxiosGameScreen()
: base() : base()
{ {
@ -95,6 +99,20 @@ namespace Axios.Engine
public void AddGameObject(object obj) 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) if (obj is AxiosGameObject || obj is AxiosUIObject || obj is AxiosTimer)
{ {
AxiosGameObject tmp = obj as AxiosGameObject; AxiosGameObject tmp = obj as AxiosGameObject;