Refactor, fix chat scroll, rework automatic update system, remove manual install method, add documentation

This commit is contained in:
John Gross
2017-07-06 14:44:29 -07:00
parent 79fe6a08ab
commit 7373dd37a6
31 changed files with 594 additions and 322 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -41,6 +42,17 @@ namespace Torch.Server
_server = (TorchBase)server;
_multiplayer = (MultiplayerManager)server.Multiplayer;
DataContext = _multiplayer;
_multiplayer.ChatHistory.CollectionChanged += ChatHistory_CollectionChanged;
}
private void ChatHistory_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (VisualTreeHelper.GetChildrenCount(ChatItems) > 0)
{
Border border = (Border)VisualTreeHelper.GetChild(ChatItems, 0);
ScrollViewer scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
scrollViewer.ScrollToBottom();
}
}
private void SendButton_Click(object sender, RoutedEventArgs e)