Replace the lobby chat textfield with the widget; teamchat and ingame chat don't work yet

This commit is contained in:
Paul Chote
2010-07-10 19:25:00 +12:00
parent 8c59b582d9
commit fdf570398a
5 changed files with 49 additions and 81 deletions

View File

@@ -405,8 +405,8 @@ namespace OpenRA
{
LoadMap(LobbyInfo.GlobalSettings.Map);
if (orderManager.GameStarted) return;
chat.Reset();
Chrome.selectedWidget = null;
world.Queries = new World.AllQueries(world);
foreach (var gs in world.WorldActor.traits.WithInterface<IGameStarted>())
@@ -497,29 +497,21 @@ namespace OpenRA
if (chrome.HandleKeyPress(e, modifiers))
return;
if (e.KeyChar == '\r')
{
chat.Toggle();
chat.isTeamChat = modifiers.HasModifier(Modifiers.Shift);
}
else if (Game.chat.isChatting)
chat.TypeChar(e.KeyChar);
else
{
var c = RemapKeys.ContainsKey(e.KeyChar) ? RemapKeys[e.KeyChar] : e.KeyChar;
var c = RemapKeys.ContainsKey(e.KeyChar) ? RemapKeys[e.KeyChar] : e.KeyChar;
if (c >= '0' && c <= '9')
Game.controller.selection.DoControlGroup(world,
c - '0', modifiers);
if (c >= '0' && c <= '9')
Game.controller.selection.DoControlGroup(world,
c - '0', modifiers);
if (c == 08)
Game.controller.GotoNextBase();
if (c == 08)
Game.controller.GotoNextBase();
if (c == 09)
BuildPaletteWidget.TabChange((Control.ModifierKeys & Keys.Shift) == Keys.Shift ? true : false);
BuildPaletteWidget.DoBuildingHotkey(c, world);
}
if (c == 09)
BuildPaletteWidget.TabChange((Control.ModifierKeys & Keys.Shift) == Keys.Shift ? true : false);
// Todo: move this into the widget
BuildPaletteWidget.DoBuildingHotkey(c, world);
if (sync != Game.world.SyncHash())
throw new InvalidOperationException("Desync in OnKeyPress");