bool CheckIfDoneLeveling() { if (leveling) { if (statsRollout.BonusPool > 0 && !statsRollout.WorkingStats.IsAllMax()) { DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this); messageBox.SetText(TextManager.Instance.GetLocalizedText("mustDistributeBonusPoints")); messageBox.ClickAnywhereToClose = true; messageBox.Show(); return(false); } else { leveling = false; PlayerEntity.Stats = statsRollout.WorkingStats; NativePanel.Components.Remove(statsRollout); } } else { playerEntity.ResetSkillsRecentlyRaised(); } return(true); }
private void ShowMultipleAssignmentsMessage() { DaggerfallMessageBox multipleAssignmentsBox = new DaggerfallMessageBox(uiManager, this); multipleAssignmentsBox.SetText(TextManager.Instance.GetLocalizedText("multipleAssignments")); multipleAssignmentsBox.ClickAnywhereToClose = true; multipleAssignmentsBox.Show(); }
private void ShowMultipleAssignmentsMessage() { DaggerfallMessageBox multipleAssignmentsBox = new DaggerfallMessageBox(uiManager, this); multipleAssignmentsBox.SetText(HardStrings.multipleAssignments); multipleAssignmentsBox.ClickAnywhereToClose = true; multipleAssignmentsBox.Show(); }
private DaggerfallMessageBox CreateDialogBox(string[] dialogText) { DaggerfallMessageBox dialogBox = new DaggerfallMessageBox(uiManager, this); dialogBox.SetText(dialogText); dialogBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Yes); dialogBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.No); return(dialogBox); }
private void OptionsConfirmButton_OnMouseClick(BaseScreenComponent sender, Vector2 position) { if (DaggerfallUnity.Settings.ShowOptionsAtStart && !alwayShowOptions.IsChecked) { var messageBox = new DaggerfallMessageBox(uiManager, this, true); messageBox.SetText(GetText("showOptionsAgain")); messageBox.AllowCancel = true; messageBox.ClickAnywhereToClose = true; messageBox.OnClose += () => { SaveOptionsAndContinue(); }; uiManager.PushWindow(messageBox); return; } SaveOptionsAndContinue(); }
private void DeleteSaveButton_OnMouseClick(BaseScreenComponent sender, Vector2 position) { // Must have a save selected if (savesList.SelectedIndex < 0) { return; } // Confirmation DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this); messageBox.SetText(new string[] { HardStrings.confirmDeleteSave, "" }); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Delete); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Cancel); messageBox.OnButtonClick += ConfirmDelete_OnButtonClick; uiManager.PushWindow(messageBox); }
bool CheckIfDoneLeveling() { if (statsRollout.BonusPool > 0) { DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this); messageBox.SetText(HardStrings.mustDistributeBonusPoints); messageBox.ClickAnywhereToClose = true; messageBox.Show(); return(false); } else { leveling = false; PlayerEntity.Stats = statsRollout.WorkingStats; NativePanel.Components.Remove(statsRollout); return(true); } }
private void SaveLoadEventHandler(BaseScreenComponent sender, Vector2 position) { if (mode == Modes.SaveGame) { // Must have a save name if (saveNameTextBox.Text.Length == 0) { DaggerfallUI.MessageBox(TextManager.Instance.GetLocalizedText("youMustEnterASaveName")); return; } // Get save key and confirm if already exists int key = GameManager.Instance.SaveLoadManager.FindSaveFolderByNames(currentPlayerName, saveNameTextBox.Text); if (key != -1) { DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this); messageBox.SetText(new string[] { TextManager.Instance.GetLocalizedText("confirmOverwriteSave"), "" }); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Yes); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.No); messageBox.OnButtonClick += ConfirmOverwrite_OnButtonClick; uiManager.PushWindow(messageBox); } else { SaveGame(); } } else if (mode == Modes.LoadGame) { // Must have a save name if (saveNameTextBox.Text.Length == 0) { DaggerfallUI.MessageBox(TextManager.Instance.GetLocalizedText("youMustSelectASaveName")); return; } GameManager.Instance.SaveLoadManager.PromptLoadGame(currentPlayerName, saveNameTextBox.Text, () => { loadingLabel.Text = TextManager.Instance.GetLocalizedText("loading"); loading = true; }); } }
private void SaveOptionsAndContinue() { DaggerfallUnity.Settings.ShowOptionsAtStart = alwayShowOptions.IsChecked; DaggerfallUnity.Settings.VSync = vsync.IsChecked; DaggerfallUnity.Settings.SwapHealthAndFatigueColors = swapHealthAndFatigue.IsChecked; DaggerfallUnity.Settings.InvertMouseVertical = invertMouseVertical.IsChecked; DaggerfallUnity.Settings.MouseLookSmoothing = mouseSmoothing.IsChecked; DaggerfallUnity.Settings.Handedness = GetHandedness(leftHandWeapons.IsChecked); DaggerfallUnity.Settings.PlayerNudity = playerNudity.IsChecked; DaggerfallUnity.Settings.ClickToAttack = clickToAttack.IsChecked; DaggerfallUnity.Settings.EnableController = enableController.IsChecked; DaggerfallUnity.Settings.SaveSettings(); if (ModManager.Instance) { foreach (Mod mod in ModManager.Instance.Mods.Where(x => x.Enabled)) { bool?isGameVersionSatisfied = mod.IsGameVersionSatisfied(); if (isGameVersionSatisfied == false) { var messageBox = new DaggerfallMessageBox(uiManager, this, true); messageBox.SetText(GetText("incompatibleMods")); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Yes); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.No, true); messageBox.OnButtonClick += (_, messageBoxButton) => { moveNextStage = messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes; messageBox.CloseWindow(); }; uiManager.PushWindow(messageBox); return; } else if (isGameVersionSatisfied == null) { Debug.LogWarningFormat("Unknown format for property \"DFUnity_Version\" of mod {0}. Please use x.y.z version of minimum compatible game build.", mod.Title); } } } moveNextStage = true; }
private void SaveLoadEventHandler(BaseScreenComponent sender, Vector2 position) { if (mode == Modes.SaveGame) { // Must have a save name if (saveNameTextBox.Text.Length == 0) { DaggerfallUI.MessageBox(HardStrings.youMustEnterASaveName); return; } // Get save key and confirm if already exists int key = GameManager.Instance.SaveLoadManager.FindSaveFolderByNames(currentPlayerName, saveNameTextBox.Text); if (key != -1) { DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this); messageBox.SetText(HardStrings.confirmOverwriteSave, ""); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Yes); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.No); messageBox.OnButtonClick += ConfirmOverwrite_OnButtonClick; uiManager.PushWindow(messageBox); } else { SaveGame(); } } else if (mode == Modes.LoadGame) { // Must have a save name if (saveNameTextBox.Text.Length == 0) { DaggerfallUI.MessageBox(HardStrings.youMustSelectASaveName); return; } LoadGame(); } }
private void DeleteSaveButton_OnMouseClick(BaseScreenComponent sender, Vector2 position) { // Must have a save selected if (savesList.SelectedIndex < 0) return; // Confirmation DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this); messageBox.SetText(HardStrings.confirmDeleteSave, ""); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Delete); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Cancel); messageBox.OnButtonClick += ConfirmDelete_OnButtonClick; uiManager.PushWindow(messageBox); }
public static DaggerfallMessageBox MessageBox(string[] message) { DaggerfallMessageBox messageBox = new DaggerfallMessageBox(Instance.uiManager, Instance.uiManager.TopWindow); messageBox.SetText(message); messageBox.ClickAnywhereToClose = true; messageBox.Show(); return messageBox; }
void ShowModDescriptionPopUp_OnMouseClick(BaseScreenComponent sender, Vector2 position) { if (modSettings == null || modSettings.Length < 1) return; else if (string.IsNullOrEmpty(modSettings[currentSelection].modInfo.ModDescription)) return; ModDescriptionMessageBox = new DaggerfallMessageBox(uiManager, this); ModDescriptionMessageBox.AllowCancel = true; ModDescriptionMessageBox.ClickAnywhereToClose = true; ModDescriptionMessageBox.ParentPanel.BackgroundTexture = null; string[] modDescription = modSettings[currentSelection].modInfo.ModDescription.Split('\n'); ModDescriptionMessageBox.SetText(modDescription); uiManager.PushWindow(ModDescriptionMessageBox); }