Skip to content

Commit

Permalink
Fixed FOV modifier bullshit and improved All Systems mods
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Mod-Manager/Properties/AssemblyInfo.cs
	modified:   Sonic-06-Mod-Manager/src/Environment3/RushInterface.cs
	modified:   Sonic-06-Mod-Manager/src/UnifyGlobalisation.cs
	modified:   Sonic-06-Mod-Manager/src/UnifyPatcher.cs
	modified:   Sonic-06-Mod-Manager/src/UnifyProgram.cs
  • Loading branch information
HyperPolygon64 committed Mar 27, 2020
1 parent 3df5fd4 commit 87aece0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Sonic-06-Mod-Manager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
[assembly: ComVisible(false)]
[assembly: Guid("277111e3-79d8-41b5-b0d7-7609dff6e36f")]
[assembly: AssemblyVersion("2.0.0.6")]
[assembly: AssemblyFileVersion("3.1.6.0")]
[assembly: AssemblyFileVersion("3.1.7.0")]
7 changes: 6 additions & 1 deletion Sonic-06-Mod-Manager/src/Environment3/RushInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,12 @@ private void SectionButton_InstallMods_Click(object sender, EventArgs e) {
Label_Status.Text = $"Installing {mod.Text}...";

// Install the specified mod
ModEngine.InstallMods(mod.SubItems[6].Text, mod.Text);
try { ModEngine.InstallMods(mod.SubItems[6].Text, mod.Text); }
catch (Exception ex) {
UnifyMessenger.UnifyMessage.ShowDialog($"An error occurred whilst installing your mods...\n\n{ex}",
"Installation failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

if (Properties.Settings.Default.General_SaveFileRedirection)
// Redirect save data from the specified mod
Expand Down
10 changes: 6 additions & 4 deletions Sonic-06-Mod-Manager/src/UnifyGlobalisation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static string OppositeSystem(string path) {
/// </summary>
public static string Emulator(string path) {
if (Path.GetExtension(path).ToLower() == ".xex") return "Xenia";
if (Path.GetExtension(path).ToLower() == ".bin") return "RPCS3";
else if (Path.GetExtension(path).ToLower() == ".bin") return "RPCS3";
else return "unspecified";
}

Expand All @@ -73,23 +73,25 @@ public static string Emulator(string path) {
/// </summary>
public static string Core(string path) {
if (Path.GetExtension(path).ToLower() == ".xex") return "xenon";
if (Path.GetExtension(path).ToLower() == ".bin") return "ps3";
else if (Path.GetExtension(path).ToLower() == ".bin") return "ps3";
else return "core";
}

/// <summary>
/// Renames the 'core' folder to the appropriate system root.
/// </summary>
public static string CoreReplace(string path) {
string system = System(Properties.Settings.Default.Path_GameDirectory);

if (Paths.GetRootFolder(path) == "core") {
string[] splitPath = path.Split('\\');

for (int i = 0; i < splitPath.Length; i++) {
if (splitPath[i] == "core" && System(Properties.Settings.Default.Path_GameDirectory) == "Xbox 360") {
if (splitPath[i] == "core" && system == "Xbox 360") {
splitPath[i] = "xenon";
return string.Join("\\", splitPath);
}
else if (splitPath[i] == "core" && System(Properties.Settings.Default.Path_GameDirectory) == "PlayStation 3") {
else if (splitPath[i] == "core" && system == "PlayStation 3") {
splitPath[i] = "ps3";
return string.Join("\\", splitPath);
}
Expand Down
16 changes: 8 additions & 8 deletions Sonic-06-Mod-Manager/src/UnifyPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public static void InstallMods(string mod, string name) {
s.EndsWith(".at3")).ToList();

foreach (string file in files) {
// Absolute file path (xenon/win32 and beyond)
string filePath = file.Remove(0, Path.GetDirectoryName(mod).Length);
// Absolute file path (core/xenon/win32 and beyond)
string filePath = Literal.CoreReplace(file.Remove(0, Path.GetDirectoryName(mod).Length).Substring(1));

// Absolute file path (from the mod) combined with the game directory
string vanillaFilePath = Path.Combine(Path.GetDirectoryName(Properties.Settings.Default.Path_GameDirectory), filePath.Substring(1));
string vanillaFilePath = Path.Combine(Path.GetDirectoryName(Properties.Settings.Default.Path_GameDirectory), filePath);

// Backup file path derived from the file about to be overwritten
string targetFilePath = $"{vanillaFilePath}_back";
Expand Down Expand Up @@ -454,9 +454,9 @@ public static void InstallPatches(string patch, string name) {
}

if (line.StartsWith("Parameter")) {
string[] _ParameterAdd = Lua.DeserialiseParameterList("ParameterAdd", line, false), // Deserialise 'ParameterEdit' parameter
_ParameterEdit = Lua.DeserialiseParameterList("ParameterEdit", line, false), // Deserialise 'ParameterEdit' parameter
_ParameterErase = Lua.DeserialiseParameterList("ParameterErase", line, false), // Deserialise 'ParameterErase' parameter
string[] _ParameterAdd = Lua.DeserialiseParameterList("ParameterAdd", line, false), // Deserialise 'ParameterEdit' parameter
_ParameterEdit = Lua.DeserialiseParameterList("ParameterEdit", line, false), // Deserialise 'ParameterEdit' parameter
_ParameterErase = Lua.DeserialiseParameterList("ParameterErase", line, false), // Deserialise 'ParameterErase' parameter
_ParameterRename = Lua.DeserialiseParameterList("ParameterRename", line, false); // Deserialise 'ParameterRename' parameter

if (line.StartsWith("ParameterAdd") && _ParameterAdd.Length != 0)
Expand All @@ -477,7 +477,7 @@ public static void InstallPatches(string patch, string name) {
}

if (line.StartsWith("Package")) {
string[] _PackageAdd = Lua.DeserialiseParameterList("PackageAdd", line, false), // Deserialise 'PackageAdd' parameter
string[] _PackageAdd = Lua.DeserialiseParameterList("PackageAdd", line, false), // Deserialise 'PackageAdd' parameter
_PackageEdit = Lua.DeserialiseParameterList("PackageEdit", line, false); // Deserialise 'PackageEdit' parameter

if (line.StartsWith("PackageAdd") && _PackageAdd.Length != 0)
Expand Down Expand Up @@ -984,7 +984,7 @@ public static void ApplyTweaks(RushInterface rush) {
tailsFlightLimit = Properties.Settings.Default.Tweak_TailsFlightLimit;

// Field of View
if (fieldOfView != 90 && system == "Xbox 360") {
if (fieldOfView != 90 && system == "xenon") {
string xex = Path.Combine(gameDirectory, "default.xex"); // Location of the XEX

if (!File.Exists($"{xex}_back"))
Expand Down
2 changes: 1 addition & 1 deletion Sonic-06-Mod-Manager/src/UnifyProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Unify.Environment3
{
static class Program
{
public static readonly string VersionNumber = "Version 3.16"; //-indev-{DateTime.Now.ToString("ddMMyy")}r1";
public static readonly string VersionNumber = "Version 3.17"; //-indev-{DateTime.Now.ToString("ddMMyy")}r1";

public static string ApplicationData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
_7Zip = $"{ApplicationData}\\Unify\\Tools\\7z.exe",
Expand Down

0 comments on commit 87aece0

Please sign in to comment.