Adding code to keep track of the console in AxiosGameScreen

--HG--
branch : xnacc-integration
master
Nathan Adams 2012-05-26 18:57:16 -05:00
parent 13857f324d
commit 11ab45d9ee
1 changed files with 18 additions and 0 deletions

View File

@ -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;