Skip to content

Commit

Permalink
Working OpenWith
Browse files Browse the repository at this point in the history
  • Loading branch information
Traderain authored and Traderain committed Oct 25, 2016
1 parent 3ad17c5 commit c8b14c3
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 16 deletions.
Binary file modified .vs/VolvoWrench/v14/.suo
Binary file not shown.
15 changes: 14 additions & 1 deletion VolvoWrench/DG/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace VolvoWrench.DG
Expand All @@ -13,7 +15,18 @@ private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
if (Environment.GetCommandLineArgs().Any(x => Path.GetExtension(x) == ".dem" || Path.GetExtension(x) == ".sav"))
if (Environment.GetCommandLineArgs().Any(x => Path.GetExtension(x) == ".dem"))
Application.Run(new Main(Environment.GetCommandLineArgs().First(x => Path.GetExtension(x) == ".dem")));
else if (Environment.GetCommandLineArgs().Any(x => Path.GetExtension(x) == ".sav"))
Application.Run(new saveanalyzerform(Environment.GetCommandLineArgs().First(x => Path.GetExtension(x) == ".sav")));
else
Application.Run(new Main());
else
Application.Run(new Main());
//args[0] is the application path.
//args[1] will be the file path.
//args[n] will be any other arguments passed in.
}
}
}
27 changes: 27 additions & 0 deletions VolvoWrench/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,33 @@ public Main()
}


//Open with main constructor
public Main(string s)
{
InitializeComponent();
CurrentFile = s;
SettingsManager(false);
AllowDrop = true;
HotkeyTimer.Start();
goldSourceToolsToolStripMenuItem.Enabled = false;
toolsToolStripMenuItem.Enabled = false;
if (File.Exists(LogPath))
File.Delete(LogPath);
if (CurrentFile != null || (File.Exists(CurrentFile) || Path.GetExtension(CurrentFile) == ".dem"))
{
richTextBox1.Text = @"Analyzing file...";
CurrentDemoFile = CrossDemoParser.Parse(CurrentFile);
PrintDemoDetails(CurrentDemoFile);
Log(CurrentFile + " opened!");
}
else
{
toolsToolStripMenuItem.Enabled = false;
goldSourceToolsToolStripMenuItem.Enabled = false;
richTextBox1.Text = @"^ Use File->Open to open a correct .dem file or drop the file here!";
}
}

#region File ToolStrip stuff
private void openAsavToolStripMenuItem_Click(object sender, EventArgs e)
{
Expand Down
35 changes: 35 additions & 0 deletions VolvoWrench/SaveStuff/Save analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,41 @@ public saveanalyzerform()
InitializeComponent();
}

public saveanalyzerform(string file)
{
InitializeComponent();
if ((File.Exists(file) && Path.GetExtension(file) == ".sav"))
{
label1.Text = Path.GetFileName(file);
var parsedSave = Listsave.ParseFile(file);
richTextBox1.Text =
$@" - Save parsed -
Filename: {Path.GetFileName(file)}
Header: {parsedSave.Header}
SaveVersion: {parsedSave.SaveVersion}
Size: {parsedSave.TokenTableFileTableOffset}
TokenCount: {parsedSave.TokenCount}
Tokensize: {parsedSave.TokenTableSize}
";
richTextBox1.Text += @"Savestate files in save:";
foreach (var valvFile in parsedSave.Files)
{
richTextBox1.Text += $@"
Name: {valvFile.FileName}
Magic Word: {valvFile.MagicWord}
Size: {valvFile.Data.Length} bytes
--------------------------------------";
}
}
else
{
label1.Text = @"Bad file!";
richTextBox1.Text = @"Select a correct file please.";
Main.Log("Save parse open failed.");
}

}

