* - Adding axioslog command to output AxiosLog

This commit is contained in:
Nathan Adams 2012-05-28 22:31:46 -05:00
parent e31ccc4ed4
commit ff32d18553
3 changed files with 23 additions and 0 deletions

View File

@ -95,6 +95,7 @@
* - Fixed a bug where cleanup actions were being performed in Deactivate instead of Unload in AxiosGameScreen * - Fixed a bug where cleanup actions were being performed in Deactivate instead of Unload in AxiosGameScreen
* - Adding IsNullOrWhiteSpace extension for support for Xbox 360 * - Adding IsNullOrWhiteSpace extension for support for Xbox 360
* - Upon some testing - developers will need to use #if WINDOWS/#endif tags to make sure they can't use XNACC in WP7/Xbox360 * - Upon some testing - developers will need to use #if WINDOWS/#endif tags to make sure they can't use XNACC in WP7/Xbox360
* - Adding axioslog command to output AxiosLog
* *
* *
*/ */

View File

@ -7,6 +7,7 @@ using XNACC.Console;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Axios.Engine.Log;
/* /*
* The empty AxiosCommandConsole is so that when you use the comamnd console * The empty AxiosCommandConsole is so that when you use the comamnd console
@ -45,17 +46,37 @@ namespace Axios.Engine
FadeImage = tmp; FadeImage = tmp;
} }
private void ShowAxiosLog()
{
AddOutputToLog("============");
foreach (string l in AxiosLog.Instance.GetLogList())
AddOutputToLog(l);
AddOutputToLog("============");
}
public override void InitializeCustomCommands()
{
AddCommand(new CmdObject("axioslog", "Displays the current Axios Log", input => { ShowAxiosLog(); }));
base.InitializeCustomCommands();
}
public override void LoadContent(ContentManager content) public override void LoadContent(ContentManager content)
{ {
base.LoadContent(content); base.LoadContent(content);
} }
protected override void LoadContent() protected override void LoadContent()
{ {
if (Font == null) if (Font == null)
Font = Game.Content.Load<SpriteFont>("Console"); Font = Game.Content.Load<SpriteFont>("Console");
base.LoadContent(); base.LoadContent();
} }
protected override void UnloadContent()
{
base.UnloadContent();
ms_commands.Remove("axioslog");
}
} }
} }
#else #else

View File

@ -431,6 +431,7 @@ namespace Axios.Engine
{ {
ScreenManager.Game.Components.Remove(_console); ScreenManager.Game.Components.Remove(_console);
_console.Dispose(); _console.Dispose();
_console = null;
} }
#endif #endif
} }