Skip to content

Commit

Permalink
Added verbose messages to Tweaks
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Mod-Manager/src/Environment3/RushInterface.Designer.cs
	modified:   Sonic-06-Mod-Manager/src/UnifyPatcher.cs
  • Loading branch information
HyperPolygon64 committed Apr 12, 2020
1 parent 32cddf1 commit 7ee7e63
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.

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

36 changes: 28 additions & 8 deletions Sonic-06-Mod-Manager/src/UnifyPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ public static void ApplyTweaks(RushInterface rush) {
if (!File.Exists($"{xex}_back"))
File.Copy(xex, $"{xex}_back", true);

rush.Status = $"Tweaking Field of View...";
XEX.Decrypt(xex); // Decrypt the XEX to be able to modify it properly
XEX.FieldOfView(xex, fieldOfView); // Set FOV
}
Expand Down Expand Up @@ -1043,19 +1044,22 @@ public static void ApplyTweaks(RushInterface rush) {
// Force MSAA
if (antiAliasing != 1 || forceMSAA) {
rush.Status = $"Tweaking Anti-Aliasing...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <cache.arc> Set Anti-Aliasing to {antiAliasing}...");
MSAA(Path.Combine(tweak, $"cache\\{system}\\scripts\\render\\"), antiAliasing, SearchOption.TopDirectoryOnly);
}
}

// Optimised
else if (renderer == 1) {
rush.Status = $"Tweaking Renderer...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <cache.arc> Set renderer to Optimised...");
File.WriteAllBytes(Path.Combine(tweak, $"cache\\{system}\\scripts\\render\\core\\render_main.lub"), Properties.Resources.optimised_render_main);
}

// Destructive
else if (renderer == 2) {
rush.Status = $"Tweaking Renderer...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <cache.arc> Set renderer to Destructive...");
File.WriteAllBytes(Path.Combine(tweak, $"cache\\{system}\\scripts\\render\\render_gamemode.lub"), Properties.Resources.vulkan_render_gamemode);
File.WriteAllBytes(Path.Combine(tweak, $"cache\\{system}\\scripts\\render\\render_title.lub"), Properties.Resources.vulkan_render_title);
File.WriteAllBytes(Path.Combine(tweak, $"cache\\{system}\\scripts\\render\\core\\render_main.lub"), Properties.Resources.vulkan_render_main);
Expand All @@ -1064,25 +1068,31 @@ public static void ApplyTweaks(RushInterface rush) {
// Cheap
else if (renderer == 3) {
rush.Status = $"Tweaking Renderer...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <cache.arc> Set renderer to Cheap...");
File.WriteAllBytes(Path.Combine(tweak, $"cache\\{system}\\scripts\\render\\render_gamemode.lub"), Properties.Resources.render_cheap);
}

// Reflections
if (reflections != 1) {
rush.Status = $"Tweaking Reflections...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <cache.arc> Set reflection resolution to {reflections}...");
Reflections(Path.Combine(tweak, $"cache\\{system}\\scripts\\render\\core\\render_reflection.lub"), reflections);
}

if (system == "ps3") {
rush.Status = $"Tweaking Camera...";

// Camera Type
if (cameraType != 0)
if (cameraType != 0) {
rush.Status = $"Tweaking Camera...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <cache.arc> Set camera type to {cameraType}...");
CameraType(Path.Combine(tweak, $"cache\\{system}\\cameraparam.lub"), cameraType, fieldOfView);
}

// Camera Distance
if (cameraDistance != 650)
if (cameraDistance != 650) {
rush.Status = $"Tweaking Camera...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <cache.arc> Set camera distance to {cameraDistance}...");
CameraDistance(Path.Combine(tweak, $"cache\\{system}\\cameraparam.lub"), (int)cameraDistance);
}
}

// Repack archive as tweak
Expand All @@ -1106,6 +1116,7 @@ public static void ApplyTweaks(RushInterface rush) {
// Force MSAA
if (antiAliasing != 1 || forceMSAA) {
rush.Status = $"Tweaking Anti-Aliasing...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <scripts.arc> Set Anti-Aliasing to {antiAliasing}...");
MSAA(Path.Combine(tweak, $"scripts\\{system}\\scripts\\render\\"), antiAliasing, SearchOption.AllDirectories);
}

Expand All @@ -1126,15 +1137,19 @@ public static void ApplyTweaks(RushInterface rush) {
tweak = ModEngine.UnpackARC(archive, Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));

if (system == "xenon") {
rush.Status = $"Tweaking Camera...";

// Camera Type
if (cameraType != 0)
if (cameraType != 0) {
rush.Status = $"Tweaking Camera...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <game.arc> Set camera type to {cameraType}...");
CameraType(Path.Combine(tweak, $"game\\{system}\\cameraparam.lub"), cameraType, fieldOfView);
}

// Camera Distance
if (cameraDistance != 650)
if (cameraDistance != 650) {
rush.Status = $"Tweaking Camera...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <game.arc> Set camera distance to {cameraDistance}...");
CameraDistance(Path.Combine(tweak, $"game\\{system}\\cameraparam.lub"), (int)cameraDistance);
}
}

// Repack archive as tweak
Expand All @@ -1158,29 +1173,34 @@ public static void ApplyTweaks(RushInterface rush) {
// Tokyo Game Show
if (cameraType == 1) {
rush.Status = $"Tweaking Camera...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <player.arc> Set camera type to {cameraType}...");
CameraType(Path.Combine(tweak, $"player\\{system}\\player\\common.lub"), cameraType, fieldOfView);
}

// Camera Height
if (cameraHeight != 70) {
rush.Status = $"Tweaking Camera...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <player.arc> Set camera height to {cameraHeight}...");
CameraHeight(Path.Combine(tweak, $"player\\{system}\\player\\common.lub"), cameraHeight);
}

// Amy's Hammer Range
if (hammerRange != 50) {
rush.Status = $"Tweaking Characters...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <player.arc> Set Amy's hammer range to {hammerRange}...");
HammerRange(Path.Combine(tweak, $"player\\{system}\\player\\amy.lub"), hammerRange);
}

if (beginWithRings != 0) {
rush.Status = $"Tweaking Characters...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <player.arc> Set default Ring count to {beginWithRings}...");
BeginWithRings(Path.Combine(tweak, $"player\\{system}\\player\\"), beginWithRings);
}

// Unlock Tails' Flight Limit
if (tailsFlightLimit) {
rush.Status = $"Tweaking Characters...";
Console.WriteLine($"[{DateTime.Now:HH:mm:ss tt}] [Tweak] <player.arc> Unlocked Tails' flight limit...");
UnlockTailsFlightLimit(Path.Combine(tweak, $"player\\{system}\\player\\tails.lub"));
}

Expand Down

0 comments on commit 7ee7e63

Please sign in to comment.