Merge branch 'master' into setupBranch
This commit is contained in:
@@ -4,6 +4,7 @@ using GalaSoft.MvvmLight.Command;
|
||||
using SharedClientServer;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
@@ -18,10 +19,14 @@ namespace Client.ViewModels
|
||||
private GameWindow window;
|
||||
private Point currentPoint = new Point();
|
||||
private Color color;
|
||||
private dynamic _payload;
|
||||
private string _username;
|
||||
private string _message;
|
||||
|
||||
public static ObservableCollection<string> Messages { get; } = new ObservableCollection<string>();
|
||||
|
||||
private dynamic _payload;
|
||||
|
||||
public string _username;
|
||||
|
||||
public string _message;
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
@@ -150,6 +155,19 @@ namespace Client.ViewModels
|
||||
data.Client.SendMessage(JSONConvert.GetMessageToSend(JSONConvert.MESSAGE, _payload));
|
||||
}
|
||||
|
||||
public static void HandleIncomingMsg(string username, string message)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(delegate
|
||||
{
|
||||
Messages.Add($"{username}: {message}");
|
||||
});
|
||||
}
|
||||
public void LeaveGame(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
Debug.WriteLine("Leaving...");
|
||||
data.Client.SendMessage(JSONConvert.ConstructLobbyLeaveMessage(data.Lobby.ID));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user