First test build

This commit is contained in:
John Gross
2017-03-30 15:24:39 -07:00
parent 650ab05d74
commit 5c1a9a5e35
47 changed files with 1610 additions and 498 deletions

View File

@@ -32,22 +32,32 @@ namespace Torch.Server
private void addBtn_Click(object sender, RoutedEventArgs e)
{
var dialog = new AddModsDialog();
dialog.ShowDialog();
ulong[] mods;
if (!string.IsNullOrEmpty(ModIdBox.Text))
{
mods = new ulong[1];
ulong.TryParse(ModIdBox.Text, out mods[0]);
}
else
{
var dialog = new AddModsDialog();
dialog.ShowDialog();
mods = dialog.Result;
}
foreach (var id in dialog.Result)
foreach (var id in mods)
{
var details = SteamHelper.GetItemDetails(id);
if (details.FileType != WorkshopFileType.Community)
continue;
var item = SteamHelper.GetModItem(details);
var desc = string.Join("\n", details.Description.ReadLines(5, true), "Double click to open the workshop page.");
var desc = details.Description.Length < 500 ? details.Description : details.Description.Substring(0, 500);
ModList.Items.Add(new ModViewModel(item, desc));
}
}
private void modList_OnMouesDoubleClick(object sender, MouseButtonEventArgs e)
private void modList_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var box = (ListView)sender;
if (box.SelectedItem == null)