Browse Source

Adding Deactivate event for when the screen leaves focus

Added flag to enable/disable moving camera with gamepad
master 0.0
Nathan Adams 7 years ago
parent
commit
e23503cd00
  1. 2
      axios/Axios_settings.cs
  2. 5
      axios/Engine/AxiosGameScreen.cs
  3. 3
      axios/ScreenSystem/InputState.cs

2
axios/Axios_settings.cs

@ -140,6 +140,8 @@
* - Adding dispose methods to AxiosFile objects
* - Adding extended log to AxiosLog
* - Fixing issue in CommandConsole where the first line would not be displayed
* - Adding Deactivate event for when the screen leaves focus
* - Added flag to enable/disable moving camera with gamepad
*
*/
#endregion

5
axios/Engine/AxiosGameScreen.cs

@ -330,9 +330,10 @@ namespace Axios.Engine
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
{
if (otherScreenHasFocus)
if (otherScreenHasFocus && !screenHidden)
{
screenHidden = true;
this.Deactivate();
}
if (screenHidden && !otherScreenHasFocus)
@ -508,7 +509,6 @@ namespace Axios.Engine
{
//this.IsExiting = true;
//System.Diagnostics.Debugger.Break();
base.Deactivate();
ScreenState = GameStateManagement.ScreenState.TransitionOff;
AxiosLog.Instance.AddLine("Memory usage before cleanup: " + GC.GetTotalMemory(true).ToString(), LoggingFlag.DEBUG);
foreach (AxiosGameObject g in _gameObjects)
@ -538,6 +538,7 @@ namespace Axios.Engine
}
#endif
}

3
axios/ScreenSystem/InputState.cs

@ -104,6 +104,7 @@ namespace GameStateManagement
* -- Nathan Adams [adamsna@datanethost.net] - 4/12/2012
*/
public bool MoveCursorWithController = false;
/*
* Adding variables for the cursor
@ -391,7 +392,7 @@ namespace GameStateManagement
// Update cursor
Vector2 oldCursor = _cursor;
if (CurrentGamePadStates[0].IsConnected && CurrentGamePadStates[0].ThumbSticks.Left != Vector2.Zero)
if (CurrentGamePadStates[0].IsConnected && CurrentGamePadStates[0].ThumbSticks.Left != Vector2.Zero && MoveCursorWithController)
{
Vector2 temp = CurrentGamePadStates[0].ThumbSticks.Left;
_cursor += temp * new Vector2(300f, -300f) * (float)gameTime.ElapsedGameTime.TotalSeconds;

Loading…
Cancel
Save