Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: kellyelton/octgn-customizer
base: 5addff4239
...
head fork: kellyelton/octgn-customizer
compare: 580616c78c
  • 18 commits
  • 28 files changed
  • 0 commit comments
  • 2 contributors
Showing with 2,125 additions and 0 deletions.
  1. +30 −0 ocust/ocust.sln
  2. BIN  ocust/ocust.suo
  3. +8 −0 ocust/ocust/App.xaml
  4. +334 −0 ocust/ocust/App.xaml.cs
  5. +8 −0 ocust/ocust/DebugWindow.xaml
  6. +79 −0 ocust/ocust/DebugWindow.xaml.cs
  7. +51 −0 ocust/ocust/DeepGameScan.xaml
  8. +75 −0 ocust/ocust/DeepGameScan.xaml.cs
  9. +38 −0 ocust/ocust/GameEdit.xaml
  10. +208 −0 ocust/ocust/GameEdit.xaml.cs
  11. +24 −0 ocust/ocust/GameSelect.xaml
  12. +35 −0 ocust/ocust/GameSelect.xaml.cs
  13. +38 −0 ocust/ocust/GameSelector.xaml
  14. +123 −0 ocust/ocust/GameSelector.xaml.cs
  15. BIN  ocust/ocust/Icon.ico
  16. +8 −0 ocust/ocust/MainWindow.xaml
  17. +72 −0 ocust/ocust/MainWindow.xaml.cs
  18. +51 −0 ocust/ocust/Properties/AssemblyInfo.cs
  19. +71 −0 ocust/ocust/Properties/Resources.Designer.cs
  20. +117 −0 ocust/ocust/Properties/Resources.resx
  21. +30 −0 ocust/ocust/Properties/Settings.Designer.cs
  22. +7 −0 ocust/ocust/Properties/Settings.settings
  23. +47 −0 ocust/ocust/Properties/app.manifest
  24. +109 −0 ocust/ocust/Splash.xaml
  25. +219 −0 ocust/ocust/Splash.xaml.cs
  26. +13 −0 ocust/ocust/Structure/Relationship.cs
  27. +64 −0 ocust/ocust/XmlStuff.cs
  28. +266 −0 ocust/ocust/ocust.csproj
