Merge pull request #3983 from pchote/polish-chat-input

Polish chat input.
This commit is contained in:
Matthias Mailänder
2013-10-24 10:25:23 -07:00
15 changed files with 167 additions and 271 deletions

View File

@@ -35,17 +35,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
() => world.OrderGenerator is T ? icon + "-active" : icon;
}
void AddChatLine(Color c, string from, string text)
{
ingameRoot.Get<ChatDisplayWidget>("CHAT_DISPLAY").AddLine(c, from, text);
}
void UnregisterEvents()
{
Game.AddChatLine -= AddChatLine;
Game.BeforeGameStart -= UnregisterEvents;
}
[ObjectCreator.UseCtor]
public CncIngameChromeLogic(Widget widget, World world)
{
@@ -53,9 +42,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
world.WorldActor.Trait<CncMenuPaletteEffect>()
.Fade(CncMenuPaletteEffect.EffectType.None);
Game.AddChatLine += AddChatLine;
Game.BeforeGameStart += UnregisterEvents;
ingameRoot = widget.Get("INGAME_ROOT");
var playerRoot = ingameRoot.Get("PLAYER_ROOT");
@@ -64,6 +50,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
InitObserverWidgets(world, playerRoot);
else
InitPlayerWidgets(world, playerRoot);
Game.LoadWidget(world, "CHAT_PANEL", playerRoot, new WidgetArgs());
}
public void OptionsClicked()

View File

@@ -153,10 +153,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
mouseScrollDropdown.OnMouseDown = _ => ShowMouseScrollDropdown(mouseScrollDropdown, gameSettings);
mouseScrollDropdown.GetText = () => gameSettings.MouseScroll.ToString();
var teamchatCheckbox = inputPane.Get<CheckboxWidget>("TEAMCHAT_CHECKBOX");
teamchatCheckbox.IsChecked = () => gameSettings.TeamChatToggle;
teamchatCheckbox.OnClick = () => gameSettings.TeamChatToggle ^= true;
panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = () =>
{
playerSettings.Name = nameTextfield.Text;