1111using Intersect . Configuration ;
1212using Microsoft . Xna . Framework ;
1313using Microsoft . Xna . Framework . Graphics ;
14- using System . Diagnostics ;
15- using System . Reflection ;
1614using Intersect . Client . Framework . Database ;
1715using Intersect . Client . Framework . Graphics ;
1816using Intersect . Client . ThirdParty ;
@@ -58,6 +56,8 @@ internal partial class IntersectGame : Game
5856 private SpriteBatch ? updateBatch ;
5957
6058 private bool updaterGraphicsReset ;
59+
60+ public static bool _isShowingExitConfirmation ;
6161
6262 #endregion
6363
@@ -355,6 +355,11 @@ protected override void OnExiting(object sender, ExitingEventArgs args)
355355 Globals . Me . CombatTimer > Timing . Global ? . Milliseconds &&
356356 Globals . GameState == GameStates . InGame ;
357357
358+ if ( _isShowingExitConfirmation )
359+ {
360+ return ;
361+ }
362+
358363 if ( inCombat )
359364 {
360365 AlertWindow . Open (
@@ -369,7 +374,12 @@ protected override void OnExiting(object sender, ExitingEventArgs args)
369374 Globals . Me . CombatTimer = 0 ;
370375 }
371376
377+ _isShowingExitConfirmation = false ;
372378 Globals . IsRunning = false ;
379+ } ,
380+ handleCancel : ( _ , _ ) =>
381+ {
382+ _isShowingExitConfirmation = false ;
373383 }
374384 ) ;
375385 }
@@ -382,10 +392,16 @@ protected override void OnExiting(object sender, ExitingEventArgs args)
382392 inputType : InputType . YesNo ,
383393 handleSubmit : ( _ , _ ) =>
384394 {
395+ _isShowingExitConfirmation = false ;
385396 Globals . IsRunning = false ;
397+ } ,
398+ handleCancel : ( _ , _ ) =>
399+ {
400+ _isShowingExitConfirmation = false ;
386401 }
387402 ) ;
388403 }
404+ _isShowingExitConfirmation = true ;
389405 }
390406
391407 private void TryExit ( object sender , ExitingEventArgs args )
0 commit comments