Skip to content

Commit

Permalink
UI fixes & Disable Character Stumble patch
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Mod-Manager/src/AboutForm.resx
	modified:   Sonic-06-Mod-Manager/src/ModCreator.cs
	modified:   Sonic-06-Mod-Manager/src/ModManager.Designer.cs
	modified:   Sonic-06-Mod-Manager/src/ModManager.cs
	modified:   Sonic-06-Mod-Manager/src/UnifyPatcher.cs
  • Loading branch information
HyperPolygon64 committed Jan 6, 2020
1 parent 6426521 commit 799364d
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Sonic-06-Mod-Manager/src/AboutForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ g0ldenlink - ARC Repacker
SuperSonic16 - GameBanana API for C#
GerbilSoft - Fixed .NET WebClient Encoding
SEGA Carnival - Software Update Hosting
Nonami - Windows Software Tester and Omega Blur Fix
Nonami - Omega Blur Fix and Disable Character Stumble
darkhero1337 - Unlock Mid-air Momentum
ChaosX - TGS 2005 Camera Accuracy
acro - Windows Software Tester and TGS 2005 Camera Accuracy
acro - TGS 2005 Camera Accuracy
Mefiresu - Debug Mode
Desko - Homing Flips, Homing Spam and Bound Attack Recovery
xorloser - XexTool
Expand Down
1 change: 1 addition & 0 deletions Sonic-06-Mod-Manager/src/ModCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public ModCreator(string modPath, bool edit)
if (ModManager.christmas) Icon = Properties.Resources.icon_christmas;

unifytb_ModCreator.ActiveColor = unifytb_ModCreator.HorizontalLineColor = Properties.Settings.Default.accentColour;
if (Properties.Settings.Default.highContrast) unifytb_ModCreator.SelectedTextColor = SystemColors.ControlText;

