From 447cd78757780150e668e8fbf2b892e3b66a56b9 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 2 May 2010 13:57:31 +1200 Subject: [PATCH] add resume & surrender buttons to ingame menu --- .../Widgets/Delegates/IngameChromeDelegate.cs | 12 +++++++ mods/cnc/menus.yaml | 31 ++++++++++++++++--- mods/ra/menus.yaml | 22 ++++++++++--- 3 files changed, 56 insertions(+), 9 deletions(-) diff --git a/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs b/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs index 6f33131af7..bcc8522a7d 100644 --- a/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs @@ -46,6 +46,18 @@ namespace OpenRA.Widgets.Delegates optionsBG.GetWidget("BUTTON_SETTINGS").OnMouseUp = mi => { r.OpenWindow("SETTINGS_BG"); return true; + }; + + optionsBG.GetWidget("BUTTON_RESUME").OnMouseUp = mi => + { + optionsBG.Visible = false; + return true; + }; + + optionsBG.GetWidget("BUTTON_SURRENDER").OnMouseUp = mi => + { + Game.IssueOrder(new Order("Surrender", Game.world.LocalPlayer.PlayerActor)); + return true; }; optionsBG.GetWidget("BUTTON_QUIT").OnMouseUp = mi => { diff --git a/mods/cnc/menus.yaml b/mods/cnc/menus.yaml index 93b2067ef1..6f5926731b 100644 --- a/mods/cnc/menus.yaml +++ b/mods/cnc/menus.yaml @@ -97,7 +97,7 @@ Container: X:(WINDOW_RIGHT - WIDTH)/2 Y:(WINDOW_BOTTOM- HEIGHT)/2 Width: 450 - Height: 300 + Height: 350 Visible: false Children: Label@SETTINGS_LABEL_TITLE: @@ -136,6 +136,13 @@ Container: Width:300 Height:20 Text:Show Performance Information + Checkbox@SETTINGS_CHECKBOX_SYNCREPORTS: + Id:SETTINGS_CHECKBOX_SYNCREPORTS + X:100 + Y:180 + Width:300 + Height:20 + Text:Collect Sync Reports Button@SETTINGS_BUTTON_OK: Id:SETTINGS_BUTTON_OK X:PARENT_RIGHT - 180 @@ -531,7 +538,7 @@ Container: X:(WINDOW_RIGHT - WIDTH)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2 Width:300 - Height:220 + Height:280 Visible:false Children: Label@LABEL_TITLE: @@ -542,24 +549,38 @@ Container: Height:25 Text:Options Align:Center + Button@BUTTON_RESUME: + Id:BUTTON_RESUME + X:(PARENT_RIGHT - WIDTH)/2 + Y:60 + Width:160 + Height:25 + Text:Resume + Button@BUTTON_SURRENDER: + Id:BUTTON_SURRENDER + X:(PARENT_RIGHT - WIDTH)/2 + Y:100 + Width:160 + Height:25 + Text:Surrender Button@BUTTON_SETTINGS: Id:BUTTON_SETTINGS X:(PARENT_RIGHT - WIDTH)/2 - Y:80 + Y:140 Width:160 Height:25 Text:Settings Button@BUTTON_DISCONNECT: Id:BUTTON_DISCONNECT X:(PARENT_RIGHT - WIDTH)/2 - Y:120 + Y:180 Width:160 Height:25 Text:Disconnect Button@BUTTON_QUIT: Id:BUTTON_QUIT X:(PARENT_RIGHT - WIDTH)/2 - Y:160 + Y:220 Width:160 Height:25 Text:Quit diff --git a/mods/ra/menus.yaml b/mods/ra/menus.yaml index d7a38fc793..6f5926731b 100644 --- a/mods/ra/menus.yaml +++ b/mods/ra/menus.yaml @@ -538,7 +538,7 @@ Container: X:(WINDOW_RIGHT - WIDTH)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2 Width:300 - Height:220 + Height:280 Visible:false Children: Label@LABEL_TITLE: @@ -549,24 +549,38 @@ Container: Height:25 Text:Options Align:Center + Button@BUTTON_RESUME: + Id:BUTTON_RESUME + X:(PARENT_RIGHT - WIDTH)/2 + Y:60 + Width:160 + Height:25 + Text:Resume + Button@BUTTON_SURRENDER: + Id:BUTTON_SURRENDER + X:(PARENT_RIGHT - WIDTH)/2 + Y:100 + Width:160 + Height:25 + Text:Surrender Button@BUTTON_SETTINGS: Id:BUTTON_SETTINGS X:(PARENT_RIGHT - WIDTH)/2 - Y:80 + Y:140 Width:160 Height:25 Text:Settings Button@BUTTON_DISCONNECT: Id:BUTTON_DISCONNECT X:(PARENT_RIGHT - WIDTH)/2 - Y:120 + Y:180 Width:160 Height:25 Text:Disconnect Button@BUTTON_QUIT: Id:BUTTON_QUIT X:(PARENT_RIGHT - WIDTH)/2 - Y:160 + Y:220 Width:160 Height:25 Text:Quit