From 14cbefc6ef8f93a321dc3e16682e75bfe6489231 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Tue, 29 May 2012 16:43:50 -0500 Subject: [PATCH] Changing variables in CommandConsoleBase to be non-static --- axios/Axios_settings.cs | 1 + axios/Engine/AxiosCommandConsole.cs | 8 ++++---- axios/Engine/AxiosGameScreen.cs | 3 ++- axios/XNACC/CommandConsoleBase.cs | 19 ++++++++++--------- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/axios/Axios_settings.cs b/axios/Axios_settings.cs index 90dbf2a..e757991 100644 --- a/axios/Axios_settings.cs +++ b/axios/Axios_settings.cs @@ -96,6 +96,7 @@ * - 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 * - Adding axioslog command to output AxiosLog + * - Changing variables in CommandConsoleBase to be non-static * * */ diff --git a/axios/Engine/AxiosCommandConsole.cs b/axios/Engine/AxiosCommandConsole.cs index 92a67d0..48658d2 100644 --- a/axios/Engine/AxiosCommandConsole.cs +++ b/axios/Engine/AxiosCommandConsole.cs @@ -23,18 +23,18 @@ namespace Axios.Engine { public class AxiosCommandConsole : CommandConsoleBase { - //private AxiosGameScreen _gameScreen; + protected AxiosGameScreen GameScreen; public AxiosCommandConsole(AxiosGameScreen gameScreen) : base(gameScreen.ScreenManager.Game) { - //_gameScreen = gameScreen; + GameScreen = gameScreen; Keyboard = gameScreen.ScreenManager.InputState; } public AxiosCommandConsole(AxiosGameScreen gameScreen, SpriteFont font) : base(gameScreen.ScreenManager.Game, font) { - //_gameScreen = gameScreen; + GameScreen = gameScreen; Keyboard = gameScreen.ScreenManager.InputState; } @@ -75,7 +75,7 @@ namespace Axios.Engine protected override void UnloadContent() { base.UnloadContent(); - ms_commands.Remove("axioslog"); + //ms_commands.Remove("axioslog"); } } } diff --git a/axios/Engine/AxiosGameScreen.cs b/axios/Engine/AxiosGameScreen.cs index a2bccca..0a82093 100644 --- a/axios/Engine/AxiosGameScreen.cs +++ b/axios/Engine/AxiosGameScreen.cs @@ -391,7 +391,7 @@ namespace Axios.Engine public override void HandleInput(GameTime gameTime, InputState input) { #if WINDOWS - if (_console == null || !_console.Active || (AllowKeyboardWhileConsoleIsActive && _console.Active) ) + if (_console == null || !AxiosCommandConsole.Active || (AllowKeyboardWhileConsoleIsActive && AxiosCommandConsole.Active)) #endif { base.HandleInput(gameTime, input); @@ -429,6 +429,7 @@ namespace Axios.Engine #if WINDOWS if (_console != null) { + //System.Diagnostics.Debugger.Break(); ScreenManager.Game.Components.Remove(_console); _console.Dispose(); _console = null; diff --git a/axios/XNACC/CommandConsoleBase.cs b/axios/XNACC/CommandConsoleBase.cs index 2f10cfd..72e892d 100644 --- a/axios/XNACC/CommandConsoleBase.cs +++ b/axios/XNACC/CommandConsoleBase.cs @@ -498,16 +498,16 @@ namespace XNACC.Console #region Command Processing // -- Command Processing-Related Fields... /// Collection Of Command Objects. - protected static SortedDictionary ms_commands = new SortedDictionary(); + protected SortedDictionary ms_commands = new SortedDictionary(); /// Collection Of function Objects. - protected static SortedDictionary ms_functions = new SortedDictionary(); + protected SortedDictionary ms_functions = new SortedDictionary(); /// Collection Of External Functions. - protected static SortedDictionary ms_externalFunctions = new SortedDictionary(); + protected SortedDictionary ms_externalFunctions = new SortedDictionary(); /// Collection Of Binding Objects. - protected static List ms_bindings = new List( 8 ); + protected List ms_bindings = new List( 8 ); /// Colleciton Of Partial Command Matches - protected static List ms_partialCmdMatches = new List( 8 ); + protected List ms_partialCmdMatches = new List( 8 ); /// Symbol table for the console variables protected Dictionary m_cVars = new Dictionary( 8 ); /// Match index for the last partial command @@ -570,7 +570,7 @@ namespace XNACC.Console /// The stream for shadowing the log to protected StreamWriter m_logShadowFile = null; /// Storage for the log - protected List m_log = new List( 256 ); + protected static List m_log = new List( 256 ); #endregion #region Command History @@ -578,7 +578,7 @@ namespace XNACC.Console /// Specifies the limit of the command history protected int m_cmdHistoryLimit = 512; /// Collection of command history - protected List m_cmdHistory = new List( 128 ); + protected static List m_cmdHistory = new List( 128 ); /// Current index in the command history protected int m_cmdHistoryIndex = 0; /// Scanning (up/down) index in of the command history @@ -635,8 +635,9 @@ namespace XNACC.Console m_stringHeight = Vector2.Zero; } } - /// Indicates if the console is active or not - public bool Active + + /// Indicates if the console is active or not + public static bool Active { get; set;