Bug Fixes
This commit is contained in:
parent
7e6669c01f
commit
7ccd65dc68
@ -277,10 +277,12 @@ namespace MafiaClient
|
|||||||
this.FindControl<ListBox>("GameDaySelect").IsEnabled = voting;
|
this.FindControl<ListBox>("GameDaySelect").IsEnabled = voting;
|
||||||
if (players.Count != 0)
|
if (players.Count != 0)
|
||||||
{
|
{
|
||||||
|
this.FindControl<ListBox>("GameDaySelect").Items = null;
|
||||||
List<ListBoxItem> items = new List<ListBoxItem>();
|
List<ListBoxItem> items = new List<ListBoxItem>();
|
||||||
foreach (Player player in players)
|
foreach (Player player in players)
|
||||||
{
|
{
|
||||||
items.Add(new ListBoxItem {Content = player.Id + ") " + player.Name});
|
items.Add(new ListBoxItem {Content = player.Id + ") " + player.Name});
|
||||||
|
Console.WriteLine(player.Id + ") " + player.Name);
|
||||||
}
|
}
|
||||||
this.FindControl<ListBox>("GameDaySelect").Items = items;
|
this.FindControl<ListBox>("GameDaySelect").Items = items;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ namespace MafiaClient
|
|||||||
list.Add(message);
|
list.Add(message);
|
||||||
listBoxes.Items = list;
|
listBoxes.Items = list;
|
||||||
}
|
}
|
||||||
MainWindow.Instance.FindControl<ScrollViewer>("QueueChatViewer").ScrollToEnd();
|
MainWindow.Instance.FindControl<ScrollViewer>(chatName).ScrollToEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendMessage(ChatType chatType, string text)
|
public void SendMessage(ChatType chatType, string text)
|
||||||
@ -76,6 +76,13 @@ namespace MafiaClient
|
|||||||
_socket.Send(PacketConverter.ToBytes(new MessageSendPacket(chatType, text)));
|
_socket.Send(PacketConverter.ToBytes(new MessageSendPacket(chatType, text)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearChats()
|
||||||
|
{
|
||||||
|
MainWindow.Instance.FindControl<ItemsRepeater>("QueueChat").Items = null;
|
||||||
|
MainWindow.Instance.FindControl<ItemsRepeater>("GameVotingActiveChat").Items = null;
|
||||||
|
MainWindow.Instance.FindControl<ItemsRepeater>("GameDayChat").Items = null;
|
||||||
|
}
|
||||||
|
|
||||||
public void Disconnect()
|
public void Disconnect()
|
||||||
{
|
{
|
||||||
_connected = false;
|
_connected = false;
|
||||||
@ -224,6 +231,7 @@ namespace MafiaClient
|
|||||||
break;
|
break;
|
||||||
case PacketType.GameStartPacket:
|
case PacketType.GameStartPacket:
|
||||||
List<Player> players = ((GameStartPacket) packet).Players;
|
List<Player> players = ((GameStartPacket) packet).Players;
|
||||||
|
ClearChats();
|
||||||
switch (((GameStartPacket) packet).Role)
|
switch (((GameStartPacket) packet).Role)
|
||||||
{
|
{
|
||||||
case Role.Citizen:
|
case Role.Citizen:
|
||||||
@ -299,6 +307,7 @@ namespace MafiaClient
|
|||||||
: "Дон";
|
: "Дон";
|
||||||
List<ListBoxItem> items = new List<ListBoxItem>();
|
List<ListBoxItem> items = new List<ListBoxItem>();
|
||||||
MainWindow.Instance.ShowVotingActive("Ты " + rol + ", выбери кого убить!");
|
MainWindow.Instance.ShowVotingActive("Ты " + rol + ", выбери кого убить!");
|
||||||
|
MainWindow.Instance.FindControl<ListBox>("GameVotingActiveSelect").Items = null;
|
||||||
foreach (Player player in players)
|
foreach (Player player in players)
|
||||||
{
|
{
|
||||||
ListBoxItem item = new ListBoxItem
|
ListBoxItem item = new ListBoxItem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user