private void button1_Click(object sender, EventArgs e)
{
label1.Text = "";
Expand Down
2 changes: 1 addition & 1 deletion VolvoWrench/bin/Debug/VolvoWrench.application
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>Fwj4UHNh+RAJXEZ+Vr2cwaTYIaH45kHiqp2CurRvA3o=</dsig:DigestValue>
<dsig:DigestValue>YsG+LSznTyk7rv2i0HnymOWx7rAJV9kjzTRjsJSfe6M=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/bin/Debug/VolvoWrench.exe
Binary file not shown.
8 changes: 4 additions & 4 deletions VolvoWrench/bin/Debug/VolvoWrench.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:iconFile="08 Wrench.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="VolvoWrench" version="1.0.6141.29461" language="neutral" processorArchitecture="amd64" />
<assemblyIdentity name="VolvoWrench" version="1.0.6142.29607" language="neutral" processorArchitecture="amd64" />
<commandLine file="VolvoWrench.exe" parameters="" />
</entryPoint>
<trustInfo>
Expand Down Expand Up @@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="826368">
<assemblyIdentity name="VolvoWrench" version="1.0.6141.29461" language="neutral" processorArchitecture="amd64" />
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="828416">
<assemblyIdentity name="VolvoWrench" version="1.0.6142.29607" language="neutral" processorArchitecture="amd64" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>r3lqTmZXqITV9sz+GXGHNMpGjBhGumDCGl0RtwR8Ux8=</dsig:DigestValue>
<dsig:DigestValue>A026S6cyfsIUtg1EnOwb6GbZSNpAvidr4mQRWVxEYzw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/bin/Debug/VolvoWrench.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion VolvoWrench/bin/Debug/VolvoWrench.vshost.application
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>Fwj4UHNh+RAJXEZ+Vr2cwaTYIaH45kHiqp2CurRvA3o=</dsig:DigestValue>
<dsig:DigestValue>YsG+LSznTyk7rv2i0HnymOWx7rAJV9kjzTRjsJSfe6M=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
8 changes: 4 additions & 4 deletions VolvoWrench/bin/Debug/VolvoWrench.vshost.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:iconFile="08 Wrench.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="VolvoWrench" version="1.0.6141.29461" language="neutral" processorArchitecture="amd64" />
<assemblyIdentity name="VolvoWrench" version="1.0.6142.29607" language="neutral" processorArchitecture="amd64" />
<commandLine file="VolvoWrench.exe" parameters="" />
</entryPoint>
<trustInfo>
Expand Down Expand Up @@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="826368">
<assemblyIdentity name="VolvoWrench" version="1.0.6141.29461" language="neutral" processorArchitecture="amd64" />
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="828416">
<assemblyIdentity name="VolvoWrench" version="1.0.6142.29607" language="neutral" processorArchitecture="amd64" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>r3lqTmZXqITV9sz+GXGHNMpGjBhGumDCGl0RtwR8Ux8=</dsig:DigestValue>
<dsig:DigestValue>A026S6cyfsIUtg1EnOwb6GbZSNpAvidr4mQRWVxEYzw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/bin/Debug/app.publish/VolvoWrench.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion VolvoWrench/obj/Debug/VolvoWrench.application
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>Fwj4UHNh+RAJXEZ+Vr2cwaTYIaH45kHiqp2CurRvA3o=</dsig:DigestValue>
<dsig:DigestValue>YsG+LSznTyk7rv2i0HnymOWx7rAJV9kjzTRjsJSfe6M=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/obj/Debug/VolvoWrench.exe
Binary file not shown.
8 changes: 4 additions & 4 deletions VolvoWrench/obj/Debug/VolvoWrench.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:iconFile="08 Wrench.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="VolvoWrench" version="1.0.6141.29461" language="neutral" processorArchitecture="amd64" />
<assemblyIdentity name="VolvoWrench" version="1.0.6142.29607" language="neutral" processorArchitecture="amd64" />
<commandLine file="VolvoWrench.exe" parameters="" />
</entryPoint>
<trustInfo>
Expand Down Expand Up @@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="826368">
<assemblyIdentity name="VolvoWrench" version="1.0.6141.29461" language="neutral" processorArchitecture="amd64" />
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="828416">
<assemblyIdentity name="VolvoWrench" version="1.0.6142.29607" language="neutral" processorArchitecture="amd64" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>r3lqTmZXqITV9sz+GXGHNMpGjBhGumDCGl0RtwR8Ux8=</dsig:DigestValue>
<dsig:DigestValue>A026S6cyfsIUtg1EnOwb6GbZSNpAvidr4mQRWVxEYzw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/obj/Debug/VolvoWrench.pdb
Binary file not shown.

0 comments on commit c8b14c3

Please sign in to comment.