void OnNewGame(GameObject go) { if (PlayerStats.isGameExists) { UIModalConfirm.Open( GameLocalize.GetText("newgame_confirm_title"), GameLocalize.GetText("newgame_confirm_desc"), delegate(bool yes) { if (yes) { Debug.Log("clearing save"); SceneState.instance.ClearAllSavedData(); UserData.instance.Save(); PlayerStats.isGameExists = true; Main.instance.sceneManager.LoadScene(Scenes.levelSelect); } }); } else { PlayerStats.isGameExists = true; Main.instance.sceneManager.LoadScene(Scenes.levelSelect); } }
void OnExitToMainMenuClick(GameObject go) { UIModalConfirm.Open(GameLocalize.GetText("exit_to_main_title"), GameLocalize.GetText("exit_confirm_desc"), delegate(bool yes) { if (yes) { Main.instance.sceneManager.LoadScene(Scenes.main); } }); }
void OnExit(GameObject go) { UIModalConfirm.Open("EXIT", null, delegate(bool yes) { if (yes) { Main.instance.sceneManager.LoadScene("levelSelect"); } }); }
void OnRestart(GameObject go) { UIModalConfirm.Open("RESTART", null, delegate(bool yes) { if (yes) { Main.instance.sceneManager.Reload(); } }); }
void OnExitClick(GameObject go) { if (mInputLockCounter > 0) { return; } UIModalConfirm.Open( GameLocalize.GetText("exit_confirm_title"), GameLocalize.GetText("exit_confirm_desc"), delegate(bool yes) { if (yes) { Main.instance.sceneManager.LoadScene(Scenes.levelSelect); } }); }
void OnInput(InputManager.Info dat) { if (!UIModalManager.instance.ModalIsInStack(UIModalConfirm.modalName)) { if (dat.state == InputManager.State.Pressed) { UIModalConfirm.Open(GameLocalize.GetText("skip_confirm_title"), GameLocalize.GetText("skip_confirm_desc"), delegate(bool yes) { if (yes) { Main.instance.input.RemoveButtonCall(0, InputAction.MenuEscape, OnInput); Player.instance.state = (int)EntityState.Final; } }); } } }
void OnInput(InputManager.Info dat) { if (!UIModalManager.instance.ModalIsInStack(UIModalConfirm.modalName)) { if (dat.state == InputManager.State.Pressed) { UIModalConfirm.Open(GameLocalize.GetText("skip_confirm_title"), GameLocalize.GetText("skip_confirm_desc"), delegate(bool yes) { if (yes) { for (int i = 0; i < InputAction._count; i++) { Main.instance.input.RemoveButtonCall(0, i, OnInput); } Main.instance.sceneManager.LoadScene(toScene); } }); } } }
void OnDeleteClick(GameObject go) { int slot = GetSlot(go); if (slot != -1) { mLateRefresh = true; mSelectedSlot = slot; UIModalConfirm.Open(GameLocalize.GetText("delete_confirm_title"), GameLocalize.GetText("delete_confirm_desc"), delegate(bool yes) { if (yes) { SlotInfo.DeleteData(slot); UserSlotData.DeleteSlot(slot); PlayerPrefs.Save(); } }); } }
void OnInfoClick(GameObject go) { int slot = GetSlot(go); if (slot != -1) { mSelectedSlot = slot; if (SlotInfo.IsDead(slot)) { UIModalConfirm.Open(GameLocalize.GetText("dead_confirm_title"), GameLocalize.GetText("dead_confirm_desc"), delegate(bool yes) { if (yes) { SlotInfo.DeleteData(slot); UserSlotData.DeleteSlot(slot); SlotInfo.CreateSlot(ModalSaveSlots.selectedSlot, SlotInfo.GameMode.Hardcore); SceneState.instance.ResetGlobalValues(); SceneState.instance.ResetValues(); AchievementFixRetroActive(); Main.instance.sceneManager.LoadScene(Scenes.levelSelect); } }); } else { UserSlotData.LoadSlot(slot, true); SlotInfo.LoadCurrentSlotData(); SceneState.instance.ResetGlobalValues(); SceneState.instance.ResetValues(); AchievementFixRetroActive(); Main.instance.sceneManager.LoadScene(Scenes.levelSelect); } } }