private void OpenContinueOrNewGamePopUp() { // If there is no save, there should'nt be a difference between press "continue" or "new game" button. // So I tried to make som fun out of it, and just lead the player to click one of the buttons. string continueBtnText; string warningMessage; string cancelBtnMessage; if (new SaveFacade().DoesAnySaveExist()) { warningMessage = "Are you going to continue your previous adventure, or start a new game, with randomized master spots?"; #if UNITY_WEBGL warningMessage = "Will you try to continue the adventure, or generate a randomized new map? (Save System" + " works properly just in downloadable builds)"; #endif continueBtnText = "Continue"; cancelBtnMessage = "New Map"; ContinueAction = Continue; CancelAction = NewGame; } else { //warningMessage = "Some choices in the game are mere role play. But You find out which ones"; warningMessage = "Some pop-up buttons in the game don’t actually modify the gameplay. It’s just “role play”. " + "Like these two below."; continueBtnText = "Cool"; cancelBtnMessage = "Bored pffff..."; ContinueAction = () => { StartCoroutine(CoolContinue()); }; CancelAction = () => { StartCoroutine(BoringNewGame()); }; } openerOfPopUpsMadeInEditor.CloseAllPopUpsExceptLoading(); customPopUpOpener.Open( title: "Play", warningMessage, confirmBtnMessage: continueBtnText, cancelBtnMessage, onConfirm: ContinueAction, onCancel: CancelAction ); }
public override void ExecuteAction() { if (!quit) { if (timer < 1.5f) { timer += TimeFacade.DeltaTime; } else { if (popUpOpener.AllPopUpsAreClosed()) { timer = 0; if (winnerFactory == playerBattleStatesFactory) { switch (CurrentBattleInfo.rewardType) { case BattleReward.NONE: { customPopUpOpener.OpenWithBGM( title: "Congratulations", warningMessage: "You beat those guys. What are you going to do now?", confirmBtnMessage: "Look the map", cancelBtnMessage: "Nothing", onConfirm: QuitBattleAndGoToMap, onCancel: () => { cricketsAudioRequest.RequestPlaying(); }, victoryBGMRequest ); } break; case BattleReward.CARDS_OF_CLASS: { sceneCanvas.SetActive(false); customPopUpOpener.OpenDisplayingUnblockedCardsOfClass( title: "You beat a Master", warningMessage: ColorHexCodes.BeginWhite + "What about making some recruiting?" + ColorHexCodes.End + ColorHexCodes.Paint(" YOU JUST GOT ONE OF EACH " + enemyDeckClass + " CARDS TO YOUR COLLECTION. ", deckColor), confirmBtnMessage: "Awesome", onConfirm: GiveUnblockedCardsOfClassThenSeeMap, victoryBGMRequest, enemyDeckClass ); } break; case BattleReward.SPECIFIC_CARD: { sceneCanvas.SetActive(false); Card[] reward = EditorMadeDeckBuilder.CreateEditorMadeDeckBuilder(rewardDeckName).GetDeck(); CustomPopUp.OnBtnClicked onbtn = () => { GiveRewardDeckThenSeeMap(reward); }; customPopUpOpener.OpenDisplayingRewardCards( title: "You win!", warningMessage: ColorHexCodes.BeginWhite + "You beat the card challenge." + ColorHexCodes.End + ColorHexCodes.Paint(" YOU GOT A CARD ", deckColor), confirmBtnMessage: "Awesome", onConfirm: onbtn, victoryBGMRequest, cards: reward ); } break; } } else { MapsCache.SpotToClearAndLevelUpIfPlayerWins = null; customPopUpOpener.OpenWithBGM( title: "You've lost the battle", warningMessage: "The enemy start to search you fallen card's pockets", confirmBtnMessage: "Go back in time", cancelBtnMessage: "Sit and cry", GoBackInTime, () => { cryingAudioRequest.RequestPlaying(); }, defeatBGMRequest ); } } else // Some pop up is oppened { timer = 0.0f; } } } }