public static void ExitDialog(string message) { Game.Instance.gameObject.SetActive(false); var dialog = new PDialog("Forced Exit") { Title = "Forced Exit", DialogBackColor = PUITuning.Colors.DialogDarkBackground, DialogClosed = (option) => OnConfirm(), Size = new Vector2(320.0f, 200.0f), MaxSize = new Vector2(800.0f, 600.0f), SortKey = 150.0f, }.AddButton(PDialog.DIALOG_KEY_CLOSE, STRINGS.UI.CONFIRMDIALOG.OK, null, PUITuning.Colors.ButtonPinkStyle); dialog.Body.Margin = new RectOffset(20, 20, 20, 20); dialog.Body.AddChild(new PLabel("ExitReason") { Text = message, TextStyle = PUITuning.Fonts.UILightStyle, Margin = new RectOffset(0, 0, 0, 20) }); dialog.Body.AddChild(new PLabel("ExitReason2") { Text = "The game is now going to quit. Your game has been saved.", TextStyle = PUITuning.Fonts.UILightStyle }); dialog.Show(); }
internal void CreateDialog() { var dialog = new PDialog("ModifyItem") { Title = string.Format(UI.MODIFYDIALOG.TITLE, mod.label.title.ToUpper()), DialogClosed = OnDialogClosed, SortKey = 200.0f, Parent = parent }.AddButton("ok", UI.MODIFYDIALOG.OK, null, PUITuning.Colors.ButtonPinkStyle). AddButton("close", UI.MODIFYDIALOG.CANCEL, null, PUITuning.Colors. ButtonBlueStyle); var body = new PGridPanel("ModifyBody") { Margin = new RectOffset(10, 10, 10, 10) }.AddColumn(new GridColumnSpec()).AddColumn(new GridColumnSpec(0.0f, 1.0f)); body.AddRow(UI.MODIFYDIALOG.CAPTION, new PTextField("Title") { Text = editor.Title, MaxLength = 127, MinWidth = 512, BackColor = PUITuning.Colors.DialogDarkBackground, TextStyle = PUITuning.Fonts. TextLightStyle, TextAlignment = TMPro.TextAlignmentOptions.Left }.AddOnRealize((obj) => titleField = obj)); body.AddRow(UI.MODIFYDIALOG.DESC, new PTextArea("Description") { LineCount = 8, Text = editor.Description, MaxLength = 7999, MinWidth = 512, BackColor = PUITuning.Colors.DialogDarkBackground, TextStyle = PUITuning.Fonts.TextLightStyle }.AddOnRealize((obj) => descriptionField = obj)); body.AddRow(UI.MODIFYDIALOG.IMAGE_PATH, CheckGroup(new PCheckBox("UpdateImage") { CheckSize = new Vector2(16.0f, 16.0f), OnChecked = ToggleCheckbox, BackColor = PUITuning.Colors.DialogDarkBackground, CheckColor = PUITuning.Colors. ComponentDarkStyle }.AddOnRealize((obj) => doUpdateImg = obj), new PTextField("PreviewPath") { Text = editor.PreviewPath, MaxLength = 512, MinWidth = 512, BackColor = PUITuning.Colors.DialogDarkBackground, TextStyle = PUITuning.Fonts. TextLightStyle, TextAlignment = TMPro.TextAlignmentOptions.Left }.AddOnRealize((obj) => imagePathField = obj))); body.AddRow(UI.MODIFYDIALOG.DATA_PATH, CheckGroup(new PCheckBox("UpdateData") { CheckSize = new Vector2(16.0f, 16.0f), OnChecked = ToggleCheckbox, BackColor = PUITuning.Colors.DialogDarkBackground, CheckColor = PUITuning.Colors. ComponentDarkStyle }.AddOnRealize((obj) => doUpdateData = obj), new PTextField("DataPath") { Text = editor.DataPath, MaxLength = 512, MinWidth = 512, BackColor = PUITuning.Colors.DialogDarkBackground, TextStyle = PUITuning.Fonts. TextLightStyle, TextAlignment = TMPro.TextAlignmentOptions.Left }.AddOnRealize((obj) => dataPathField = obj))); body.AddRow(UI.MODIFYDIALOG.PATCHNOTES, new PTextField("PatchNotes") { Text = editor.PatchInfo, MaxLength = 512, MinWidth = 512, BackColor = PUITuning.Colors.DialogDarkBackground, TextStyle = PUITuning.Fonts. TextLightStyle, TextAlignment = TMPro.TextAlignmentOptions.Left }.AddOnRealize((obj) => patchNotesField = obj)); dialog.Body.AddChild(body); dialog.Show(); }
public static bool Prefix(GeneShuffler __instance, Worker worker) { var parent = GameScreenManager.Instance.ssOverlayCanvas.gameObject; var dialog = new PDialog("ModifyItem") { Title = "", DialogClosed = OnDialogClosed, SortKey = 200.0f }.AddButton("ok", "OK", null, PUITuning.Colors.ButtonPinkStyle). AddButton("close", "Cancel", null, PUITuning.Colors. ButtonBlueStyle); //var body = new PGridPanel("ModifyBody") //{ // Margin = new RectOffset(10, 10, 10, 10) //}.AddColumn(new GridColumnSpec()).AddColumn(new GridColumnSpec(0.0f, 1.0f)); //body.AddRow(UI.MODIFYDIALOG.CAPTION, new PTextField("Title") //{ // Text = editor.Title, // MaxLength = 127, // MinWidth = 512, // BackColor = // PUITuning.Colors.DialogDarkBackground, // TextStyle = PUITuning.Fonts. // TextLightStyle, // TextAlignment = TMPro.TextAlignmentOptions.Left //}.AddOnRealize((obj) => titleField = obj0)); //body.AddRow(UI.MODIFYDIALOG.DESC, new PTextArea("Description") //{ // LineCount = 8, // Text = editor.Description, // MaxLength = 7999, // MinWidth = 512, // BackColor = PUITuning.Colors.DialogDarkBackground, // TextStyle = PUITuning.Fonts.TextLightStyle //}.AddOnRealize((obj) => descriptionField = obj)); //body.AddRow(UI.MODIFYDIALOG.IMAGE_PATH, CheckGroup(new PCheckBox("UpdateImage") //{ // CheckSize = new Vector2(16.0f, 16.0f), // OnChecked = ToggleCheckbox, // BackColor = // PUITuning.Colors.DialogDarkBackground, // CheckColor = PUITuning.Colors. // ComponentDarkStyle //}.AddOnRealize((obj) => doUpdateImg = obj), new PTextField("PreviewPath") //{ // Text = editor.PreviewPath, // MaxLength = 512, // MinWidth = 512, // BackColor = // PUITuning.Colors.DialogDarkBackground, // TextStyle = PUITuning.Fonts. // TextLightStyle, // TextAlignment = TMPro.TextAlignmentOptions.Left //}.AddOnRealize((obj) => imagePathField = obj))); //body.AddRow(UI.MODIFYDIALOG.DATA_PATH, CheckGroup(new PCheckBox("UpdateData") //{ // CheckSize = new Vector2(16.0f, 16.0f), // OnChecked = ToggleCheckbox, // BackColor = // PUITuning.Colors.DialogDarkBackground, // CheckColor = PUITuning.Colors. // ComponentDarkStyle //}.AddOnRealize((obj) => doUpdateData = obj), new PTextField("DataPath") //{ // Text = editor.DataPath, // MaxLength = 512, // MinWidth = 512, // BackColor = // PUITuning.Colors.DialogDarkBackground, // TextStyle = PUITuning.Fonts. // TextLightStyle, // TextAlignment = TMPro.TextAlignmentOptions.Left //}.AddOnRealize((obj) => dataPathField = obj))); //body.AddRow(UI.MODIFYDIALOG.PATCHNOTES, new PTextField("PatchNotes") //{ // Text = editor.PatchInfo, // MaxLength = 512, // MinWidth = 512, // BackColor = PUITuning.Colors.DialogDarkBackground, // TextStyle = PUITuning.Fonts. // TextLightStyle, // TextAlignment = TMPro.TextAlignmentOptions.Left //}.AddOnRealize((obj) => patchNotesField = obj)); //dialog.Body.AddChild(body); dialog.Show(); return(true); }