Restore two-button prompt for two-button dialogs.

This commit is contained in:
Paul Chote
2016-04-01 17:51:44 +01:00
parent 95f091853e
commit 1fadc8531c
3 changed files with 77 additions and 3 deletions

View File

@@ -26,7 +26,8 @@ namespace OpenRA.Mods.Common.Widgets
string cancelText = null, string cancelText = null,
string otherText = null) string otherText = null)
{ {
var prompt = Ui.OpenWindow("CONFIRM_PROMPT"); var promptName = onOther != null ? "CONFIRM_PROMPT_THREEBUTTON" : "CONFIRM_PROMPT_TWOBUTTON";
var prompt = Ui.OpenWindow(promptName);
var confirmButton = prompt.Get<ButtonWidget>("CONFIRM_BUTTON"); var confirmButton = prompt.Get<ButtonWidget>("CONFIRM_BUTTON");
var cancelButton = prompt.GetOrNull<ButtonWidget>("CANCEL_BUTTON"); var cancelButton = prompt.GetOrNull<ButtonWidget>("CANCEL_BUTTON");
var otherButton = prompt.GetOrNull<ButtonWidget>("OTHER_BUTTON"); var otherButton = prompt.GetOrNull<ButtonWidget>("OTHER_BUTTON");

View File

@@ -133,7 +133,7 @@ ScrollPanel@SPECTATOR_DROPDOWN_TEMPLATE:
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: 25 Height: 25
Container@CONFIRM_PROMPT: Container@CONFIRM_PROMPT_THREEBUTTON:
X: (WINDOW_RIGHT - WIDTH)/2 X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 90)/2 Y: (WINDOW_BOTTOM - 90)/2
Width: 500 Width: 500
@@ -177,6 +177,44 @@ Container@CONFIRM_PROMPT:
Height: 35 Height: 35
Text: Cancel Text: Cancel
Container@CONFIRM_PROMPT_TWOBUTTON:
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 90)/2
Width: 370
Height: 125
Children:
Label@PROMPT_TITLE:
Width: PARENT_RIGHT
Y: 0-25
Font: BigBold
Contrast: true
Align: Center
Background@bg:
Width: 370
Height: 90
Background: panel-black
Children:
Label@PROMPT_TEXT:
Y: (PARENT_BOTTOM-HEIGHT)/2
Width: PARENT_RIGHT
Height: 25
Font: Bold
Align: Center
Button@CANCEL_BUTTON:
Key: escape
Y: 89
Width: 140
Height: 35
Text: Cancel
Button@CONFIRM_BUTTON:
Key: return
X: 230
Y: 89
Width: 140
Height: 35
Text: Confirm
Container@CANCEL_PROMPT: Container@CANCEL_PROMPT:
X: (WINDOW_RIGHT - WIDTH)/2 X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 90)/2 Y: (WINDOW_BOTTOM - 90)/2

View File

@@ -1,4 +1,4 @@
Background@CONFIRM_PROMPT: Background@CONFIRM_PROMPT_THREEBUTTON:
X: (WINDOW_RIGHT - WIDTH)/2 X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 90)/2 Y: (WINDOW_BOTTOM - 90)/2
Width: 600 Width: 600
@@ -40,6 +40,41 @@ Background@CONFIRM_PROMPT:
Font: Bold Font: Bold
Key: escape Key: escape
Background@CONFIRM_PROMPT_TWOBUTTON:
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 90)/2
Width: 370
Height: 175
Children:
Label@PROMPT_TITLE:
Width: PARENT_RIGHT
Y: 20
Height: 25
Font: Bold
Align: Center
Label@PROMPT_TEXT:
X: 15
Y: 50
Width: PARENT_RIGHT - 30
Height: 65
Align: Center
Button@CONFIRM_BUTTON:
X: 20
Y: PARENT_BOTTOM - 45
Width: 160
Height: 25
Text: Confirm
Font: Bold
Key: return
Button@CANCEL_BUTTON:
X: PARENT_RIGHT - 180
Y: PARENT_BOTTOM - 45
Width: 160
Height: 25
Text: Cancel
Font: Bold
Key: escape
Background@CANCEL_PROMPT: Background@CANCEL_PROMPT:
X: (WINDOW_RIGHT - WIDTH)/2 X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 90)/2 Y: (WINDOW_BOTTOM - 90)/2