Ejemplo n.º 1
0
        private void CleanupPlayback(bool normalEnd)
        {
            if (Service.IsSet <GameStateMachine>() && this.preVideoState != null)
            {
                if (this.preVideoState is HomeState)
                {
                    HomeState.GoToHomeStateAndReloadMap();
                }
                else
                {
                    Service.Get <GameStateMachine>().SetState(this.preVideoState);
                    if (Service.IsSet <WorldInitializer>() && Service.IsSet <CurrentPlayer>())
                    {
                        Service.Get <WorldInitializer>().ProcessMapData(Service.Get <CurrentPlayer>().Map);
                    }
                }
            }
            this.playing       = false;
            this.displayed     = false;
            this.preVideoState = null;
            KeyValuePair <bool, string> keyValuePair = new KeyValuePair <bool, string>(normalEnd, this.Guid);

            if (Service.IsSet <EventManager>())
            {
                Service.Get <EventManager>().SendEvent(EventId.VideoEnd, keyValuePair);
            }
        }
Ejemplo n.º 2
0
        private void OnPrimaryActionButtonClicked(UXButton button)
        {
            button.Enabled = false;
            this.replayBattleButton.Enabled = false;
            BattleType type = Service.Get <BattleController>().GetCurrentBattle().Type;

            if (type == BattleType.PveDefend)
            {
                HomeState.GoToHomeStateAndReloadMap();
                this.Close(null);
            }
            else
            {
                HomeState.GoToHomeState(null, false);
            }
            Service.Get <BattlePlaybackController>().DiscardLastReplay();
        }
Ejemplo n.º 3
0
 public EatResponse OnEvent(EventId id, object cookie)
 {
     if (id != EventId.ScreenLoaded)
     {
         if (id == EventId.WorldInTransitionComplete)
         {
             Service.EventManager.UnregisterObserver(this, EventId.WorldInTransitionComplete);
             Service.BotRunner.Performing = false;
             base.Perform();
         }
     }
     else if (cookie is BattleEndScreen)
     {
         Service.EventManager.UnregisterObserver(this, EventId.ScreenLoaded);
         Service.EventManager.RegisterObserver(this, EventId.WorldInTransitionComplete);
         HomeState.GoToHomeStateAndReloadMap();
     }
     return(EatResponse.NotEaten);
 }
Ejemplo n.º 4
0
 private void OnTransitionInStartLoadHome()
 {
     HomeState.GoToHomeStateAndReloadMap();
 }