Esempio n. 1
0
        private void SinglePlayerBattle_OnStateChanged(PBEBattle battle)
        {
            switch (battle.BattleState)
            {
            case PBEBattleState.Ended:
            {
                void OnBattleEndedTransitionEnded()
                {
                    _battleEndedTransition = null;
                    if (_actionsGUI != null)
                    {
                        _actionsGUI.Dispose();
                        _actionsGUI = null;
                    }
                    _onClosed.Invoke();
                    _onClosed = null;
                }

                _battleEndedTransition = new FadeToColorTransition(20, 0, OnBattleEndedTransitionEnded);
                break;
            }

            case PBEBattleState.ReadyToRunSwitches: new Thread(battle.RunSwitches)
                {
                    Name = ThreadName
                }.Start(); break;

            case PBEBattleState.ReadyToRunTurn: new Thread(battle.RunTurn)
                {
                    Name = ThreadName
                }.Start(); break;
            }
        }
Esempio n. 2
0
 private unsafe void CB_FadeOutBattle()
 {
     OverworldGUI.ProcessDayTint(false);
     if (_fadeTransition.IsDone)
     {
         _fadeTransition = null;
         _stringPrinter?.Close();
         _stringPrinter = null;
         _stringWindow.Close();
         _stringWindow = null;
         _actionsGUI?.Dispose();
         _actionsGUI = null;
         _onClosed.Invoke();
         _onClosed = null;
         Instance  = null;
     }
 }