Skip to content

Commit

Permalink
Stability improvements; dependency verification & bug fixes
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Toolkit/Properties/AssemblyInfo.cs
	modified:   Sonic-06-Toolkit/Properties/Resources.Designer.cs
	modified:   Sonic-06-Toolkit/Properties/Resources.resx
	modified:   Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitEnvironmentX.cs
	modified:   Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitProgram.cs
	modified:   Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitSessionLog.Designer.cs
	modified:   Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitSessionLog.cs
	modified:   Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitText.cs
	modified:   Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitTools.cs
	modified:   Sonic-06-Toolkit/src/Tools/BINA/CollisionGenerator.cs
	modified:   Sonic-06-Toolkit/src/Tools/BINA/PlacementConverter.cs
	modified:   Sonic-06-Toolkit/src/Tools/BINA/TextEncoding.cs
	modified:   Sonic-06-Toolkit/src/Tools/DirectDraw/TextureConverter.cs
	modified:   Sonic-06-Toolkit/src/Tools/Lua/LuaCompilation.cs
	modified:   Sonic-06-Toolkit/src/Tools/SegaNN/XNOTool.cs
	modified:   Sonic-06-Toolkit/src/Tools/SonicAudioTools/SonicSoundStudio.cs
	modified:   Sonic-06-Toolkit/src/Tools/XexTool/ExecutableModification.cs
  • Loading branch information
HyperPolygon64 committed Nov 23, 2019
1 parent a3d160f commit dc15b5a
Show file tree
Hide file tree
Showing 17 changed files with 366 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Sonic-06-Toolkit/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.7.0")]
[assembly: AssemblyFileVersion("3.0.8.0")]
126 changes: 126 additions & 0 deletions Sonic-06-Toolkit/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions Sonic-06-Toolkit/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,48 @@
<data name="csbLogo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\src\Tools\SonicAudioTools\csbLogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hash_arctool" xml:space="preserve">
<value>38A0008D503AD8B891253BCDFD9608B2</value>
</data>
<data name="hash_at3tool" xml:space="preserve">
<value>E3A802A193FDDEFA2556761A717E3BC3</value>
</data>
<data name="hash_luac50" xml:space="preserve">
<value>5E7127420FFE9FC418CE43F7280C918D</value>
</data>
<data name="hash_mst06" xml:space="preserve">
<value>7614FC8E0ED2DB168C93B69887513FCB</value>
</data>
<data name="hash_repack" xml:space="preserve">
<value>122E997019F43E1F54370313F358D50F</value>
</data>
<data name="hash_s06col" xml:space="preserve">
<value>062AC6249016BDD62126EF6ADF89754D</value>
</data>
<data name="hash_s06collision" xml:space="preserve">
<value>C6D5D656CB56E3FC1C7ACD47DC07280B</value>
</data>
<data name="hash_texconv" xml:space="preserve">
<value>169714A7FF4D68818EF1F8298737838C</value>
</data>
<data name="hash_towav" xml:space="preserve">
<value>0CBFE82554E6405F0B7C6D116126A100</value>
</data>
<data name="hash_unlub" xml:space="preserve">
<value>BEBB0AC6785DDC775C5CE99D4A614FC5</value>
</data>
<data name="hash_unpack" xml:space="preserve">
<value>DC37178A363E57BC46E81F7857541F9A</value>
</data>
<data name="hash_xextool" xml:space="preserve">
<value>A1924FA8082EFB8DF878BA9454698D85</value>
</data>
<data name="hash_xmaencode" xml:space="preserve">
<value>8DC5FB8541250E0D50FEED5EB36E4F23</value>
</data>
<data name="hash_xno2dae" xml:space="preserve">
<value>6771D7D3C44B79919C4D3F8731B758E5</value>
</data>
<data name="HedgeLib" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\src\tools\bina\hedgelib.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
Expand Down
45 changes: 30 additions & 15 deletions Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitEnvironmentX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Web;
using System.Text;
using System.Linq;
using System.Media;
using Toolkit.Text;
using Toolkit.Tools;
using System.Drawing;
Expand Down Expand Up @@ -41,7 +42,7 @@ namespace Toolkit.EnvironmentX
{
public partial class Main : Form
{
public static readonly string versionNumber = "Version 3.07"; // Defines the version number to be used globally
public static readonly string versionNumber = "Version 3.08"; // Defines the version number to be used globally
public static List<string> sessionLog = new List<string>();
public static string repackBuildSession = string.Empty;
public static string serverStatus = string.Empty;
Expand Down Expand Up @@ -242,7 +243,7 @@ private void Window_CloseAllTabs_Click(object sender, EventArgs e) {
}
} else
ResetTab(true);
}
}

