protected override void OnSlotSelected(int slot_idx) { if (GreenHellGame.GetYesNoDialog() && GreenHellGame.GetYesNoDialog().gameObject.activeSelf) { return; } if (this.m_Slots[slot_idx].m_Empty) { return; } if (!this.m_Slots[slot_idx].m_SaveInfo.loadable) { return; } this.m_SlotIdx = slot_idx; if (this.m_Slots[slot_idx].m_SaveInfo.game_version < GreenHellGame.s_GameVersionReleaseCandidate) { this.ShowPreMasterVersionWarning(); } else { this.ShowConfirmationDialog(); } this.m_IsDialog = true; }
protected override void OnSlotSelected(int slot_idx) { if (this.m_WaitingForDecision) { return; } this.m_SlotIdx = slot_idx; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuYesNoDialog_Warning"), GreenHellGame.Instance.GetLocalization().Get("MenuSaveGame_OverwriteWarning"), false); this.m_WaitingForDecision = true; }
public override void OnBack() { if (base.IsAnyOptionModified()) { this.m_Question = MainMenuOptionsControls.OptionsControlsQuestion.Back; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_BackTitle", true), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Back", true), !this.m_IsIngame); return; } base.OnBack(); }
protected override void OnSlotSelected(int slot_idx) { if (this.m_Slots[slot_idx].m_Empty) { return; } this.m_SlotIdx = slot_idx; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuYesNoDialog_Warning"), GreenHellGame.Instance.GetLocalization().Get("MenuLoadGame_Confirm"), true); this.m_Loading = true; }
public override void OnAccept() { if (base.IsAnyOptionModified()) { this.m_Question = MainMenuOptionsControls.OptionsControlsQuestion.Accept; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_AcceptTitle", true), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Accept", true), !this.m_IsIngame); return; } this.ShowPreviousScreen(); }
public override void OnBack() { if (this.m_AcceptButton.interactable) { this.m_Question = MainMenuOptionsControlsKeysBinding.KeyBindingQuestion.Back; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_BackTitle", true), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Back", true), false); return; } this.ShowPreviousScreen(); }
private void UpdateController() { if (this.m_BlockControllerUpdate) { return; } this.m_PadControllerConnected = false; string[] joystickNames = Input.GetJoystickNames(); if (joystickNames.Length != 0) { int i = 0; while (i < joystickNames.Length) { if (!string.IsNullOrEmpty(joystickNames[i])) { this.m_PadControllerConnected = true; if (joystickNames[i].Contains("Wireless") && !joystickNames[i].Contains("Xbox")) { InputsManager.Get().m_PadControllerType = InputsManager.PadControllerType.Ps4; break; } InputsManager.Get().m_PadControllerType = InputsManager.PadControllerType.Xbox; break; } else { i++; } } } if (GreenHellGame.IsPadControllerActive() && !this.m_PadControllerConnected) { GreenHellGame.Instance.m_Settings.m_ControllerType = ControllerType.PC; this.OnChangeControllerOption(); } if (this.m_PadControllerConnected && GreenHellGame.IsPCControllerActive() && !this.m_WasPadConstrollerInfo) { if (MainLevel.Instance && !MainLevel.Instance.IsPause()) { MenuInGameManager.Get().ShowScreen(typeof(MenuInGame)); this.m_PadConstrollerInfoPause = true; } this.m_WasPadConstrollerInfo = true; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YesNoDialog_Info", true), GreenHellGame.Instance.GetLocalization().Get("ControllerDetected_Info", true), false); } if (this.m_WasPadConstrollerInfo && !this.m_PadControllerConnected) { this.m_WasPadConstrollerInfo = false; return; } if (this.m_PadControllerConnected && GreenHellGame.IsPadControllerActive()) { this.m_WasPadConstrollerInfo = true; } }
public override void OnBack() { if (this.m_Slider.value != this.m_StartVol || this.m_DialogsSlider.value != this.m_StartDialogsVol || this.m_MusicSlider.value != this.m_StartMusicVol || this.m_EnviroSlider.value != this.m_StartEnviroVol || this.m_GeneralSlider.value != this.m_StartGeneralVol) { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_AcceptTitle"), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Accept"), false); } else { this.m_MenuInGameManager.ShowScreen(typeof(MenuOptions)); } }
public override void OnBack() { if (this.m_OptionsChanged) { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_AcceptTitle"), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Accept"), false); } else { this.m_MenuInGameManager.ShowScreen(typeof(MenuOptions)); } }
private void UpdateSlots() { if (GreenHellGame.GetYesNoDialog().gameObject.activeSelf) { return; } if (GreenHellGame.IsPCControllerActive()) { this.CheckSelection(); } }
private void UpdateInputs() { if (GreenHellGame.GetYesNoDialog().isActiveAndEnabled) { return; } if (Input.GetMouseButton(0) && this.m_ActiveButton != null) { this.OnButtonPressed(this.m_ActiveButton); } }
public void OnQuit() { if (DifficultySettings.ActivePreset.m_PermaDeath) { LoadingScreen.Get().Show(LoadingScreenState.ReturnToMainMenu); GreenHellGame.Instance.ReturnToMainMenu(); return; } GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuInGame_Quit", true), GreenHellGame.Instance.GetLocalization().Get("MenuInGame_Quit_Question", true), true); this.m_YesNoQuestion = HUDDeath.YesNoQuestion.Quit; }
public void OnStartSurvival() { if (!this.m_ButtonsActive) { return; } if (GreenHellGame.Instance.m_Settings.m_NeverPlayed) { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuYesNoDialog_Warning", true), GreenHellGame.Instance.GetLocalization().Get("MainMenu_FirstTimeNoTutorial", true), !this.m_IsIngame); return; } this.StartSurvival(); }
protected override void Update() { if (GreenHellGame.GetYesNoDialog().gameObject.activeSelf) { return; } base.Update(); if (Input.GetKeyDown(KeyCode.Escape)) { this.OnBack(); return; } if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Right)) { if (this.m_ActiveMenuOption != null && this.m_ActiveMenuOption.m_Slider) { float actionValue = InputsManager.Get().GetActionValue(InputsManager.InputAction.Right); if (actionValue > 0.3f) { this.m_ActiveMenuOption.m_Slider.value += (this.m_ActiveMenuOption.m_Slider.maxValue - this.m_ActiveMenuOption.m_Slider.minValue) * actionValue * Time.unscaledDeltaTime; return; } } } else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Left)) { if (this.m_ActiveMenuOption != null && this.m_ActiveMenuOption.m_Slider) { float actionValue2 = InputsManager.Get().GetActionValue(InputsManager.InputAction.Left); if (actionValue2 > 0.3f) { this.m_ActiveMenuOption.m_Slider.value -= (this.m_ActiveMenuOption.m_Slider.maxValue - this.m_ActiveMenuOption.m_Slider.minValue) * actionValue2 * Time.unscaledDeltaTime; return; } } } else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.DPadRight)) { if (this.m_ActiveMenuOption != null && this.m_ActiveMenuOption.m_Slider) { this.m_ActiveMenuOption.m_Slider.value += (this.m_ActiveMenuOption.m_Slider.maxValue - this.m_ActiveMenuOption.m_Slider.minValue) * Time.unscaledDeltaTime; return; } } else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.DPadLeft) && this.m_ActiveMenuOption != null && this.m_ActiveMenuOption.m_Slider) { this.m_ActiveMenuOption.m_Slider.value -= (this.m_ActiveMenuOption.m_Slider.maxValue - this.m_ActiveMenuOption.m_Slider.minValue) * Time.unscaledDeltaTime; } }
protected override void OnSlotSelected(int slot_idx) { this.m_SlotIdx = slot_idx; if (!this.m_Slots[slot_idx].m_Empty) { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuYesNoDialog_Warning"), GreenHellGame.Instance.GetLocalization().Get("MenuSaveGame_OverwriteWarning"), true); this.m_Loading = true; } else { SaveGame.s_MainSaveName = "Slot" + this.m_SlotIdx.ToString() + ".sav"; base.Invoke("OnPreStartGame", 0.3f); this.m_Loading = true; } }
public void OnYesFromDialog() { if (this.m_Question == OptionsGameQuestion.Back) { MainMenuManager.Get().SetActiveScreen(typeof(MainMenuOptions), true); } else if (this.m_Question == OptionsGameQuestion.Accept) { this.ApplySettings(); GreenHellGame.Instance.m_Settings.SaveSettings(); GreenHellGame.Instance.m_Settings.ApplySettings(); this.ApplyLocalization(); GreenHellGame.GetYesNoDialog().ApplyLanguage(); } }
public void OnYesFromDialog() { if (this.m_Question == MainMenuOptionsGame.OptionsGameQuestion.Back) { this.ShowPreviousScreen(); return; } if (this.m_Question == MainMenuOptionsGame.OptionsGameQuestion.Accept) { this.ApplySettings(); GreenHellGame.Instance.m_Settings.SaveSettings(); GreenHellGame.Instance.m_Settings.ApplySettings(false); GreenHellGame.GetYesNoDialog().ApplyLanguage(); this.ShowPreviousScreen(); } }
protected override void OnSlotSelected(int slot_idx) { if (this.m_IsBusy) { return; } if (this.m_SlotIdx == slot_idx) { return; } this.m_SlotIdx = slot_idx; if (!this.m_Slots[slot_idx].m_Empty) { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuYesNoDialog_Warning", true), GreenHellGame.Instance.GetLocalization().Get("MenuSaveGame_OverwriteWarning", true), !this.m_IsIngame); this.m_IsBusy = true; return; } this.DoSaveGame(); }
public void OnInputAction(InputActionData action_data) { if (GreenHellGame.GetYesNoDialog().gameObject.activeSelf) { return; } if (this.m_ButtonsGrp.activeSelf) { if (action_data.m_Action == InputsManager.InputAction.Button_A) { this.OnLoadGame(); } else if (action_data.m_Action == InputsManager.InputAction.Button_B) { this.OnQuit(); } } if (this.m_CoopButtonsGrp.activeSelf && action_data.m_Action == InputsManager.InputAction.Button_A) { this.OnRespawn(); } }
public void OnDefault() { this.m_Question = KeyBindingQuestion.Default; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_AcceptTitle"), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Accept"), false); }
public void OnAccept() { this.m_Question = OptionsGameQuestion.Accept; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_AcceptTitle"), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Accept"), true); }
private IEnumerator DelayedScreenSettingsChange(float exec_time) { if (this.m_ApplyingSettings) { yield break; } this.m_ApplyingSettings = true; this.m_SettingsChangeTime = Time.realtimeSinceStartup; FullScreenMode full_screen; if (!Enum.TryParse <FullScreenMode>(this.m_Fullscreen, out full_screen)) { full_screen = ((this.m_Fullscreen == "On") ? FullScreenMode.ExclusiveFullScreen : FullScreenMode.Windowed); } FullScreenMode fullScreenMode = Screen.fullScreenMode; Resolution res = ResolutionExtension.SelectResolution(this.m_Resolution); if (!res.Equals(Screen.currentResolution, false)) { Screen.SetResolution(res.width, res.height, Screen.fullScreenMode, (Screen.fullScreenMode == FullScreenMode.ExclusiveFullScreen) ? res.refreshRate : Screen.currentResolution.refreshRate); while (!res.Equals(Screen.currentResolution, false) && this.m_SettingsChangeTime > Time.realtimeSinceStartup - 1f) { yield return(new WaitForEndOfFrame()); } GreenHellGame.Instance.m_MenuResolutionX = res.width; GreenHellGame.Instance.m_MenuResolutionY = res.height; this.OnResolutionChanged(res.width, res.height); yield return(new WaitForEndOfFrame()); } this.m_SettingsChangeTime = Time.realtimeSinceStartup; if (Screen.fullScreenMode != full_screen) { Screen.fullScreenMode = full_screen; while (Screen.fullScreenMode != full_screen && this.m_SettingsChangeTime > Time.realtimeSinceStartup - 1f) { yield return(new WaitForEndOfFrame()); } } this.m_SettingsChangeTime = Time.realtimeSinceStartup; if (QualitySettings.vSyncCount != 0 != this.m_VSync) { if (this.m_VSync) { QualitySettings.vSyncCount = 1; } else { QualitySettings.vSyncCount = 0; } while (QualitySettings.vSyncCount != 0 != this.m_VSync && this.m_SettingsChangeTime > Time.realtimeSinceStartup - 1f) { yield return(new WaitForEndOfFrame()); } } this.m_ApplyingSettings = false; string text = ""; if (Screen.fullScreenMode == FullScreenMode.ExclusiveFullScreen && Screen.currentResolution.refreshRate != res.refreshRate) { text += "\n"; text += GreenHellGame.Instance.GetLocalization().Get("MenuOptions_Graphics_RefreshRate", true); } if (Screen.fullScreenMode != full_screen) { text += "\n"; text += GreenHellGame.Instance.GetLocalization().Get("MenuOptions_Graphics_Fullscreen", true); } if (text.Length > 0 && !GreenHellGame.IsYesNoDialogActive()) { text += "\n"; GreenHellGame.GetYesNoDialog().Show(null, DialogWindowType.Ok, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_BackTitle", true), GreenHellGame.Instance.GetLocalization().GetMixed("MenuGraphics_SettingsChangeFailed", new string[] { text }), MainLevel.Instance == null); } yield break; yield break; }
public override void OnAccept() { this.m_Question = MainMenuOptionsControlsKeysBinding.KeyBindingQuestion.Save; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_AcceptTitle", true), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Accept", true), false); }
public void OnDefault() { this.m_Question = MainMenuOptionsControlsKeysBinding.KeyBindingQuestion.Default; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_BackTitle", true), GreenHellGame.Instance.GetLocalization().Get("YNDialog_OptionsGame_Back", true), false); }
public void OnQuitGame() { this.m_CurrentQuestion = MenuInGame.Question.Quit; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuInGame_Quit"), GreenHellGame.Instance.GetLocalization().Get("MenuInGame_Quit_Question"), false); }
public void OnSkipTutorial() { this.m_CurrentQuestion = MenuInGame.Question.SkipTutorial; GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuInGame_SkipTutorial"), GreenHellGame.Instance.GetLocalization().Get("MenuInGame_SkipTutorial_Question"), false); }
public void OnQuit() { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuInGame_Quit"), GreenHellGame.Instance.GetLocalization().Get("MenuInGame_Quit_Question"), true); this.m_YesNoQuestion = HUDDeath.YesNoQuestion.Quit; }
private void UpdateButtons() { if (GreenHellGame.GetYesNoDialog().isActiveAndEnabled) { return; } Color color = this.m_ResumeButton.GetComponentInChildren <Text>().color; Color color2 = this.m_ResumeButton.GetComponentInChildren <Text>().color; float s_ButtonsAlpha = MainMenuScreen.s_ButtonsAlpha; float s_InactiveButtonsAlpha = MainMenuScreen.s_InactiveButtonsAlpha; color.a = s_ButtonsAlpha; color2.a = s_InactiveButtonsAlpha; this.m_ResumeText.color = color; this.m_OptionsText.color = ((!GreenHellGame.TWITCH_DEMO) ? color : color2); this.m_QuitText.color = color; this.m_LoadText.color = color; this.m_SkipTutorialText.color = color; Vector2 screenPoint = Input.mousePosition; this.m_ActiveButton = null; RectTransform component = this.m_ResumeButton.GetComponent <RectTransform>(); if (RectTransformUtility.RectangleContainsScreenPoint(component, screenPoint)) { this.m_ActiveButton = this.m_ResumeButton; } component = this.m_LoadButton.GetComponent <RectTransform>(); if (RectTransformUtility.RectangleContainsScreenPoint(component, screenPoint)) { this.m_ActiveButton = this.m_LoadButton; } if (!GreenHellGame.TWITCH_DEMO) { component = this.m_OptionsButton.GetComponent <RectTransform>(); if (RectTransformUtility.RectangleContainsScreenPoint(component, screenPoint)) { this.m_ActiveButton = this.m_OptionsButton; } } component = this.m_QuitButton.GetComponent <RectTransform>(); if (RectTransformUtility.RectangleContainsScreenPoint(component, screenPoint)) { this.m_ActiveButton = this.m_QuitButton; } if (this.m_SkipTutorialButton.gameObject.activeSelf) { component = this.m_SkipTutorialButton.GetComponent <RectTransform>(); if (RectTransformUtility.RectangleContainsScreenPoint(component, screenPoint)) { this.m_ActiveButton = this.m_SkipTutorialButton; } } component = this.m_ResumeText.GetComponent <RectTransform>(); Vector3 localPosition = component.localPosition; float num = (!(this.m_ActiveButton == this.m_ResumeButton)) ? this.m_ButtonTextStartX : this.m_SelectedButtonX; float num2 = Mathf.Ceil(num - localPosition.x) * Time.unscaledDeltaTime * 10f; localPosition.x += num2; component.localPosition = localPosition; if (this.m_ActiveButton == this.m_ResumeButton) { color = this.m_ResumeText.color; color.a = 1f; this.m_ResumeText.color = color; } component = this.m_LoadText.GetComponent <RectTransform>(); localPosition = component.localPosition; num = ((!(this.m_ActiveButton == this.m_LoadButton)) ? this.m_ButtonTextStartX : this.m_SelectedButtonX); num2 = Mathf.Ceil(num - localPosition.x) * Time.unscaledDeltaTime * 10f; localPosition.x += num2; component.localPosition = localPosition; if (this.m_ActiveButton == this.m_LoadButton) { color = this.m_LoadText.color; color.a = 1f; this.m_LoadText.color = color; } component = this.m_OptionsText.GetComponent <RectTransform>(); localPosition = component.localPosition; num = ((!(this.m_ActiveButton == this.m_OptionsButton)) ? this.m_ButtonTextStartX : this.m_SelectedButtonX); num2 = Mathf.Ceil(num - localPosition.x) * Time.unscaledDeltaTime * 10f; localPosition.x += num2; component.localPosition = localPosition; if (this.m_ActiveButton == this.m_OptionsButton) { color = this.m_OptionsText.color; color.a = 1f; this.m_OptionsText.color = color; } component = this.m_QuitText.GetComponent <RectTransform>(); localPosition = component.localPosition; num = ((!(this.m_ActiveButton == this.m_QuitButton)) ? this.m_ButtonTextStartX : this.m_SelectedButtonX); num2 = Mathf.Ceil(num - localPosition.x) * Time.unscaledDeltaTime * 10f; localPosition.x += num2; component.localPosition = localPosition; if (this.m_ActiveButton == this.m_QuitButton) { color = this.m_QuitText.color; color.a = 1f; this.m_QuitText.color = color; } if (this.m_SkipTutorialButton.gameObject.activeSelf) { component = this.m_SkipTutorialText.GetComponent <RectTransform>(); localPosition = component.localPosition; num = ((!(this.m_ActiveButton == this.m_SkipTutorialButton)) ? this.m_ButtonTextStartX : this.m_SelectedButtonX); num2 = Mathf.Ceil(num - localPosition.x) * Time.unscaledDeltaTime * 10f; localPosition.x += num2; component.localPosition = localPosition; if (this.m_ActiveButton == this.m_SkipTutorialButton) { color = this.m_SkipTutorialText.color; color.a = 1f; this.m_SkipTutorialText.color = color; } } CursorManager.Get().SetCursor((!(this.m_ActiveButton != null)) ? CursorManager.TYPE.Normal : CursorManager.TYPE.MouseOver); }
private void ShowPreMasterVersionWarning() { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuYesNoDialog_Warning", true), GreenHellGame.Instance.GetLocalization().Get("SaveGame_PreMasterVersionWarning", true), !this.m_IsIngame); }
private void ShowConfirmationDialog() { GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("MenuYesNoDialog_Warning", true), GreenHellGame.Instance.GetLocalization().Get("MenuLoadGame_Confirm", true), !this.m_IsIngame); }