/
DeepGameScan.xaml.cs
75 lines (69 loc) · 2.42 KB
/
DeepGameScan.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using ocust.Structure;
namespace ocust
{
/// <summary>
/// Interaction logic for DeepGameScan.xaml
/// </summary>
public partial class DeepGameScan : Page
{
public DeepGameScan()
{
InitializeComponent();
}
private void echo(String s)
{
ListBoxItem li = new ListBoxItem();
li.Foreground = Brushes.Black;
li.Content = s;
listBox1.Items.Add(li);
}
private void echo(string s, Brush c)
{
ListBoxItem li = new ListBoxItem();
li.Foreground = c;
li.Content = s;
listBox1.Items.Add(li);
}
private void btnStart_Click(object sender, RoutedEventArgs e)
{
btnStart.IsEnabled = false;
listBox1.Items.Clear();
echo("Game File Location Correct :" + App.Game.Filename, Brushes.Green);
echo("Set File Locations Correct", Brushes.Green);
echo("Unzipping game file");
App.Unzip_Files();
Octgn.Game g = new Octgn.Game(Octgn.Definitions.GameDef.FromO8G(App.Game.Filename));
echo("Loading Relationship File...");
App.Load_Relationships();
echo("Verifying Relationship file targets...");
foreach (Relationship r in App.Relationships)
{
string checkloc = App.UnzipPath + r.Target.Replace("/", "\\");
if (File.Exists(checkloc))
{
echo(" " + "Target: " + r.Target + " Exists.", Brushes.Green);
}
else
{
echo(" " + "Target: " + r.Target + " Doesn't Exist!", Brushes.Red);
}
}
echo("Done Verifying Relationship File Targets.");
//XmlStuff x = new XmlStuff();
//if (x.validateXml(App.UnzipPath + "\\" + App.gameFilePrefix + ".xml"))
//{
// echo(App.gameFilePrefix + ".xml Is valid.");
//}
//else
//{
// echo(App.gameFilePrefix + ".xml is corrupt, you should redownload this file.", Brushes.Red);
//}
btnStart.IsEnabled = true;
}
}
}