add a close button with hotkey to diplomacy widget

This commit is contained in:
Matthias Mailänder
2013-03-24 08:37:38 +01:00
parent 15324b1f1a
commit 91442a0414
2 changed files with 10 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
validPlayers = world.Players.Where(a => a != world.LocalPlayer && !a.NonCombatant).Count();
diplomacy.IsVisible = () => (validPlayers > 0);
diplomacyBG.Get<ButtonWidget>("CLOSE_DIPLOMACY").OnClick = () => { diplomacyBG.Visible = false; };
}
// This is shit

View File

@@ -198,6 +198,14 @@ Container@INGAME_ROOT:
Text:Diplomacy
Align:Center
Font:Bold
Button@CLOSE_DIPLOMACY:
X:(PARENT_RIGHT - WIDTH)/2
Y:350
Width:160
Height:25
Text:Close
Font:Bold
Key:escape
ChatDisplay@CHAT_DISPLAY:
X:250
Y:WINDOW_BOTTOM - HEIGHT - 30