Bug #32 fixed (a little hacky)
This commit is contained in:
@@ -10,15 +10,22 @@ namespace OpenRa
|
|||||||
|
|
||||||
public List<Tuple<Color, string, string>> recentLines = new List<Tuple<Color, string, string>>();
|
public List<Tuple<Color, string, string>> recentLines = new List<Tuple<Color, string, string>>();
|
||||||
public string typing = "";
|
public string typing = "";
|
||||||
public bool isChatting = false;
|
public bool isChatting = true;
|
||||||
|
|
||||||
public void Toggle()
|
public void Toggle()
|
||||||
{
|
{
|
||||||
if (isChatting && typing.Length > 0)
|
if (isChatting && typing.Length > 0)
|
||||||
Game.IssueOrder(Order.Chat(typing));
|
Game.IssueOrder(Order.Chat(typing));
|
||||||
|
|
||||||
|
typing = "";
|
||||||
|
if (Game.orderManager.GameStarted)
|
||||||
|
isChatting ^= true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Reset()
|
||||||
|
{
|
||||||
typing = "";
|
typing = "";
|
||||||
isChatting ^= true;
|
isChatting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TypeChar(char c)
|
public void TypeChar(char c)
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ namespace OpenRa
|
|||||||
|
|
||||||
public static void StartGame()
|
public static void StartGame()
|
||||||
{
|
{
|
||||||
|
Game.chat.Reset();
|
||||||
var available = world.Map.SpawnPoints.ToList();
|
var available = world.Map.SpawnPoints.ToList();
|
||||||
var taken = new List<int2>();
|
var taken = new List<int2>();
|
||||||
|
|
||||||
@@ -283,12 +284,12 @@ namespace OpenRa
|
|||||||
internal static void HandleKeyPress( KeyPressEventArgs e )
|
internal static void HandleKeyPress( KeyPressEventArgs e )
|
||||||
{
|
{
|
||||||
int sync = Game.world.SyncHash();
|
int sync = Game.world.SyncHash();
|
||||||
|
|
||||||
if( e.KeyChar == '\r' )
|
if( e.KeyChar == '\r' )
|
||||||
Game.chat.Toggle();
|
Game.chat.Toggle();
|
||||||
else if( Game.chat.isChatting )
|
else if( Game.chat.isChatting )
|
||||||
Game.chat.TypeChar( e.KeyChar );
|
Game.chat.TypeChar( e.KeyChar );
|
||||||
|
|
||||||
if( sync != Game.world.SyncHash() )
|
if( sync != Game.world.SyncHash() )
|
||||||
throw new InvalidOperationException( "Desync in OnKeyPress" );
|
throw new InvalidOperationException( "Desync in OnKeyPress" );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ namespace OpenRa.Graphics
|
|||||||
{
|
{
|
||||||
world.WorldRenderer.Draw();
|
world.WorldRenderer.Draw();
|
||||||
Game.chrome.Draw( world );
|
Game.chrome.Draw( world );
|
||||||
|
|
||||||
|
|
||||||
if( Game.orderManager.Connection.ConnectionState == ConnectionState.NotConnected )
|
if( Game.orderManager.Connection.ConnectionState == ConnectionState.NotConnected )
|
||||||
Game.chrome.DrawDialog("Connection lost.");
|
Game.chrome.DrawDialog("Connection lost.");
|
||||||
|
|||||||
Reference in New Issue
Block a user