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); } }
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(); }
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); }
private void OnTransitionInStartLoadHome() { HomeState.GoToHomeStateAndReloadMap(); }