Merge pull request #3983 from pchote/polish-chat-input
Polish chat input.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user