if (!Properties.Settings.Default.theme) { //Edit colours if the user is insane and opts to use the Light Theme
btn_Browse.FlatAppearance.BorderSize = 1; //Border Size in Light Theme
Expand Down
1 change: 1 addition & 0 deletions Sonic-06-Mod-Manager/src/ModManager.Designer.cs

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

19 changes: 16 additions & 3 deletions Sonic-06-Mod-Manager/src/ModManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace Sonic_06_Mod_Manager
{
public partial class ModManager : Form
{
public readonly string versionNumber = "Version 2.54-indev-060120r1"; // Defines the version number to be used globally
public readonly string versionNumber = "Version 2.54"; // Defines the version number to be used globally
public readonly string modLoaderVersion = "Version 2.1";
public static List<string> configs = new List<string>() { }; // Defines the configs list for 'mod.ini' files
public static bool debugMode = false;
Expand Down Expand Up @@ -260,6 +260,8 @@ private void Btn_ModInfo_Click(object sender, EventArgs e) {
Status = SystemMessages.msg_PatchInfo;
if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Action Gauge Fixes for Sonic")) {
UnifyMessages.UnifyMessage.Show("This patch will restore Sonic's Action Gauge draining and replenishment when using Gems.", "Action Gauge Fixes for Sonic", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Bound Attack Recovery")) {
UnifyMessages.UnifyMessage.Show("This patch will unlock mid-air momentum for the bound attack.\n\nUnlock Mid-air Momentum patch would be recommended to use with this.", "Bound Attack Recovery", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Curved Homing Attack for Sonic")) {
UnifyMessages.UnifyMessage.Show("This patch will swap Sonic's homing module with Blaze's to simulate the homing attack from early versions of Sonic '06. However, this removes Sonic's ability to destroy physics objects.", "Curved Homing Attack for Sonic", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Debug Mode")) {
Expand All @@ -274,8 +276,8 @@ private void Btn_ModInfo_Click(object sender, EventArgs e) {
UnifyMessages.UnifyMessage.Show("This patch will disable all music tracks. This may only be useful to Xbox 360 players, since the game doesn't save audio settings on that version.", "Disable Music", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Disable Shadows")) {
UnifyMessages.UnifyMessage.Show("This patch will disable real-time shadow rendering and baked shadows. This may provide a significant performance boost, but looks pretty ugly.", "Disable Shadows", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Bound Attack Recovery")) {
UnifyMessages.UnifyMessage.Show("This patch will unlock mid-air momentum for the bound attack.\n\nUnlock Mid-air Momentum patch would be recommended to use with this.", "Bound Attack Recovery", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Disable Character Stumble")) {
UnifyMessages.UnifyMessage.Show("This patch will disable the stumble state when characters impact walls at high speed.", "Disable Character Stumble", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Enable Homing Flips")) {
UnifyMessages.UnifyMessage.Show("This patch will restore the homing flip animations for Sonic.", "Enable Homing Flips", "OK", "Information");
} else if (clb_PatchesList.SelectedIndex == clb_PatchesList.Items.IndexOf("Enable Homing Spam")) {
Expand Down Expand Up @@ -486,6 +488,17 @@ private void PatchAll()
Status = SystemMessages.msg_DefaultStatus;
}

if (clb_PatchesList.GetItemChecked(clb_PatchesList.Items.IndexOf("Disable Character Stumble"))) {
Status = SystemMessages.msg_PatchingCharacters;
if (text_GameDirectory.Text != string.Empty && Directory.Exists(text_GameDirectory.Text)) {
if (!File.Exists(Path.Combine(text_GameDirectory.Text, "default.xex_back")) && !File.Exists(Path.Combine(text_GameDirectory.Text, "default.xex_orig")))
File.Copy(Path.Combine(text_GameDirectory.Text, "default.xex"), Path.Combine(text_GameDirectory.Text, "default.xex_orig"), true);
XEX.Decrypt(Path.Combine(text_GameDirectory.Text, "default.xex"));
XEX.DisableStumble(Path.Combine(text_GameDirectory.Text, "default.xex"));
}
Status = SystemMessages.msg_DefaultStatus;
}

if (clb_PatchesList.GetItemChecked(clb_PatchesList.Items.IndexOf("Bound Attack Recovery"))) {
Status = SystemMessages.msg_PatchingCharacters;
if (text_GameDirectory.Text != string.Empty && Directory.Exists(text_GameDirectory.Text)) {
Expand Down
58 changes: 44 additions & 14 deletions Sonic-06-Mod-Manager/src/UnifyPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,35 +459,65 @@ public static void DecompressBIN(string filepath) {

public static void FieldOfView(string filepath, decimal fov) {
using (var stream = File.Open(filepath, FileMode.Open, FileAccess.Write)) {
stream.Position = 0x4F4D;
stream.WriteByte(decimal.ToByte(fov));
stream.Position = 0x4F4D; stream.WriteByte(decimal.ToByte(fov));
}
}

public static void HomingFlips(string filepath) {
using (var stream = File.Open(filepath, FileMode.Open, FileAccess.Write)) {
stream.Position = 0x21A3F0;
stream.WriteByte(0x41);
stream.Position = 0x21A3F0; stream.WriteByte(0x41);
}
}

public static void BoundRecovery(string filepath) {
using (var stream = File.Open(filepath, FileMode.Open, FileAccess.Write)) {
stream.Position = 0x21ADC8;
stream.WriteByte(0x40);
stream.Position = 0x21ADC8; stream.WriteByte(0x40);
}
}

public static void HomingSpam(string filepath) {
using (var stream = File.Open(filepath, FileMode.Open, FileAccess.Write)) {
stream.Position = 0x21A4BC;
stream.WriteByte(0x60);
stream.Position = 0x21A4BD;
stream.WriteByte(0x00);
stream.Position = 0x21A4BE;
stream.WriteByte(0x00);
stream.Position = 0x21A4BF;
stream.WriteByte(0x00);
stream.Position = 0x21A4BC; stream.WriteByte(0x60);
stream.Position = 0x21A4BD; stream.WriteByte(0x00);
stream.Position = 0x21A4BE; stream.WriteByte(0x00);
stream.Position = 0x21A4BF; stream.WriteByte(0x00);
}
}

public static void DisableStumble(string filepath) {
using (var stream = File.Open(filepath, FileMode.Open, FileAccess.Write)) {
// Sonic the Hedgehog
stream.Position = 0xB10DB3; stream.WriteByte(0x29);
stream.Position = 0xB10DB6; stream.WriteByte(0x15);
stream.Position = 0xB10DB7; stream.WriteByte(0xD0);
// Princess Elise
stream.Position = 0xB110EB; stream.WriteByte(0x29);
stream.Position = 0xB110EE; stream.WriteByte(0x15);
stream.Position = 0xB110EF; stream.WriteByte(0xD0);
// Shadow the Hedgehog
stream.Position = 0xB1124B; stream.WriteByte(0x29);
stream.Position = 0xB1124E; stream.WriteByte(0x15);
stream.Position = 0xB1124F; stream.WriteByte(0xD0);
// E-123 Omega
stream.Position = 0xB1190B; stream.WriteByte(0x29);
stream.Position = 0xB1190E; stream.WriteByte(0x15);
stream.Position = 0xB1190F; stream.WriteByte(0xD0);
// Amy Rose
stream.Position = 0xB11A33; stream.WriteByte(0x29);
stream.Position = 0xB11A36; stream.WriteByte(0x15);
stream.Position = 0xB11A37; stream.WriteByte(0xD0);
// Blaze the Cat
stream.Position = 0xB11B83; stream.WriteByte(0x29);
stream.Position = 0xB11B86; stream.WriteByte(0x15);
stream.Position = 0xB11B87; stream.WriteByte(0xD0);
// Knuckles the Echidna
stream.Position = 0xB11CCB; stream.WriteByte(0x29);
stream.Position = 0xB11CCE; stream.WriteByte(0x15);
stream.Position = 0xB11CCF; stream.WriteByte(0xD0);
// Rouge the Bat
stream.Position = 0xB11E1B; stream.WriteByte(0x29);
stream.Position = 0xB11E1E; stream.WriteByte(0x15);
stream.Position = 0xB11E1F; stream.WriteByte(0xD0);
}
}
}
Expand Down

0 comments on commit 799364d

Please sign in to comment.