View
30 ocust/ocust.sln
@@ -0,0 +1,30 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ocust", "ocust\ocust.csproj", "{17B8FAE5-DD13-41C0-A020-64D06EC857BB}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Debug|x86.ActiveCfg = Debug|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Debug|x86.Build.0 = Debug|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Release|Any CPU.ActiveCfg = Release|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Release|Mixed Platforms.Build.0 = Release|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Release|x86.ActiveCfg = Release|x86
+ {17B8FAE5-DD13-41C0-A020-64D06EC857BB}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
BIN  ocust/ocust.suo
Binary file not shown
View
8 ocust/ocust/App.xaml
@@ -0,0 +1,8 @@
+<Application x:Class="ocust.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ StartupUri="MainWindow.xaml">
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
View
334 ocust/ocust/App.xaml.cs
@@ -0,0 +1,334 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Windows;
+using System.Xml;
+using Ionic.Zip;
+using Octgn.Data;
+using ocust.Structure;
+
+namespace ocust
+{
+ /// <summary>
+ /// Interaction logic for App.xaml
+ /// </summary>
+ public partial class App : Application
+ {
+ public static GamesRepository GamesRepository { get; set; }
+
+ public static MainWindow MainWindow { get; set; }
+
+ public static DebugWindow DebugWindow { get; set; }
+
+ public static String UnzipPath { get; set; }
+
+ public static Game Game { get; set; }
+
+ public static String gameFilePrefix { get; set; }
+
+ public static List<Relationship> Relationships { get; set; }
+
+ private static Thread ochecker;
+
+ public Boolean isOctgnRunning
+ {
+ get
+ {
+ //OCTGNwLobby
+ //OCTGN
+ Process[] processes = Process.GetProcessesByName("OCTGNwLobby");
+ if (processes.Length > 0)
+ {
+ return true;
+ }
+ processes = Process.GetProcessesByName("OCTGNwLobby.vhost");
+ if (processes.Length > 0)
+ {
+ return true;
+ }
+ processes = Process.GetProcessesByName("OCTGN");
+ if (processes.Length > 0)
+ {
+ return true;
+ }
+ processes = Process.GetProcessesByName("OCTGN.vhost");
+ if (processes.Length > 0)
+ {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public static void SetStatus(String s)
+ {
+ Splash sp = App.Current.MainWindow.Content as Splash;
+ if (sp != null)
+ {
+ sp.setstatus(s);
+ }
+ }
+
+ public static void addDebugLine(String s)
+ {
+#if(DEBUG)
+ DebugWindow.AddLine(s);
+#endif
+ }
+
+ public static Version Version
+ {
+ get
+ {
+ Assembly asm = typeof(App).Assembly;
+ AssemblyProductAttribute at = (AssemblyProductAttribute)asm.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0];
+ return asm.GetName().Version;
+ }
+ }
+
+ public static void HardShutDown()
+ {
+ Application.Current.Dispatcher.Invoke
+ (
+ System.Windows.Threading.DispatcherPriority.Normal,
+ new Action
+ (
+ delegate()
+ {
+ try
+ {
+ Application.Current.MainWindow.Close();
+ }
+ catch { }
+ Application.Current.Shutdown(0);
+ }
+ )
+ );
+ }
+
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ /*if (!System.Diagnostics.Debugger.IsAttached)
+ AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs args)
+ {
+ Exception ex = args.ExceptionObject as Exception;
+ var wnd = new ErrorWindow(ex);
+ wnd.ShowDialog();
+ ErrorLog.WriteError(ex, "Unhandled Exception main", false);
+ if (ErrorLog.CheckandUpload())
+ MessageBox.Show("Uploaded error log.");
+ };
+ AppDomain.CurrentDomain.ProcessExit += delegate(object sender, EventArgs ea)
+ {
+ if (ErrorLog.CheckandUpload())
+ MessageBox.Show("Uploaded error log.");
+ };
+ Updates.PerformHouskeeping();
+ */
+
+ string proc = Process.GetCurrentProcess().ProcessName;
+ Process[] processes = Process.GetProcessesByName(proc);
+ if (processes.Length > 1)
+ {
+ HardShutDown();
+ return;
+ }
+ if (isOctgnRunning)
+ {
+ MessageBox.Show("You must shut down OCTGN BEFORE you run this program!");
+ HardShutDown();
+ return;
+ }
+ Exit += new ExitEventHandler(App_Exit);
+ ochecker = new Thread(new ThreadStart(delegate()
+ {
+ int a = 0;
+ while (a == 0)
+ {
+ Thread.Sleep(1000);
+
+ if (isOctgnRunning)
+ {
+ try
+ {
+ App.Current.Dispatcher.Invoke
+ (
+ System.Windows.Threading.DispatcherPriority.Normal,
+ new Action
+ (
+ delegate()
+ {
+ MainWindow.IsEnabled = false;
+ }
+ )
+ );
+ //App.Current.MainWindow.IsEnabled = false;
+ MessageBox.Show("You must shut down OCTGN BEFORE you run this program!");
+ }
+ catch { }
+ }
+ else
+ {
+ App.Current.Dispatcher.Invoke
+ (
+ System.Windows.Threading.DispatcherPriority.Normal,
+ new Action
+ (
+ delegate()
+ {
+ if (!MainWindow.IsEnabled)
+ MainWindow.IsEnabled = true;
+ }
+ )
+ );
+ }
+ }
+ }
+ ));
+ ochecker.Start();
+ GamesRepository = new Octgn.Data.GamesRepository();
+ Relationships = new List<Relationship>();
+ DebugWindow = new DebugWindow();
+#if(DEBUG)
+ DebugWindow.Show();
+ App.Current.MainWindow = MainWindow;
+#endif
+ base.OnStartup(e);
+ }
+
+ private void App_Exit(object sender, ExitEventArgs e)
+ {
+ ochecker.Abort();
+ }
+
+ public static void Load_Relationships()
+ {
+ App.Relationships = new List<Relationship>();
+ String rpath = Path.Combine(UnzipPath, "_rels");
+ if (Directory.Exists(rpath))
+ {
+ if (File.Exists(Path.Combine(rpath, App.gameFilePrefix + ".xml.rels")))
+ {
+ XmlDocument doc = new XmlDocument();
+ XmlTextReader reader = new XmlTextReader(Path.Combine(rpath, App.gameFilePrefix + ".xml.rels"));
+ reader.Read();
+ doc.Load(reader);
+ foreach (XmlNode n in doc.ChildNodes)
+ {
+ if (n.Name.Equals("Relationships"))
+ {
+ foreach (XmlNode n2 in n.ChildNodes)
+ {
+ Relationship r = new Relationship();
+
+ foreach (XmlAttribute a in n2.Attributes)
+ {
+ switch (a.Name)
+ {
+ case "Type":
+ r.Type = a.Value;
+ break;
+ case "Id":
+ r.ID = a.Value;
+ break;
+ case "Target":
+ r.Target = a.Value;
+ break;
+ }
+ }
+ App.Relationships.Add(r);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ public static void Unzip_Files()
+ {
+ ZipFile file = new ZipFile(App.Game.Filename);
+ App.UnzipPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "oconfig");
+ App.UnzipPath = Path.Combine(App.UnzipPath, "temp");
+ try
+ {
+ if (Directory.Exists(App.UnzipPath))
+ Directory.Delete(App.UnzipPath, true);
+ }
+ catch (Exception e)
+ {
+ }
+ Directory.CreateDirectory(App.UnzipPath);
+ file.ExtractAll(App.UnzipPath);
+ App.addDebugLine("All files extracted to : " + App.UnzipPath);
+
+ Regex r = new Regex(@"^([^\.\[\]]+){1}.xml$");
+ App.gameFilePrefix = null;
+ foreach (String s in file.EntryFileNames)
+ {
+ String uri = s;
+ try
+ {
+ if (App.gameFilePrefix == null)
+ {
+ Match m = r.Match(@uri);
+ if (m.Groups.Count >= 2)
+ {
+ App.gameFilePrefix = m.Groups[1].Value;
+ continue;
+ }
+ }
+ }
+ catch
+ { }
+ }
+ }
+
+ public static void Save_Game_File()
+ {
+ Ionic.Zip.ZipFile z = new ZipFile();
+ z.AddDirectory(App.UnzipPath);
+ try
+ {
+ z.Save(App.Game.Filename);
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show("Please make sure you have Octgn closed first.");
+ }
+ }
+
+ public static void Save_Relationships()
+ {
+ String rpath = Path.Combine(App.UnzipPath, "_rels");
+ XmlDocument doc = new XmlDocument();
+ FileStream f = File.Open(Path.Combine(rpath, App.gameFilePrefix + ".xml.rels"), FileMode.Create, FileAccess.Write, FileShare.Read);
+ StreamWriter writer = new StreamWriter(f);
+
+ writer.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
+ writer.WriteLine("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
+ foreach (Relationship r in App.Relationships)
+ {
+ writer.WriteLine();
+ writer.Write(" <Relationship ");
+ writer.Write("Target=\"");
+ writer.Write(r.Target);
+ writer.Write("\" ");
+ writer.Write("Id=\"");
+ writer.Write(r.ID);
+ writer.Write("\" ");
+ writer.Write("Type=\"");
+ writer.Write(r.Type);
+ writer.Write("\" ");
+ writer.Write("/>");
+ }
+ writer.WriteLine("</Relationships>");
+ writer.Flush();
+ writer.Close();
+ }
+ }
+}
View
8 ocust/ocust/DebugWindow.xaml
@@ -0,0 +1,8 @@
+<Window x:Class="ocust.DebugWindow"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ Title="DebugWindow" Height="333" Width="647" Icon="/ocust;component/Icon.ico">
+ <Grid>
+ <RichTextBox HorizontalAlignment="Stretch" Name="richTextBox1" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" TextChanged="richTextBox1_TextChanged" />
+ </Grid>
+</Window>
View
79 ocust/ocust/DebugWindow.xaml.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Media;
+
+namespace ocust
+{
+ /// <summary>
+ /// Interaction logic for DebugWindow.xaml
+ /// </summary>
+ public partial class DebugWindow : Window
+ {
+ private bool justScrolledToBottom = false;
+
+ public DebugWindow()
+ {
+ InitializeComponent();
+ this.richTextBox1.SetValue(Paragraph.LineHeightProperty, .5);
+ }
+
+ public void AddLine(string s)
+ {
+ Application.Current.Dispatcher.Invoke
+ (
+ System.Windows.Threading.DispatcherPriority.Normal,
+ new Action
+ (
+ delegate()
+ {
+ Paragraph p = new Paragraph(new Run(s));
+ richTextBox1.Document.Blocks.Add(p);
+
+ bool rtbatbottom = true;
+ //check to see if the richtextbox is scrolled to the bottom.
+ //----------------------------------------------------------------------------------
+ double dVer = richTextBox1.VerticalOffset;
+
+ //get the vertical size of the scrollable content area
+ double dViewport = richTextBox1.ViewportHeight;
+
+ //get the vertical size of the visible content area
+ double dExtent = richTextBox1.ExtentHeight;
+
+ if (dVer != 0)
+ {
+ if (dVer + dViewport == dExtent)
+ {
+ rtbatbottom = true;
+ justScrolledToBottom = false;
+ }
+ else
+ {
+ if (!justScrolledToBottom)
+ {
+ Paragraph pa = new Paragraph();
+ Run ru = new Run("------------------------------");
+ ru.Foreground = Brushes.Red;
+ pa.Inlines.Add(new Bold(ru));
+ richTextBox1.Document.Blocks.Add(pa);
+ justScrolledToBottom = true;
+ }
+ }
+ }
+ //----------------------------------------------------------------------------------
+ if (rtbatbottom)
+ {
+ richTextBox1.ScrollToEnd();
+ }
+ }
+ )
+ );
+ }
+
+ private void richTextBox1_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ }
+ }
+}
View
51 ocust/ocust/DeepGameScan.xaml
@@ -0,0 +1,51 @@
+<Page x:Class="ocust.DeepGameScan"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ mc:Ignorable="d"
+ d:DesignHeight="330" d:DesignWidth="540"
+ Title="DeepGameScan" Width="636" Height="330">
+
+ <Grid Background="#00000000">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="552*" />
+ <ColumnDefinition Width="84" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="58" />
+ <RowDefinition Height="214*" />
+ <RowDefinition Height="58" />
+ </Grid.RowDefinitions>
+ <Border BorderBrush="Silver" BorderThickness="1" HorizontalAlignment="Stretch" Margin="5" Name="border1" VerticalAlignment="Stretch" CornerRadius="10" Grid.ColumnSpan="2">
+ <Border.Background>
+ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+ <GradientStop Color="Black" Offset="0" />
+ <GradientStop Color="#FF3C9604" Offset="1" />
+ <GradientStop Color="#FF00C10E" Offset="0.5" />
+ </LinearGradientBrush>
+ </Border.Background>
+ <Label Content="Deep game/set file scanner" Name="label1" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Foreground="White" FontWeight="Bold" FontFamily="Aharoni" FontSize="24" Padding="5" Margin="5" />
+ </Border>
+ <Border BorderBrush="Silver" BorderThickness="1" HorizontalAlignment="Stretch" Margin="5" Name="border2" VerticalAlignment="Stretch" Grid.Row="1" CornerRadius="10" Grid.ColumnSpan="2">
+ <Border.Background>
+ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+ <GradientStop Color="Black" Offset="0" />
+ <GradientStop Color="#FFA3A3A3" Offset="1" />
+ <GradientStop Color="#FFC7C7C7" Offset="0.451" />
+ </LinearGradientBrush>
+ </Border.Background>
+ <ListBox Name="listBox1" Margin="10" Background="#89FFFFFF" Foreground="#FF00A700" />
+ </Border>
+ <Border BorderBrush="Silver" BorderThickness="1" HorizontalAlignment="Stretch" Margin="5" Name="border3" VerticalAlignment="Stretch" Grid.Row="2" CornerRadius="10" Grid.ColumnSpan="2">
+ <Border.Background>
+ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+ <GradientStop Color="Black" Offset="0" />
+ <GradientStop Color="#FF797979" Offset="0.992" />
+ <GradientStop Color="#FFA3A3A3" Offset="0.418" />
+ </LinearGradientBrush>
+ </Border.Background>
+ </Border>
+ <Button Content="Start" Name="btnStart" Grid.Column="1" Grid.Row="2" Margin="8,11,12,12" Click="btnStart_Click" />
+ </Grid>
+</Page>
View
75 ocust/ocust/DeepGameScan.xaml.cs
@@ -0,0 +1,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;
+ }
+ }
+}
View
38 ocust/ocust/GameEdit.xaml
@@ -0,0 +1,38 @@
+<Page x:Class="ocust.GameEdit"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ mc:Ignorable="d"
+ d:DesignHeight="300" d:DesignWidth="300"
+ Title="GameEdit" Width="636" Height="319" Unloaded="Page_Unloaded" Background="#00000000" IsVisibleChanged="Page_IsVisibleChanged">
+
+ <Grid>
+ <TabControl HorizontalAlignment="Stretch" Name="tabControl1" VerticalAlignment="Stretch" UseLayoutRounding="False">
+ <TabItem Header="Background" Name="tabItem1">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="526*" />
+ <ColumnDefinition Width="110" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="35" />
+ <RowDefinition Height="215*" />
+ <RowDefinition Height="37" />
+ </Grid.RowDefinitions>
+ <ComboBox HorizontalAlignment="Stretch" Margin="5" Name="cbImageList" VerticalAlignment="Stretch" SelectionChanged="cbImageList_SelectionChanged" />
+ <Button Content="Add" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5" Name="btnAddImage" VerticalAlignment="Stretch" Click="btnAddImage_Click" />
+ <Image Grid.ColumnSpan="2" Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Name="imgBackground" Stretch="Uniform" VerticalAlignment="Stretch" />
+ <Button Content="Save" HorizontalAlignment="Stretch" Margin="5,6" Name="btnSaveBackground" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="2" Click="btnSaveBackground_Click" />
+ </Grid>
+ </TabItem>
+ <TabControl.Background>
+ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+ <GradientStop Color="Black" Offset="0" />
+ <GradientStop Color="#FF313131" Offset="1" />
+ <GradientStop Color="#FF6C6C6C" Offset="0.656" />
+ </LinearGradientBrush>
+ </TabControl.Background>
+ </TabControl>
+ </Grid>
+</Page>
View
208 ocust/ocust/GameEdit.xaml.cs
@@ -0,0 +1,208 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Imaging;
+using Microsoft.Win32;
+
+namespace ocust
+{
+ /// <summary>
+ /// Interaction logic for GameEdit.xaml
+ /// </summary>
+ public partial class GameEdit : Page
+ {
+ BitmapImage bi;
+
+ public GameEdit()
+ {
+ InitializeComponent();
+ Loaded += new RoutedEventHandler(GameEdit_Loaded);
+ }
+
+ private void Load_Images()
+ {
+ String[] ls = DirSearch(App.UnzipPath, "*.png");
+ String[] ls2 = DirSearch(App.UnzipPath, "*.jpg");
+ cbImageList.Items.Clear();
+ foreach (String s in ls)
+ {
+ String r = s.Replace(App.UnzipPath, "");
+ r = r.Replace('\\', '/');
+ cbImageList.Items.Add(r);
+ App.addDebugLine(r);
+ }
+ foreach (String s in ls2)
+ {
+ String r = s.Replace(App.UnzipPath, "");
+ r = r.Replace('\\', '/');
+ cbImageList.Items.Add(r);
+ App.addDebugLine(r);
+ }
+ }
+
+ private void getRelationshipTarget(String ID)
+ {
+ }
+
+ private void getRelationshipID(String Target)
+ {
+ }
+
+ private void Reload_Stuff()
+ {
+ App.SetStatus("Getting main file name...");
+
+ Octgn.Game g = new Octgn.Game(Octgn.Definitions.GameDef.FromO8G(App.Game.Filename));
+ App.addDebugLine(g.Definition.TableDefinition.background);
+ App.Unzip_Files();
+ App.SetStatus("Main file name='" + App.gameFilePrefix + "'");
+ App.SetStatus("Loading relationships...");
+ App.Load_Relationships();
+ App.SetStatus("Loading image list...");
+ Load_Images();
+ String bfile = g.Definition.TableDefinition.background.Replace('/', '\\');
+ cbImageList.IsEditable = true;
+ cbImageList.IsReadOnly = true;
+ cbImageList.Text = bfile;
+ String f = cbImageList.Text.Replace('/', '\\');
+ f = App.UnzipPath + f;
+ Uri uri = new Uri("file://" + f);
+ imgBackground.Source = new BitmapImage(uri);
+ App.SetStatus("");
+ }
+
+ private void GameEdit_Loaded(object sender, RoutedEventArgs e)
+ {
+ App.SetStatus("Getting main file name...");
+
+ Octgn.Game g = new Octgn.Game(Octgn.Definitions.GameDef.FromO8G(App.Game.Filename));
+ App.addDebugLine(g.Definition.TableDefinition.background);
+ App.Unzip_Files();
+ App.SetStatus("Main file name='" + App.gameFilePrefix + "'");
+ App.SetStatus("Loading relationships...");
+ App.Load_Relationships();
+ App.SetStatus("Loading image list...");
+ Load_Images();
+ String bfile = g.Definition.TableDefinition.background.Replace('/', '\\');
+ cbImageList.IsEditable = true;
+ cbImageList.IsReadOnly = true;
+ cbImageList.Text = bfile;
+ String f = cbImageList.Text.Replace('/', '\\');
+ f = App.UnzipPath + f;
+ Uri uri = new Uri("file://" + f);
+ System.IO.Stream stream = new FileStream(f, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ if (bi != null)
+ {
+ bi.StreamSource.Close();
+ bi.StreamSource.Dispose();
+ bi = null;
+ }
+ bi = new BitmapImage();
+ bi.CacheOption = BitmapCacheOption.OnLoad;
+ bi.UriSource = null;
+ bi.BeginInit();
+ bi.StreamSource = stream;
+ bi.EndInit();
+ imgBackground.Source = bi;
+ //bi.StreamSource.Close();
+ App.SetStatus("");
+ }
+
+ private String[] DirSearch(string sDir, string sFile)
+ {
+ List<String> list = new List<string>();
+ try
+ {
+ foreach (string d in Directory.GetDirectories(sDir))
+ {
+ foreach (string f in Directory.GetFiles(d, sFile))
+ {
+ list.Add(f);
+ }
+ String[] ls = DirSearch(d, sFile);
+ foreach (String s in ls)
+ {
+ list.Add(s);
+ }
+ }
+ }
+ catch (System.Exception excpt)
+ {
+ Console.WriteLine(excpt.Message);
+ }
+ return list.ToArray();
+ }
+
+ private void cbImageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ String f = (String)e.AddedItems[0].ToString().Replace('/', '\\');
+ f = App.UnzipPath + f;
+ Uri uri = new Uri("file://" + f);
+ System.IO.Stream stream = new FileStream(f, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ if (bi != null)
+ {
+ bi.StreamSource.Close();
+ bi.StreamSource.Dispose();
+ bi = null;
+ }
+ bi = new BitmapImage();
+ bi.CacheOption = BitmapCacheOption.OnLoad;
+ bi.UriSource = null;
+ bi.BeginInit();
+ bi.StreamSource = stream;
+ bi.EndInit();
+ imgBackground.Source = bi;
+ }
+
+ private void btnAddImage_Click(object sender, RoutedEventArgs e)
+ {
+ OpenFileDialog ofd = new OpenFileDialog();
+ ofd.Filter = "Image File (*.png, *.jpg)|*.png;*.jpg";
+ bool dr = (bool)ofd.ShowDialog();
+ if (dr == true)
+ {
+ string filePath = ofd.FileName;
+ string safeFilePath = ofd.SafeFileName;
+ string path = App.UnzipPath + "\\images";
+ Directory.CreateDirectory(path);
+ File.Copy(filePath, path + "\\" + safeFilePath, true);
+ }
+ }
+
+ private void btnSaveBackground_Click(object sender, RoutedEventArgs e)
+ {
+ App.SetStatus("Saving...");
+ Octgn.Game g = new Octgn.Game(Octgn.Definitions.GameDef.FromO8G(App.Game.Filename));
+ for (int i = 0; i < App.Relationships.Count; i++)
+ {
+ if (App.Relationships[i].Target.Equals(g.Table.Definition.background))
+ {
+ App.Relationships[i].Target = cbImageList.Text;
+ break;
+ }
+ }
+ App.Save_Relationships();
+ App.Save_Game_File();
+ App.SetStatus("");
+ }
+
+ private void Page_Unloaded(object sender, RoutedEventArgs e)
+ {
+ bi.StreamSource.Close();
+ bi.StreamSource.Dispose();
+ imgBackground = null;
+ }
+
+ private void Page_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if ((bool)e.NewValue == false)
+ {
+ bi.StreamSource.Close();
+ bi.StreamSource.Dispose();
+ imgBackground = null;
+ }
+ }
+ }
+}
View
24 ocust/ocust/GameSelect.xaml
@@ -0,0 +1,24 @@
+<Page x:Class="ocust.GameSelect"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:l="clr-namespace:ocust"
+ mc:Ignorable="d"
+ d:DesignHeight="325" d:DesignWidth="625"
+ Title="GameSelect" Width="646" Height="319">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="383*" />
+ <ColumnDefinition Width="137" />
+ <ColumnDefinition Width="126" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*" />
+ <RowDefinition Height="63" />
+ </Grid.RowDefinitions>
+ <l:GameSelector x:Name="gameSelector" Grid.RowSpan="2" Grid.ColumnSpan="3" />
+ <Button Content="Next" Grid.Row="1" Height="38" HorizontalAlignment="Left" Margin="9,13,0,0" Name="btnNext" VerticalAlignment="Top" Width="105" Click="btnNext_Click" Grid.Column="2" />
+ <Button Content="Deep Game Scan" Height="38" HorizontalAlignment="Left" Margin="16,13,0,0" Name="btnDeepScan" VerticalAlignment="Top" Width="105" Grid.Column="1" Grid.Row="1" Click="btnDeepScan_Click" />
+ </Grid>
+</Page>
View
35 ocust/ocust/GameSelect.xaml.cs
@@ -0,0 +1,35 @@
+using System.Windows;
+using System.Windows.Controls;
+
+namespace ocust
+{
+ /// <summary>
+ /// Interaction logic for GameSelect.xaml
+ /// </summary>
+ public partial class GameSelect : Page
+ {
+ public GameSelect()
+ {
+ InitializeComponent();
+ App.Game = gameSelector.Game;
+ //MessageBox.Show(gameSelector.Game.Filename);
+ }
+
+ private void GameSelect_Loaded(object sender, RoutedEventArgs e)
+ {
+ //MessageBox.Show(gameSelector.Game.Definition.Name);
+ }
+
+ private void btnNext_Click(object sender, RoutedEventArgs e)
+ {
+ App.Game = gameSelector.Game;
+ NavigationService.Navigate(new GameEdit());
+ }
+
+ private void btnDeepScan_Click(object sender, RoutedEventArgs e)
+ {
+ App.Game = gameSelector.Game;
+ NavigationService.Navigate(new DeepGameScan());
+ }
+ }
+}
View
38 ocust/ocust/GameSelector.xaml
@@ -0,0 +1,38 @@
+<UserControl x:Class="ocust.GameSelector"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ MinWidth="200">
+
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="116" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Border Margin="8" Grid.Row="1" BorderThickness="2" CornerRadius="20" BorderBrush="Black" HorizontalAlignment="Center">
+ <TextBlock x:Name="nameText" Margin="16,22,16,8" TextAlignment="Center" Foreground="White" FontFamily="Aharoni" FontSize="20" Text="fcghjnfg" />
+ <Border.Background>
+ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+ <GradientStop Color="#FFE0E0E0" Offset="0" />
+ <GradientStop Color="Red" Offset="1" />
+ </LinearGradientBrush>
+ </Border.Background>
+ </Border>
+
+ <Viewport3D x:Name="list" Height="160" Grid.RowSpan="2" VerticalAlignment="Top">
+ <Viewport3D.Camera>
+ <OrthographicCamera Width="15" Position="0,3.5,5" LookDirection="0,-0.3,-1" />
+ </Viewport3D.Camera>
+ <ContainerUIElement3D x:Name="container" />
+ <ModelVisual3D>
+ <ModelVisual3D.Content>
+ <Model3DGroup>
+ <AmbientLight Color="#aaa" />
+ <SpotLight Color="White" Position="0,3.5,5" Direction="0,-0.3,-1" InnerConeAngle="10" OuterConeAngle="50" />
+ </Model3DGroup>
+ </ModelVisual3D.Content>
+ </ModelVisual3D>
+ </Viewport3D>
+ </Grid>
+
+</UserControl>
View
123 ocust/ocust/GameSelector.xaml.cs
@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using Octgn.Data;
+
+namespace ocust
+{
+ public sealed partial class GameSelector : UserControl
+ {
+ private IList<Octgn.Data.Game> games;
+ private int selectedIdx = 0;
+ private static readonly Duration dt = new Duration(TimeSpan.FromMilliseconds(500));
+
+ public GameSelector()
+ {
+ InitializeComponent();
+ if (DesignerProperties.GetIsInDesignMode(this)) return;
+ games = App.GamesRepository.Games;
+ //games = Program.GamesRepository.Games;
+ Create3DItems();
+ }
+
+ public Game Game
+ {
+ get
+ {
+ if (games.Count == 0) return null;
+ //var serializer = new BinaryFormatter();
+ //var memStream = new MemoryStream(games[selectedIdx].Data);
+ //GameDef def = (GameDef)serializer.Deserialize(memStream);
+ //return new Game(def);
+ //return new Game(GameDef.FromO8G(games[selectedIdx].Filename));
+ return games[selectedIdx];
+ }
+ }
+
+ private void Create3DItems()
+ {
+ container.Children.Clear();
+
+ var rnd = new Random();
+ var i = 0;
+
+ foreach (var game in games)
+ {
+ var bmp = new BitmapImage();
+ bmp.BeginInit();
+ bmp.CacheOption = BitmapCacheOption.OnLoad;
+ bmp.UriSource = game.GetCardBackUri();
+ bmp.EndInit();
+
+ var halfWidth = game.CardWidth * 1.5 / game.CardHeight;
+ var item = new ModelUIElement3D()
+ {
+ Model = new GeometryModel3D()
+ {
+ Geometry = new MeshGeometry3D()
+ {
+ Positions = new Point3DCollection()
+ {
+ new Point3D(-halfWidth,0,-1),
+ new Point3D(-halfWidth,3,-1),
+ new Point3D(halfWidth,3,-1),
+ new Point3D(halfWidth,0,-1)
+ },
+ TriangleIndices = new Int32Collection() { 0, 2, 1, 3, 2, 0 },
+ TextureCoordinates = new PointCollection() { new Point(0, 1), new Point(0, 0), new Point(1, 0), new Point(1, 1) }
+ },
+ Material = new DiffuseMaterial(new ImageBrush(bmp)),
+ Transform = new Transform3DGroup()
+ {
+ Children = new Transform3DCollection()
+ {
+ new RotateTransform3D()
+ {
+ Rotation = new AxisAngleRotation3D(new Vector3D(0,1,0), i == 0 ? 0 : -40)
+ },
+ new TranslateTransform3D(i == 0 ? 0 : 0.5+i, 0, i != 0 ? -1 : 0)
+ }
+ }
+ }
+ };
+ item.MouseDown += Select;
+ container.Children.Add(item);
+ ++i;
+ }
+
+ if (games.Count > 0)
+ {
+ selectedIdx = 0;
+ nameText.Text = games[0].Name;
+ }
+ }
+
+ private void Select(object sender, RoutedEventArgs e)
+ {
+ e.Handled = true;
+ var idx = container.Children.IndexOf((Visual3D)sender);
+ if (idx == selectedIdx) return;
+ for (int i = 0; i < container.Children.Count; ++i)
+ {
+ var item = (ModelUIElement3D)container.Children[i];
+ var rotate = (RotateTransform3D)((Transform3DGroup)item.Model.Transform).Children[0];
+ var translate = (TranslateTransform3D)((Transform3DGroup)item.Model.Transform).Children[1];
+
+ var anim = new DoubleAnimation(i == idx ? 0 : -1, dt, FillBehavior.HoldEnd) { DecelerationRatio = 0.65 };
+ translate.BeginAnimation(TranslateTransform3D.OffsetZProperty, anim, HandoffBehavior.SnapshotAndReplace);
+ anim = new DoubleAnimation(i - idx + 0.5 * Math.Sign(i - idx), dt, FillBehavior.HoldEnd) { DecelerationRatio = 0.65 };
+ translate.BeginAnimation(TranslateTransform3D.OffsetXProperty, anim, HandoffBehavior.SnapshotAndReplace);
+ anim = new DoubleAnimation(i < idx ? 40 : i > idx ? -40 : 0, dt, FillBehavior.HoldEnd) { DecelerationRatio = 0.65 };
+ ((AxisAngleRotation3D)rotate.Rotation).BeginAnimation(AxisAngleRotation3D.AngleProperty, anim, HandoffBehavior.SnapshotAndReplace);
+ }
+ selectedIdx = idx;
+ nameText.Text = games[idx].Name;
+ }
+ }
+}
View
BIN  ocust/ocust/Icon.ico
Binary file not shown
View
8 ocust/ocust/MainWindow.xaml
@@ -0,0 +1,8 @@
+<NavigationWindow x:Class="ocust.MainWindow"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ Title="MainWindow" ShowsNavigationUI="False" Source="Splash.xaml" WindowStyle="None" AllowsTransparency="True" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" HorizontalContentAlignment="Left" Icon="/ocust;component/Icon.ico">
+ <NavigationWindow.Background>
+ <SolidColorBrush />
+ </NavigationWindow.Background>
+</NavigationWindow>
View
72 ocust/ocust/MainWindow.xaml.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Animation;
+using System.Windows.Navigation;
+
+namespace ocust
+{
+ /// <summary>
+ /// Interaction logic for MainWindow.xaml
+ /// </summary>
+ public partial class MainWindow : NavigationWindow
+ {
+ private static readonly Duration TransitionDuration = new Duration(TimeSpan.FromMilliseconds(500));
+ private readonly AnimationTimeline OutAnimation = new DoubleAnimation(0, TransitionDuration);
+ private readonly AnimationTimeline InAnimation = new DoubleAnimation(0, 1, TransitionDuration);
+ private static readonly object BackTarget = new object();
+ private bool isInTransition = false;
+ private object transitionTarget;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
+ OutAnimation.Completed += delegate
+ {
+ isInTransition = false;
+ if (transitionTarget == BackTarget)
+ GoBack();
+ else
+ Navigate(transitionTarget);
+ };
+ OutAnimation.Freeze();
+
+ Navigating += delegate(object sender, NavigatingCancelEventArgs e)
+ {
+ if (isInTransition)
+ { e.Cancel = true; return; }
+
+ if (transitionTarget != null)
+ {
+ transitionTarget = null;
+ return;
+ }
+
+ var page = Content as Page;
+ if (page == null) return;
+
+ e.Cancel = true;
+ isInTransition = true;
+ if (e.NavigationMode == NavigationMode.Back)
+ transitionTarget = BackTarget;
+ else
+ transitionTarget = e.Content;
+ page.BeginAnimation(UIElement.OpacityProperty, OutAnimation, HandoffBehavior.SnapshotAndReplace);
+ };
+
+ Navigated += delegate
+ {
+ var page = Content as Page;
+ if (page == null) return;
+
+ page.BeginAnimation(UIElement.OpacityProperty, InAnimation);
+ };
+ }
+
+ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
+ {
+ App.MainWindow = this;
+ }
+ }
+}
View
51 ocust/ocust/Properties/AssemblyInfo.cs
@@ -0,0 +1,51 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ocust")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Skylabs")]
+[assembly: AssemblyProduct("ocust")]
+[assembly: AssemblyCopyright("Copyright © Skylabs 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
+//inside a <PropertyGroup>. For example, if you are using US english
+//in your source files, set the <UICulture> to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.0.1.2")]
+[assembly: AssemblyFileVersion("0.0.1.2")]
View
71 ocust/ocust/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace ocust.Properties
+{
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ocust.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
View
117 ocust/ocust/Properties/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
30 ocust/ocust/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace ocust.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
View
7 ocust/ocust/Properties/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile>
View
47 ocust/ocust/Properties/app.manifest
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+ <!-- UAC Manifest Options
+ If you want to change the Windows User Account Control level replace the
+ requestedExecutionLevel node with one of the following.
+
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+
+ Specifying requestedExecutionLevel node will disable file and registry virtualization.
+ If you want to utilize File and Registry Virtualization for backward
+ compatibility then delete the requestedExecutionLevel node.
+ -->
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </requestedPrivileges>
+ <applicationRequestMinimum>
+ <defaultAssemblyRequest permissionSetReference="Custom" />
+ <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
+ </applicationRequestMinimum>
+ </security>
+ </trustInfo>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
+ <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
+ <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
+ </application>
+ </compatibility>
+ <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
+ <!-- <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>-->
+</asmv1:assembly>
View
109 ocust/ocust/Splash.xaml
@@ -0,0 +1,109 @@
+<Page x:Class="ocust.Splash"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ mc:Ignorable="d"
+ d:DesignHeight="292" d:DesignWidth="646"
+ Title="Splash" Width="646" HorizontalAlignment="Center" VerticalAlignment="Center">
+
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="110" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="40" />
+ </Grid.RowDefinitions>
+ <Border BorderThickness="2" HorizontalAlignment="Stretch" Name="border1" VerticalAlignment="Stretch" CornerRadius="15" BorderBrush="Black" Grid.RowSpan="3">
+ <Border Grid.ColumnSpan="1" VerticalAlignment="Top" Margin="8" ClipToBounds="True"
+ Height="100" Grid.Row="0" MouseLeftButtonDown="Border_MouseLeftButtonDown">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="6*" />
+ <RowDefinition Height="90*" />
+ </Grid.RowDefinitions>
+ <TextBlock FontSize="48" FontStyle="Italic" FontWeight="Bold" Foreground="#FFFF0000"
+ HorizontalAlignment="Left" VerticalAlignment="Center" Margin="157,9,0,18"
+ Style="{x:Null}" Text="OCTGN Customizer" Grid.Row="1">
+ <TextBlock.Effect>
+ <DropShadowEffect Opacity="0.4" ShadowDepth="2" />
+ </TextBlock.Effect>
+ </TextBlock>
+ <TextBlock x:Name="versionText" HorizontalAlignment="Right" Margin="0,0,16,5" VerticalAlignment="Bottom" Foreground="#FFF00000" TextWrapping="Wrap" Style="{x:Null}" Grid.Row="1">
+ Version 0.2.0.1
+ </TextBlock>
+
+ <Viewbox RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" Margin="50,1,0,7" VerticalAlignment="Center" Width="82.137" Height="82.137" Stretch="UniformToFill" Grid.Row="1">
+ <Viewbox.RenderTransform>
+ <TransformGroup>
+ <SkewTransform AngleX="-17.791" AngleY="0"/>
+ <TranslateTransform X="-13.179" Y="0"/>
+ </TransformGroup>
+ </Viewbox.RenderTransform>
+ <Canvas Width="48.637" Height="48.637">
+ <Path x:Name="whiteRing" Stretch="Fill" StrokeThickness="0.640004" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#4DFFFFFF" Data="M43.4584,42.6305 L26.4889,49.6595 9.51936,42.6305 2.49036,25.6609 9.51936,8.69142 26.4889,1.66241 43.4584,8.69142 50.4874,25.6609 43.4584,42.6305 z M19.29498,32.717361 C19.29498,32.717361 26.413233,35.678091 26.413233,35.678091 26.413233,35.678091 33.802542,32.717361 33.802542,32.717361 33.802542,32.717361 36.804173,25.463573 36.804173,25.463573 36.804173,25.463573 33.882247,18.314523 33.882247,18.314523 33.882247,18.314523 26.633895,15.2984 26.633895,15.2984 26.633895,15.2984 19.309766,18.308476 19.309766,18.308476 19.309766,18.308476 16.32397,25.61161 16.32397,25.61161 16.32397,25.61161 19.29498,32.717361 19.29498,32.717361 z" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="48.637" Height="48.637">
+ <Path.RenderTransform>
+ <ScaleTransform />
+ </Path.RenderTransform>
+ </Path>
+ <Path x:Name="redRing" Stretch="Fill" StrokeThickness="0.640004" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFFF0000" Data="F1 M 33.6633,32.5853L 36.6005,25.4943L 33.6633,18.4032L 26.5722,15.466L 19.4812,18.4032L 16.544,25.4943L 19.4812,32.5853L 26.5722,35.5225L 33.6633,32.5853 Z M 43.2023,18.7694L 43.2023,32.7361L 33.3264,42.612L 19.3597,42.612L 9.48378,32.7361L 9.48378,18.7694L 19.3597,8.89349L 33.3264,8.89349L 43.2023,18.7694 Z " RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="34.358" Height="34.358" Canvas.Left="6.994" Canvas.Top="7.231">
+ <Path.RenderTransform>
+ <ScaleTransform />
+ </Path.RenderTransform>
+ </Path>
+ <Canvas RenderTransformOrigin="0.5,0.5" x:Name="logoRays" Width="48.367" Height="48.317" Canvas.Left="0.16" Canvas.Top="0.16">
+ <Canvas.RenderTransform>
+ <ScaleTransform />
+ </Canvas.RenderTransform>
+ <Path Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 26.4889,1.66241L 9.51936,42.6305L 43.4584,42.6305L 26.4889,1.66241 Z " HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="34.259" Height="41.288" Canvas.Left="7.029"/>
+ <Path Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 9.51936,8.69142L 43.4584,8.69142L 26.4889,49.6595L 9.51936,8.69142 Z " HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="34.259" Height="41.288" Canvas.Left="7.029" Canvas.Top="7.029"/>
+ <Path Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 2.49036,25.6609L 26.4889,1.66241L 50.4874,25.6609L 26.4889,49.6595L 2.49036,25.6609 Z " HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="48.317" Height="48.317"/>
+ <Path Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 9.51936,42.6305L 50.5375,25.2319L 9.51936,8.69142L 43.4584,8.69142L 9.51936,8.69142L 9.51936,42.6305" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="41.338" Height="34.259" Canvas.Left="7.029" Canvas.Top="7.029"/>
+ <Path Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 43.4584,8.69142L 2.49036,25.6609L 43.4584,42.6305L 43.4584,8.69142" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="41.288" Height="34.259" Canvas.Top="7.029"/>
+ </Canvas>
+ </Canvas>
+ </Viewbox>
+
+ <Viewbox RenderTransformOrigin="0.5,0.5" Stretch="UniformToFill" Margin="-99.079,-63,0,-161" VerticalAlignment="Stretch" Opacity="0.295" HorizontalAlignment="Left" Width="322.134" Panel.ZIndex="-1" Grid.RowSpan="2">
+ <Viewbox.RenderTransform>
+ <SkewTransform AngleX="-17.791000000000011" AngleY="0"/>
+ </Viewbox.RenderTransform>
+ <Viewbox.Clip>
+ <PathGeometry>
+ <PathFigure IsClosed="True" IsFilled="True" StartPoint="70.9767921257703,72.993">
+ <BezierSegment Point1="69.2045566867662,67.4701525016921" Point2="72.2450285030409,62.993" Point3="77.7678760013489,62.993" IsSmoothJoin="True" IsStroked="True"/>
+ <LineSegment IsSmoothJoin="True" IsStroked="True" Point="671.447876001349,62.993"/>
+ <BezierSegment Point1="676.970723499657,62.993" Point2="682.884556686766,67.4701525016921" Point3="684.65679212577,72.993" IsSmoothJoin="True" IsStroked="True"/>
+ <LineSegment IsSmoothJoin="True" IsStroked="True" Point="708.941869355392,148.673"/>
+ <BezierSegment Point1="710.714104794396,154.195847498308" Point2="707.673632978121,158.673" Point3="702.150785479813,158.673" IsSmoothJoin="True" IsStroked="True"/>
+ <LineSegment IsSmoothJoin="True" IsStroked="True" Point="108.470785479814,158.673"/>
+ <BezierSegment Point1="102.947937981506,158.673" Point2="97.0341047943961,154.195847498308" Point3="95.261869355392,148.673" IsSmoothJoin="True" IsStroked="True"/>
+ </PathFigure>
+ </PathGeometry>
+ </Viewbox.Clip>
+ <Canvas Width="48.637" Height="48.637" SnapsToDevicePixels="True" Background="{x:Null}">
+ <Path x:Name="Path1" Stretch="Fill" StrokeThickness="0.640004" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#4DFFFFFF" Data="F1 M 43.4584,42.6305L 26.4889,49.6595L 9.51936,42.6305L 2.49036,25.6609L 9.51936,8.69142L 26.4889,1.66241L 43.4584,8.69142L 50.4874,25.6609L 43.4584,42.6305 Z M 10.5534,25.4313L 26.4819,41.3599L 42.4105,25.4313L 26.4819,9.50277L 10.5534,25.4313 Z " RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="48.637" Height="48.637" />
+ <Path x:Name="Path_Copy6" Stretch="Fill" StrokeThickness="0.640004" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFFF0000" Data="F1 M 33.6633,32.5853L 36.6005,25.4943L 33.6633,18.4032L 26.5722,15.466L 19.4812,18.4032L 16.544,25.4943L 19.4812,32.5853L 26.5722,35.5225L 33.6633,32.5853 Z M 43.2023,18.7694L 43.2023,32.7361L 33.3264,42.612L 19.3597,42.612L 9.48378,32.7361L 9.48378,18.7694L 19.3597,8.89349L 33.3264,8.89349L 43.2023,18.7694 Z " RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="34.358" Height="34.358" Canvas.Left="6.994" Canvas.Top="7.231" />
+ <Canvas RenderTransformOrigin="0.5,0.5" x:Name="canvas1" Width="48.367" Height="48.317" Canvas.Left="0.16" Canvas.Top="0.16">
+ <Path x:Name="Path_Copy7" Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 26.4889,1.66241L 9.51936,42.6305L 43.4584,42.6305L 26.4889,1.66241 Z " HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="34.259" Height="41.288" Canvas.Left="7.029"/>
+ <Path x:Name="Path_Copy8" Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 9.51936,8.69142L 43.4584,8.69142L 26.4889,49.6595L 9.51936,8.69142 Z " HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="34.259" Height="41.288" Canvas.Left="7.029" Canvas.Top="7.029"/>
+ <Path x:Name="Path_Copy9" Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 2.49036,25.6609L 26.4889,1.66241L 50.4874,25.6609L 26.4889,49.6595L 2.49036,25.6609 Z " HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="48.317" Height="48.317"/>
+ <Path x:Name="Path_Copy10" Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 9.51936,42.6305L 50.5375,25.2319L 9.51936,8.69142L 43.4584,8.69142L 9.51936,8.69142L 9.51936,42.6305" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="41.338" Height="34.259" Canvas.Left="7.029" Canvas.Top="7.029"/>
+ <Path x:Name="Path_Copy11" Stretch="Fill" StrokeThickness="0.32" StrokeLineJoin="Round" Stroke="#4D000000" Data="F1 M 43.4584,8.69142L 2.49036,25.6609L 43.4584,42.6305L 43.4584,8.69142" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="41.288" Height="34.259" Canvas.Top="7.029"/>
+ </Canvas>
+ </Canvas>
+ </Viewbox>
+ <Button Content="Quit" Grid.Row="1" Height="22" HorizontalAlignment="Right" Margin="0,2,6,0" Name="btnQuit" VerticalAlignment="Top" Width="58" Click="btnQuit_Click" IsEnabled="False" />
+ <Button Content="Minimize" Grid.Row="1" Height="22" HorizontalAlignment="Left" Margin="488,2,0,0" Name="btnMin" VerticalAlignment="Top" Width="66" Click="btnMin_Click" />
+ </Grid>
+ </Border>
+ <Border.Background>
+ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+ <GradientStop Color="#FF3B3B3B" Offset="0" />
+ <GradientStop Color="#FFC4C4C4" Offset="1" />
+ </LinearGradientBrush>
+ </Border.Background>
+ </Border>
+ <Label Content="Loading..." Grid.Row="2" Margin="5" Name="label2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontFamily="Aharoni" FontSize="18" Foreground="White" />
+ <Frame Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Name="frame1" VerticalAlignment="Stretch" NavigationUIVisibility="Visible" />
+ </Grid>
+</Page>
View
219 ocust/ocust/Splash.xaml.cs
@@ -0,0 +1,219 @@
+using System;
+using System.IO;
+using System.Threading;
+using System.Windows;
+using System.Windows.Controls;
+using Microsoft.Win32;
+using Octgn.Data;
+using VistaDB;
+using VistaDB.DDA;
+using VistaDB.Diagnostic;
+
+namespace ocust
+{
+ /// <summary>
+ /// Interaction logic for Splash.xaml
+ /// </summary>
+ public partial class Splash : Page
+ {
+ public Splash()
+ {
+ InitializeComponent();
+ this.Loaded += new RoutedEventHandler(Splash_Loaded);
+ this.versionText.Text = string.Format("Version {0}", App.Version.ToString(4));
+ }
+
+ public void setstatus(String s)
+ {
+ Dispatcher.Invoke
+ (
+ System.Windows.Threading.DispatcherPriority.Normal,
+ new Action
+ (
+ delegate()
+ {
+ label2.Content = s;
+ }
+ )
+ );
+ }
+
+ private void Splash_Loaded(object sender, RoutedEventArgs e)
+ {
+ Thread t = new Thread(new ThreadStart(LoadVerifyInstall));
+ t.Start();
+ }
+
+ private void LoadVerifyInstall()
+ {
+ Thread.Sleep(2000);
+ setstatus("Checking for directory...");
+ String opath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Octgn");
+ if(!Directory.Exists(opath))
+ {
+ MessageBox.Show("You must run OCTGN and install a game first!");
+ Application.Current.Shutdown();
+ return;
+ }
+ setstatus("Checking for master database...");
+ if(!File.Exists(opath + "\\" + "master.vdb3"))
+ {
+ MessageBox.Show("You must run OCTGN and install a game first!");
+ Application.Current.Shutdown();
+ return;
+ }
+ setstatus("Making sure game paths are correct...");
+ foreach(Game g in App.GamesRepository.Games)
+ {
+ if(!File.Exists(g.Filename))
+ {
+ MessageBoxResult mb = MessageBox.Show("Game " + g.Name + " can not be found at the location '" + g.Filename + "'. Search for the game file?", "Game Error", MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.None);
+ if(mb == MessageBoxResult.Yes)
+ {
+ OpenFileDialog ofd = new OpenFileDialog();
+ ofd.Filter = "Game File (*.o8g)|*.o8g";
+ bool dr = (bool)ofd.ShowDialog();
+ if(dr == true)
+ {
+ string filePath = ofd.FileName;
+ string safeFilePath = ofd.SafeFileName;
+ g.Filename = filePath;
+ ChangeGamePath(g, filePath);
+ }
+ else
+ {
+ mb = MessageBox.Show("Game " + g.Name + " can not be found at the location '" + g.Filename + "'. Delete game file?", "Game Error", MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.None);
+ if(mb == MessageBoxResult.Yes)
+ {
+ DeleteGame(g);
+ MessageBox.Show("Game " + g.Name + " Deleted from the DB.", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ MessageBox.Show("You must fix this problem before you can use this app. App shutting down now.");
+ App.HardShutDown();
+ return;
+ }
+ }
+ }
+ else
+ {
+ mb = MessageBox.Show("Game " + g.Name + " can not be found at the location '" + g.Filename + "'. Delete game file?", "Game Error", MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.None);
+ if(mb == MessageBoxResult.Yes)
+ {
+ DeleteGame(g);
+ MessageBox.Show("Game " + g.Name + " Deleted from the DB.", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ else
+ {
+ MessageBox.Show("You must fix this problem before you can use this app. App shutting down now.");
+ App.HardShutDown();
+ return;
+ }
+ }
+ }
+ }
+ setstatus("Making sure set files exist...");
+ foreach(Game g in App.GamesRepository.Games)
+ {
+ foreach(Set s in g.Sets)
+ {
+ String uri = s.GetPackUri();
+ uri = uri.Replace("pack://file:,,,", "");
+ uri = uri.Replace(',', '\\');
+
+ if(!File.Exists(uri))
+ {
+ MessageBoxResult mb = MessageBox.Show("Set " + s.Name + " can not be found at the location '" + uri + "'. This set will be deleted. You must go into OCTGN to reinstall this set.", "Game Error", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.None);
+ g.DeleteSet(s);
+ }
+ }
+ }
+ setstatus("Opening program...");
+ Dispatcher.Invoke
+ (
+ System.Windows.Threading.DispatcherPriority.Normal,
+ new Action
+ (
+ delegate()
+ {
+ btnQuit.IsEnabled = true;
+ frame1.Navigate(new GameSelect());
+ }
+ )
+ );
+ setstatus("");
+ }
+
+ private void ChangeGamePath(Octgn.Data.Game game, String path)
+ {
+ String opath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Octgn");
+ String masterDbPath = Path.Combine(opath, "master.vdb3"); ;
+ using(var dda = VistaDBEngine.Connections.OpenDDA())
+ using(var masterDb = dda.OpenDatabase(masterDbPath, VistaDBDatabaseOpenMode.NonexclusiveReadWrite, null))
+ using(var gamesTable = masterDb.OpenTable("Game", false, false))
+ {
+ masterDb.BeginTransaction();
+ bool previousCompatibleVersion = false;
+ try
+ {
+ if(gamesTable.Find("id:'" + game.Id.ToString() + "'", "GamePK", false, false))
+ gamesTable.PutString("filename", path);
+ gamesTable.Post();
+ masterDb.CommitTransaction();
+ }
+ catch
+ {
+ masterDb.RollbackTransaction();
+ throw;
+ }
+ }
+ }
+
+ private void DeleteGame(Octgn.Data.Game game)
+ {
+ String opath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Octgn");
+ String masterDbPath = Path.Combine(opath, "master.vdb3"); ;
+ using(var dda = VistaDBEngine.Connections.OpenDDA())
+ using(var masterDb = dda.OpenDatabase(masterDbPath, VistaDBDatabaseOpenMode.NonexclusiveReadWrite, null))
+ using(var gamesTable = masterDb.OpenTable("Game", false, false))
+ {
+ masterDb.BeginTransaction();
+ try
+ {
+ if(gamesTable.Find("id:'" + game.Id.ToString() + "'", "GamePK", false, false))
+ {
+ gamesTable.Unlock(gamesTable.CurrentRow.RowId);
+ gamesTable.Delete();
+
+ foreach(Set s in game.Sets)
+ {
+ game.DeleteSet(s);
+ }
+ }
+ }
+ catch(VistaDBException e)
+ {
+ String s = e.StackTrace;
+ MessageBox.Show(s);
+ masterDb.RollbackTransaction();
+ }
+ }
+ }
+
+ private void btnMin_Click(object sender, RoutedEventArgs e)
+ {
+ App.Current.MainWindow.WindowState = WindowState.Minimized;
+ }
+
+ private void btnQuit_Click(object sender, RoutedEventArgs e)
+ {
+ App.HardShutDown();
+ }
+
+ private void Border_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ App.Current.MainWindow.DragMove();
+ }
+ }
+}
View
13 ocust/ocust/Structure/Relationship.cs
@@ -0,0 +1,13 @@
+using System;
+
+namespace ocust.Structure
+{
+ public class Relationship
+ {
+ public String Target { get; set; }
+
+ public String ID { get; set; }
+
+ public String Type { get; set; }
+ }
+}
View
64 ocust/ocust/XmlStuff.cs
@@ -0,0 +1,64 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Xml.Schema;
+
+namespace ocust
+{
+ public class XmlStuff
+ {
+ public bool m_Success = true;
+
+ public bool validateXml(String infile)
+ {
+ //First we create the xmltextreader
+ XmlTextReader xmlr = new XmlTextReader(infile);
+ //We pass the xmltextreader into the xmlvalidatingreader
+ //'This will validate the xml doc with the schema file
+ //'NOTE the xml file it self points to the schema file
+ XmlValidatingReader xmlvread = new XmlValidatingReader(xmlr);
+ //
+ // // ' Set the validation event handler
+ xmlvread.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
+ m_Success = true; //'make sure to reset the success var
+ //
+ // //' Read XML data
+ while (xmlvread.Read()) { }
+
+ //'Close the reader.
+ xmlvread.Close();
+
+ //'The validationeventhandler is the only thing that would set m_Success to false
+ return m_Success;
+ }
+
+ public void ValidationCallBack(Object sender, ValidationEventArgs args)
+ {
+ //'Display the validation error. This is only called on error
+ m_Success = false; //'Validation failed
+ //writertbox("Validation error: " + args.Message);
+ App.addDebugLine("Validation Error: " + args.Message);
+ }
+
+ public bool validateSchema(String infilename)
+ {
+ //this function will validate the schema file (xsd)
+
+ XmlSchema myschema;
+ m_Success = true; //'make sure to reset the success var
+ StreamReader sr = new StreamReader(infilename);
+ try
+ {
+ //sr = new StreamReader(infilename);
+ myschema = XmlSchema.Read(sr, new ValidationEventHandler(ValidationCallBack));
+ //'This compile statement is what ususally catches the errors
+ myschema.Compile(new ValidationEventHandler(ValidationCallBack));
+ }
+ finally
+ {
+ sr.Close();
+ }
+ return m_Success;
+ }
+ }
+}
View
266 ocust/ocust/ocust.csproj
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{17B8FAE5-DD13-41C0-A020-64D06EC857BB}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ocust</RootNamespace>
+ <AssemblyName>ocust</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <WarningLevel>4</WarningLevel>
+ <IsWebBootstrapper>true</IsWebBootstrapper>
+ <PublishUrl>ftp://184.106.76.80/ocdownload/</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Web</InstallFrom>
+ <UpdateEnabled>true</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <InstallUrl>http://www.skylabsonline.com/ocdownload/</InstallUrl>
+ <UpdateUrl>http://www.skylabsonline.com/ocdownload/</UpdateUrl>
+ <ProductName>OCTGN Customizer</ProductName>
+ <PublisherName>Skylabs</PublisherName>
+ <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
+ <WebPage>publish.htm</WebPage>
+ <ApplicationRevision>6</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <CreateDesktopShortcut>true</CreateDesktopShortcut>
+ <PublishWizardCompleted>true</PublishWizardCompleted>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <StartupObject>ocust.App</StartupObject>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ManifestCertificateThumbprint>2DFC4F19D21B7FB8184489CD5DB756A2A3605C1E</ManifestCertificateThumbprint>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ManifestKeyFile>ocust_TemporaryKey.pfx</ManifestKeyFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <GenerateManifests>true</GenerateManifests>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignManifests>false</SignManifests>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>false</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <TargetZone>LocalIntranet</TargetZone>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ApplicationIcon>Icon.ico</ApplicationIcon>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ionic.Zip">
+ <HintPath>..\..\..\..\..\..\Downs\DotNetZipLib-Runtime-v1.9\DotNetZip-v1.9\Ionic.Zip.dll</HintPath>
+ </Reference>
+ <Reference Include="IronPython">
+ <HintPath>..\..\..\..\owl\trunk\octgnFX\Lib\IronPython.dll</HintPath>
+ </Reference>
+ <Reference Include="IronPython.Modules">
+ <HintPath>..\..\..\..\owl\trunk\octgnFX\Lib\IronPython.Modules.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Dynamic">
+ <HintPath>..\..\..\..\owl\trunk\octgnFX\Lib\Microsoft.Dynamic.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Scripting">
+ <HintPath>..\..\..\..\owl\trunk\octgnFX\Lib\Microsoft.Scripting.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Windows.Shell, Version=3.5.41019.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference Include="Octgn.Data, Version=0.9.3.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\owl\trunk\octgnFX\Octgn\bin\Release\Octgn.Data.dll</HintPath>
+ </Reference>
+ <Reference Include="OCTGNwLobby, Version=0.9.3.2, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <ExecutableExtension>.exe</ExecutableExtension>
+ <HintPath>..\..\..\..\owl\trunk\octgnFX\Octgn\bin\Release\OCTGNwLobby.exe</HintPath>
+ </Reference>
+ <Reference Include="PresentationFramework.Aero" />
+ <Reference Include="RibbonControlsLibrary, Version=3.5.41019.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Management" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.ServiceModel" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Xaml">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="UIAutomationProvider" />
+ <Reference Include="UIAutomationTypes" />
+ <Reference Include="VistaDB.NET20, Version=3.3.1.54, Culture=neutral, PublicKeyToken=dfc935afe2125461, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\owl\trunk\octgnFX\Lib\VistaDB.NET20.dll</HintPath>
+ </Reference>
+ <Reference Include="WindowsBase" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Compile Include="DebugWindow.xaml.cs">
+ <DependentUpon>DebugWindow.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="DeepGameScan.xaml.cs">
+ <DependentUpon>DeepGameScan.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="GameEdit.xaml.cs">
+ <DependentUpon>GameEdit.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="GameSelector.xaml.cs">
+ <DependentUpon>GameSelector.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Splash.xaml.cs">
+ <DependentUpon>Splash.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Structure\Relationship.cs" />
+ <Compile Include="XmlStuff.cs" />
+ <Page Include="DebugWindow.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="DeepGameScan.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="GameEdit.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="GameSelector.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="GameSelect.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="MainWindow.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="GameSelect.xaml.cs">
+ <DependentUpon>GameSelect.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainWindow.xaml.cs">
+ <DependentUpon>MainWindow.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ <Page Include="Splash.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>