Rename to Torch, add command system

This commit is contained in:
John Gross
2016-12-17 01:59:03 -08:00
parent 7d51ac9295
commit fb521abbda
85 changed files with 366 additions and 354 deletions

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using Torch;
using Sandbox;
using Sandbox.Engine.Multiplayer;
using Sandbox.Game.World;
using SteamSDK;
namespace Torch.Server
{
/// <summary>
/// Interaction logic for ChatControl.xaml
/// </summary>
public partial class ChatControl : UserControl
{
public ChatControl()
{
InitializeComponent();
ChatItems.ItemsSource = TorchServer.Multiplayer.ChatView;
}
private void SendButton_Click(object sender, RoutedEventArgs e)
{
OnMessageEntered();
}
private void Message_OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
OnMessageEntered();
}
private void OnMessageEntered()
{
//Can't use Message.Text directly because of object ownership in WPF.
var text = Message.Text;
TorchServer.Multiplayer.SendMessage(text);
Message.Text = "";
}
}
}