From d01b3a25c47b545656f47a9edeefd58f9dceb7ee Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 14 Jul 2010 23:29:05 +1200 Subject: [PATCH] Fix some initial nits --- OpenRA.Game/OpenRA.Game.csproj | 3 +- OpenRA.Game/Widgets/ChatDisplayWidget.cs | 3 +- OpenRA.Game/Widgets/Delegates/ChatDelegate.cs | 33 ----- .../Widgets/Delegates/IngameChromeDelegate.cs | 2 + .../Widgets/Delegates/LobbyDelegate.cs | 2 +- mods/cnc/chrome/ingame.yaml | 125 +++--------------- mods/ra/chrome/ingame.yaml | 123 +---------------- 7 files changed, 26 insertions(+), 265 deletions(-) delete mode 100644 OpenRA.Game/Widgets/Delegates/ChatDelegate.cs diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index e2189c1172..b3d423fac7 100755 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -1,4 +1,4 @@ - + Debug @@ -88,7 +88,6 @@ - diff --git a/OpenRA.Game/Widgets/ChatDisplayWidget.cs b/OpenRA.Game/Widgets/ChatDisplayWidget.cs index cb1030cf6c..3e53515832 100644 --- a/OpenRA.Game/Widgets/ChatDisplayWidget.cs +++ b/OpenRA.Game/Widgets/ChatDisplayWidget.cs @@ -49,7 +49,8 @@ namespace OpenRA.Widgets var renderer = Game.chrome.renderer; var font = renderer.RegularFont; - + + renderer.RgbaSpriteRenderer.Flush(); renderer.Device.EnableScissor(chatLogArea.Left, chatLogArea.Top, chatLogArea.Width, chatLogArea.Height); foreach (var line in recentLines.AsEnumerable().Reverse()) { diff --git a/OpenRA.Game/Widgets/Delegates/ChatDelegate.cs b/OpenRA.Game/Widgets/Delegates/ChatDelegate.cs deleted file mode 100644 index 7d96eca3db..0000000000 --- a/OpenRA.Game/Widgets/Delegates/ChatDelegate.cs +++ /dev/null @@ -1,33 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. - * This file is part of OpenRA. - * - * OpenRA is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * OpenRA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with OpenRA. If not, see . - */ -#endregion - -namespace OpenRA.Widgets.Delegates -{ - public class ChatDelegate : IWidgetDelegate - { - public ChatDelegate() - { - var r = Chrome.rootWidget; - var chatDisplay = r.GetWidget("INGAME_CHAT_DISPLAY"); - var chatEntry = r.GetWidget("INGAME_CHAT_ENTRY"); - Game.AddChatLine += chatDisplay.AddLine; - } - } -} diff --git a/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs b/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs index 81f067598b..d004fddb76 100644 --- a/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/IngameChromeDelegate.cs @@ -62,6 +62,8 @@ namespace OpenRA.Widgets.Delegates Game.Exit(); return true; }; + + Game.AddChatLine += gameRoot.GetWidget("CHAT_DISPLAY").AddLine; } } } diff --git a/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs b/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs index 9a4a9ccd74..ce0b44456b 100644 --- a/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs @@ -103,7 +103,7 @@ namespace OpenRA.Widgets.Delegates }; Game.LobbyInfoChanged += UpdatePlayerList; - Game.AddChatLine += (c, n, s) => lobby.GetWidget("CHAT_DISPLAY").AddLine(c, n, s); + Game.AddChatLine += lobby.GetWidget("CHAT_DISPLAY").AddLine; bool teamChat = false; var chatLabel = lobby.GetWidget("LABEL_CHATTYPE"); diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index ed4fedb066..2f2b3766c6 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -125,113 +125,18 @@ Container@ROOT: Text:Diplomacy Align:Center Bold:True - Background@PERF_BG: - ClickThrough:true - Id:PERF_BG - Background:dialog4 - Delegate:PerfDebugDelegate - X:10 - Y:WINDOW_BOTTOM - 250 - Width: 210 - Height: 250 - Children: - PerfGraph@GRAPH: - Id:GRAPH - X:5 - Y:5 - Width:200 - Height:200 - Label@TEXT: - Id:TEXT - Bold: false - X:20 - Y:205 - Width:170 - Height:40 - Background@MUSIC_BG: - Id:MUSIC_BG - Delegate:MusicPlayerDelegate - X:WINDOW_RIGHT - 175 - Y:WINDOW_BOTTOM - 95 - Width: 160 - Height: 55 - Visible: true - Children: - Button@BUTTON_PLAY: - Id:BUTTON_PLAY - Visible:false - X:50 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_PLAY: - Id:IMAGE_PLAY - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:play - Button@BUTTON_PAUSE: - Id:BUTTON_PAUSE - X:50 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_PAUSE: - Id:IMAGE_PAUSE - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:pause - Button@BUTTON_STOP: - Id:BUTTON_STOP - X:85 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_STOP: - Id:IMAGE_STOP - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:stop - Button@BUTTON_NEXT: - Id:BUTTON_NEXT - X:120 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_NEXT: - Id:IMAGE_NEXT - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:next - Button@BUTTON_PREV: - Id:BUTTON_PREV - X:15 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_PREV: - Id:IMAGE_PREV - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:prev - - + ChatDisplay@CHAT_DISPLAY: + Id:CHAT_DISPLAY + X:250 + Y:WINDOW_BOTTOM - HEIGHT - 30 + Width: 760 + Height: 200 + ClickThrough: True + DrawBackground: False + ChatEntry@CHAT_ENTRY: + Id:CHAT_ENTRY + X:250 + Y:WINDOW_BOTTOM - HEIGHT + Width: 760 + Height: 30 + ClickThrough: True \ No newline at end of file diff --git a/mods/ra/chrome/ingame.yaml b/mods/ra/chrome/ingame.yaml index 4eb6a4ca12..2f2b3766c6 100644 --- a/mods/ra/chrome/ingame.yaml +++ b/mods/ra/chrome/ingame.yaml @@ -125,131 +125,18 @@ Container@ROOT: Text:Diplomacy Align:Center Bold:True - ChatDisplay@INGAME_CHAT_DISPLAY: - Id:INGAME_CHAT_DISPLAY + ChatDisplay@CHAT_DISPLAY: + Id:CHAT_DISPLAY X:250 Y:WINDOW_BOTTOM - HEIGHT - 30 Width: 760 Height: 200 - Visible: True - Delegate: ChatDelegate ClickThrough: True DrawBackground: False - ChatEntry@INGAME_CHAT_ENTRY: - Id:INGAME_CHAT_ENTRY + ChatEntry@CHAT_ENTRY: + Id:CHAT_ENTRY X:250 Y:WINDOW_BOTTOM - HEIGHT Width: 760 Height: 30 - Visible: True - ClickThrough: True - Background@PERF_BG: - ClickThrough:true - Id:PERF_BG - Background:dialog4 - Delegate:PerfDebugDelegate - X:10 - Y:WINDOW_BOTTOM - 250 - Width: 210 - Height: 250 - Children: - PerfGraph@GRAPH: - Id:GRAPH - X:5 - Y:5 - Width:200 - Height:200 - Label@TEXT: - Id:TEXT - Bold: false - X:20 - Y:205 - Width:170 - Height:40 - Background@MUSIC_BG: - Id:MUSIC_BG - Delegate:MusicPlayerDelegate - X:WINDOW_RIGHT - 175 - Y:WINDOW_BOTTOM - 95 - Width: 160 - Height: 55 - Visible: true - Children: - Button@BUTTON_PLAY: - Id:BUTTON_PLAY - Visible:false - X:50 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_PLAY: - Id:IMAGE_PLAY - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:play - Button@BUTTON_PAUSE: - Id:BUTTON_PAUSE - X:50 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_PAUSE: - Id:IMAGE_PAUSE - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:pause - Button@BUTTON_STOP: - Id:BUTTON_STOP - X:85 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_STOP: - Id:IMAGE_STOP - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:stop - Button@BUTTON_NEXT: - Id:BUTTON_NEXT - X:120 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_NEXT: - Id:IMAGE_NEXT - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:next - Button@BUTTON_PREV: - Id:BUTTON_PREV - X:15 - Y:15 - Width:25 - Height:25 - Children: - Image@IMAGE_PREV: - Id:IMAGE_PREV - X:0 - Y:0 - Width:25 - Height:25 - ImageCollection:music - ImageName:prev - - + ClickThrough: True \ No newline at end of file