private void File_OpenFolder_Click(object sender, EventArgs e) {
string getPath = Browsers.CommonBrowser(true, "Please select a folder...", string.Empty);
Expand Down Expand Up @@ -310,12 +311,11 @@ private void File_OpenARC_Click(object sender, EventArgs e) {

private void Unifytb_Main_SelectedIndexChanged(object sender, EventArgs e) {
try {
repackBuildSession = Path.Combine(Program.applicationData, Paths.Archives, Program.sessionID.ToString(), unifytb_Main.SelectedTab.ToolTipText);

RefreshPath();
if (unifytb_Main.SelectedTab.ToolTipText == string.Empty)
Text = SystemMessages.tl_DefaultTitleVersion;
else if (unifytb_Main.SelectedTab.ToolTipText.StartsWith("Zm9sZGVy"))
Text = SystemMessages.tl_Exploring(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\");
Text = SystemMessages.tl_Exploring(HttpUtility.UrlDecode(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\").Replace("file:", ""));
else {
//Reads the metadata to get the original location of the ARC.
if (File.Exists(Path.Combine(repackBuildSession, "metadata.ini"))) {
Expand Down Expand Up @@ -365,16 +365,15 @@ await ProcessAsyncHelper.ExecuteShellCommand(Paths.Repack,
}

private void Btn_OpenFolder_Click(object sender, EventArgs e) {
try { Process.Start(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\"); }
try { Process.Start(HttpUtility.UrlDecode(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\").Replace("file:", "")); }
catch (Exception ex) { MessageBox.Show($"{SystemMessages.ex_OpenFolderError}\n\n{ex}", SystemMessages.tl_FatalError, MessageBoxButtons.OK, MessageBoxIcon.Error); }
}

private void Folder_CopyToClipboard_Click(object sender, EventArgs e) {
try {
Status = StatusMessages.msg_Clipboard;
Clipboard.SetText(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\");
}
catch (Exception ex) { MessageBox.Show($"{SystemMessages.ex_ClipboardFolderError}\n\n{ex}", SystemMessages.tl_FatalError, MessageBoxButtons.OK, MessageBoxIcon.Error); }
Clipboard.SetText(HttpUtility.UrlDecode(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\").Replace("file:", ""));
} catch (Exception ex) { MessageBox.Show($"{SystemMessages.ex_ClipboardFolderError}\n\n{ex}", SystemMessages.tl_FatalError, MessageBoxButtons.OK, MessageBoxIcon.Error); }
}

private void Btn_OpenFolderOptions_Click(object sender, EventArgs e) {
Expand Down Expand Up @@ -523,6 +522,7 @@ private void EraseData() {
file.Delete();
foreach (DirectoryInfo directory in archiveData.GetDirectories())
directory.Delete(true);
Directory.Delete(Path.Combine(Program.applicationData, Paths.Archives, Program.sessionID.ToString()));
}
}
catch { }
Expand Down Expand Up @@ -582,8 +582,7 @@ private void Tm_CheapFix_Tick(object sender, EventArgs e) {
} catch { Text = SystemMessages.tl_DefaultTitleVersion; }

try {
if (CurrentARC().Url != null)
Paths.currentPath = HttpUtility.UrlDecode(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\").Replace("file:", "");
RefreshPath();
if (unifytb_Main.SelectedTab.Text != "New Tab" || unifytb_Main.SelectedTab.ToolTipText != string.Empty || Properties.Settings.Default.env_gameDirectory != string.Empty)
InterfaceEnabled(true);
else if (unifytb_Main.SelectedTab.Text == "New Tab" && unifytb_Main.SelectedTab.ToolTipText == string.Empty)
Expand All @@ -592,6 +591,21 @@ private void Tm_CheapFix_Tick(object sender, EventArgs e) {
catch { }
}

private void RefreshPath() {
try {
repackBuildSession = Path.Combine(Program.applicationData, Paths.Archives, Program.sessionID.ToString(), unifytb_Main.SelectedTab.ToolTipText);
string getCurrentPath = string.Empty;

if (CurrentARC().Url != null) {
getCurrentPath = HttpUtility.UrlDecode(CurrentARC().Url.ToString().Replace("file:///", "").Replace("/", @"\") + @"\").Replace("file:", "");
Paths.currentPath = getCurrentPath;
}

//Console.WriteLine(repackBuildSession);
//Console.WriteLine(getCurrentPath);
} catch { }
}

private void Sdk_PlacementConverter_Click(object sender, EventArgs e) {
new PlacementConverter(this).ShowDialog();
}
Expand All @@ -604,8 +618,7 @@ private void Lbl_Status_Click(object sender, EventArgs e) {
try {
openLogs = (Logs.ToolkitSessionLog)Application.OpenForms["ToolkitSessionLog"];
openLogs.Close();
}
catch { }
} catch { }
}

if (Properties.Settings.Default.env_firstLaunch)
Expand Down Expand Up @@ -659,8 +672,10 @@ private void SingleExtractCompleted(object sender, RunWorkerCompletedEventArgs e
bw_Worker.RunWorkerCompleted -= SingleExtractCompleted;
bw_Worker.DoWork -= SingleExtractDoWork;
file_ExtractISO.Enabled = true;
if (XisoExtractor._errorlevel == 0) Status = XisoExtractor.GetLastError(extractQueue);
else MessageBox.Show(XisoExtractor.GetLastError(extractQueue), SystemMessages.tl_FatalError, MessageBoxButtons.OK, MessageBoxIcon.Error);
if (XisoExtractor._errorlevel == 0) {
Status = XisoExtractor.GetLastError(extractQueue);
SystemSounds.Asterisk.Play();
} else MessageBox.Show(XisoExtractor.GetLastError(extractQueue), SystemMessages.tl_FatalError, MessageBoxButtons.OK, MessageBoxIcon.Error);
extractQueue = string.Empty;
}

Expand Down
8 changes: 6 additions & 2 deletions Sonic-06-Toolkit/src/Sonic-06-Toolkit/ToolkitProgram.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.IO;
using Toolkit.Text;
using Toolkit.Tools;
using System.Diagnostics;
using System.Windows.Forms;
using System.Security.Principal;
Expand Down Expand Up @@ -95,9 +97,11 @@ static void Main(string[] args) {
if (!File.Exists($"{applicationData}\\Hyper_Development_Team\\Sonic '06 Toolkit\\Tools\\s06col.exe"))
File.WriteAllBytes($"{applicationData}\\Hyper_Development_Team\\Sonic '06 Toolkit\\Tools\\s06col.exe", Properties.Resources.s06col);

//if (!File.Exists($"{applicationData}\\Hyper_Development_Team\\Sonic '06 Toolkit\\Tools\\s06collision.exe"))
if (!File.Exists($"{applicationData}\\Hyper_Development_Team\\Sonic '06 Toolkit\\Tools\\s06collision.exe"))
File.WriteAllBytes($"{applicationData}\\Hyper_Development_Team\\Sonic '06 Toolkit\\Tools\\s06collision.exe", Properties.Resources.s06collision);


Verification.VerifyDependencies(Paths.Tools);

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main(args, sessionID));
Expand Down
Loading

0 comments on commit dc15b5a

Please sign in to comment.