Use the newly polished text entry in C&C.

This commit is contained in:
Paul Chote
2013-10-22 21:47:58 +13:00
parent 15de893cec
commit 11b34884cc
9 changed files with 69 additions and 156 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;