private void UpdateAlertButtonClick(object sender, RoutedEventArgs e) { var updateDialog = new DialogBoxOptions() { Title = "There is a new update!", Message = "Would you like to update now?", MainButton = new DialogBoxOptions.DialogBoxButtonOptions() { Label = "Update", Callback = async() => { ShowDialog(new DialogBoxOptions() { Title = "Updating", ShowProgressBar = true }); await Task.Delay(1000); await Utilities.UpdateApplication(); } }, SecondaryButton = new DialogBoxOptions.DialogBoxButtonOptions() { Label = "Cancel", Callback = () => DismissDialog() } }; ShowDialog(updateDialog); }
void Awake() { GameObject Controllers = GameObject.Find("Dialog Boxes"); GameObject tempGoObj; mc = GameObject.Find("Dialog Boxes").GetComponent <MenuController>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_SaveFile"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Save File"; dialogBoxSaveGame = tempGoObj.GetComponent <DialogBoxSaveGame>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_LoadFile"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Load File"; dialogBoxLoadGame = tempGoObj.GetComponent <DialogBoxLoadGame>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_Options"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Options"; dialogBoxOptions = tempGoObj.GetComponent <DialogBoxOptions>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_Settings"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Settings"; dialogBoxSettings = tempGoObj.GetComponent <DialogBoxSettings>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_Trade"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Trade"; dialogBoxTrade = tempGoObj.GetComponent <DialogBoxTrade>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_AreYouSure"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Are You Sure"; dialogBoxAreYouSure = tempGoObj.GetComponent <DialogBoxAreYouSure>(); }
public void Awake() { DialogBoxGO = GameObject.Find("Dialog Boxes"); GameObject tempGoObj; tempGoObj = CreateDialogGO("DB_SaveFile", "Save File"); dialogBoxSaveGame = tempGoObj.GetComponent <DialogBoxSaveGame>(); tempGoObj = CreateDialogGO("DB_LoadFile", "Load File"); dialogBoxLoadGame = tempGoObj.GetComponent <DialogBoxLoadGame>(); tempGoObj = CreateDialogGO("DB_Options", "Options"); dialogBoxOptions = tempGoObj.GetComponent <DialogBoxOptions>(); tempGoObj = CreateDialogGO("DB_Settings", "Settings"); dialogBoxSettings = tempGoObj.GetComponent <DialogBoxSettings>(); tempGoObj = CreateDialogGO("DB_Trade", "Trade"); dialogBoxTrade = tempGoObj.GetComponent <DialogBoxTrade>(); tempGoObj = CreateDialogGO("DB_AreYouSure", "Are You Sure"); dialogBoxAreYouSure = tempGoObj.GetComponent <DialogBoxAreYouSure>(); tempGoObj = CreateDialogGO("DB_JobList", "Job List"); dialogBoxJobList = tempGoObj.GetComponent <DialogBoxJobList>(); tempGoObj = CreateDialogGO("DB_Quests", "Quests"); dialogBoxQuests = tempGoObj.GetComponent <DialogBoxQuests>(); AddQuestList(); }
public void CancelGame() { DialogBoxStart.SetActive(true); DialogBoxLevel.SetActive(true); DialogBoxOptions.SetActive(true); DialogBoxQuit.SetActive(true); DialogBoxNewGame.SetActive(false); DialogBoxContinue.SetActive(false); DialogBoxCancel.SetActive(false); }
public void PlayGame() { //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); DialogBoxStart.SetActive(false); DialogBoxLevel.SetActive(false); DialogBoxOptions.SetActive(false); DialogBoxQuit.SetActive(false); DialogBoxNewGame.SetActive(true); DialogBoxContinue.SetActive(true); DialogBoxCancel.SetActive(true); }
/// <summary> /// Show a dialog box with the configured options /// </summary> public void ShowDialog(DialogBoxOptions options) { if (string.IsNullOrWhiteSpace(options.Title)) { this.DialogBoxTitle.Text = string.Empty; this.DialogBoxTitle.Visibility = Visibility.Collapsed; } else { this.DialogBoxTitle.Text = options.Title; this.DialogBoxTitle.Visibility = Visibility.Visible; } if (string.IsNullOrWhiteSpace(options.Message)) { this.DialogBoxMessage.Text = string.Empty; this.DialogBoxMessage.Visibility = Visibility.Collapsed; } else { this.DialogBoxMessage.Text = options.Message; this.DialogBoxMessage.Visibility = Visibility.Visible; } if (options.MainButton != null) { this.DialogBoxMainButton.Content = options.MainButton.Label; this.dialogMainAction = options.MainButton.Callback; this.DialogBoxMainButton.Visibility = Visibility.Visible; } else { this.DialogBoxMainButton.Visibility = Visibility.Collapsed; } if (options.SecondaryButton != null) { this.DialogBoxSecondaryButton.Content = options.SecondaryButton.Label; this.dialogSecondaryAction = options.SecondaryButton.Callback; this.DialogBoxSecondaryButton.Visibility = Visibility.Visible; } else { this.DialogBoxSecondaryButton.Visibility = Visibility.Collapsed; } this.DialogProgressBar.Visibility = options.ShowProgressBar ? Visibility.Visible : Visibility.Collapsed; this.IsDialogVisible = true; }
public void Awake() { DialogBoxes = new Dictionary <string, DialogBox>(); DialogBoxGO = GameObject.Find("Dialog Boxes"); GameObject tempGoObj; tempGoObj = CreateDialogGO("DB_LoadFile", "Load File"); dialogBoxLoadGame = tempGoObj.GetComponent <DialogBoxLoadGame>(); DialogBoxes["Load File"] = dialogBoxLoadGame; tempGoObj = CreateDialogGO("DB_Settings", "Settings"); dialogBoxSettings = tempGoObj.GetComponent <DialogBoxSettings>(); DialogBoxes["Settings"] = dialogBoxSettings; // Added for more dev options tempGoObj = CreateDialogGO("DB_Settings-Developer", "Developer Settings"); dialogBoxSettings.devOptions = tempGoObj.GetComponent <DialogBoxSettingsDeveloper>(); tempGoObj = CreateDialogGO("DB_PromptOrInfo", "Prompt or Info"); dialogBoxPromptOrInfo = tempGoObj.GetComponent <DialogBoxPromptOrInfo>(); DialogBoxes["Prompt or Info"] = dialogBoxPromptOrInfo; if (SceneController.Instance.IsAtMainScene()) { tempGoObj = CreateDialogGO("DB_SaveFile", "Save File"); dialogBoxSaveGame = tempGoObj.GetComponent <DialogBoxSaveGame>(); DialogBoxes["Save File"] = dialogBoxSaveGame; tempGoObj = CreateDialogGO("DB_Options", "Options"); dialogBoxOptions = tempGoObj.GetComponent <DialogBoxOptions>(); DialogBoxes["Options"] = dialogBoxOptions; tempGoObj = CreateDialogGO("DB_Trade", "Trade"); dialogBoxTrade = tempGoObj.GetComponent <DialogBoxTrade>(); DialogBoxes["Trade"] = dialogBoxTrade; tempGoObj = CreateDialogGO("DB_JobList", "Job List"); dialogBoxJobList = tempGoObj.GetComponent <DialogBoxJobList>(); DialogBoxes["Job List"] = dialogBoxJobList; tempGoObj = CreateDialogGO("DB_Quests", "Quests"); dialogBoxQuests = tempGoObj.GetComponent <DialogBoxQuests>(); DialogBoxes["Quests"] = dialogBoxQuests; AddQuestList(); LoadModdedDialogBoxes(); AddMainMenuItems(); } }
public void Awake() { DialogBoxGO = GameObject.Find("Dialog Boxes"); GameObject tempGoObj; tempGoObj = CreateDialogGO("DB_LoadFile", "Load File"); dialogBoxLoadGame = tempGoObj.GetComponent <DialogBoxLoadGame>(); tempGoObj = CreateDialogGO("DB_Settings", "Settings"); dialogBoxSettings = tempGoObj.GetComponent <DialogBoxSettings>(); tempGoObj = CreateDialogGO("DB_PromptOrInfo", "Prompt or Info"); dialogBoxPromptOrInfo = tempGoObj.GetComponent <DialogBoxPromptOrInfo>(); if (SceneController.Instance.IsAtMainScene()) { tempGoObj = CreateDialogGO("DB_SaveFile", "Save File"); dialogBoxSaveGame = tempGoObj.GetComponent <DialogBoxSaveGame>(); tempGoObj = CreateDialogGO("DB_Options", "Options"); dialogBoxOptions = tempGoObj.GetComponent <DialogBoxOptions>(); tempGoObj = CreateDialogGO("DB_Trade", "Trade"); dialogBoxTrade = tempGoObj.GetComponent <DialogBoxTrade>(); tempGoObj = CreateDialogGO("DB_JobList", "Job List"); dialogBoxJobList = tempGoObj.GetComponent <DialogBoxJobList>(); tempGoObj = CreateDialogGO("DB_Quests", "Quests"); dialogBoxQuests = tempGoObj.GetComponent <DialogBoxQuests>(); AddQuestList(); AddMainMenuItems(); } }
/// <summary> /// Show a dialog box with the configured <see cref="DialogBoxOptions"/>. /// </summary> public static void ShowDialog(DialogBoxOptions options) { MainContent.Instance.ShowDialog(options); }