summaryrefslogtreecommitdiff
path: root/Plugin.cs
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-10-12 20:51:18 -0400
committerAndrew Opalach <andrew@akon.city> 2026-10-12 20:51:18 -0400
commit7a3a3e1327fffa83c96d0947e9a5217a4a586247 (patch)
tree41bcd939f53e9f1857d9d1723de8321093291093 /Plugin.cs
parentd936fce375f99294184a60958180c5549c78512b (diff)
downloadWorldTuningTool-7a3a3e1327fffa83c96d0947e9a5217a4a586247.tar.gz
WorldTuningTool-7a3a3e1327fffa83c96d0947e9a5217a4a586247.tar.bz2
WorldTuningTool-7a3a3e1327fffa83c96d0947e9a5217a4a586247.zip
Save override view mode lods to config
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'Plugin.cs')
-rw-r--r--Plugin.cs73
1 files changed, 41 insertions, 32 deletions
diff --git a/Plugin.cs b/Plugin.cs
index 61d49d5..59fa00a 100644
--- a/Plugin.cs
+++ b/Plugin.cs
@@ -2433,29 +2433,29 @@ namespace WorldTuningTool
private bool higherVolumeQuality = false;
private Patch value2ForVolumeQuality;
- private bool disableLODLimits = false;
- private Patch defaultViewModeLODLimit;
- private Patch defaultViewModeLODLimit_1;
- private Patch defaultViewModeLODLimit_2;
- private Patch defaultViewModeLODLimit_3;
- private Patch defaultViewModeLODLimit_4;
+ private bool disableLodLimits = false;
+ private Patch defaultViewModeLodLimit;
+ private Patch defaultViewModeLodLimit_1;
+ private Patch defaultViewModeLodLimit_2;
+ private Patch defaultViewModeLodLimit_3;
+ private Patch defaultViewModeLodLimit_4;
- private void disableLODLimitsEnable()
+ private void disableLodLimitsEnable()
{
- defaultViewModeLODLimit.Enable();
- defaultViewModeLODLimit_1.Enable();
- defaultViewModeLODLimit_2.Enable();
- defaultViewModeLODLimit_3.Enable();
- defaultViewModeLODLimit_4.Enable();
+ defaultViewModeLodLimit.Enable();
+ defaultViewModeLodLimit_1.Enable();
+ defaultViewModeLodLimit_2.Enable();
+ defaultViewModeLodLimit_3.Enable();
+ defaultViewModeLodLimit_4.Enable();
}
- private void disableLODLimitsDisable()
+ private void disableLodLimitsDisable()
{
- defaultViewModeLODLimit.Disable();
- defaultViewModeLODLimit_1.Disable();
- defaultViewModeLODLimit_2.Disable();
- defaultViewModeLODLimit_3.Disable();
- defaultViewModeLODLimit_4.Disable();
+ defaultViewModeLodLimit.Disable();
+ defaultViewModeLodLimit_1.Disable();
+ defaultViewModeLodLimit_2.Disable();
+ defaultViewModeLodLimit_3.Disable();
+ defaultViewModeLodLimit_4.Disable();
}
private Patch defaultCharaCreatorParam;
@@ -2683,21 +2683,21 @@ namespace WorldTuningTool
// Gameplay.
addr = PatternScanner.FindFirst(Pattern.FromString("80 BB 34 EC 00 00 00 88 8B 31 EC 00 00 C6 83 30 EC 00 00 00 74 1C C6 83 34 EC 00 00 00 48 8B 0D 68 4B 4F 03 80 B9 58 02 00 00 00 75 05 E8 5A F5 01 00 48 8B CB E8 E2 05 00 00 83 BB DC EB 00 00 06 74 0A C7 83 DC EB 00 00 06 00 00 00"));
Assert(addr == 0x141B1A0B4);
- defaultViewModeLODLimit = new Patch(addr + 0x40, [0x07, 0x74, 0x0A, 0xC7, 0x83, 0xDC, 0xEB, 0x00, 0x00, 0x07]);
+ defaultViewModeLodLimit = new Patch(addr + 0x40, [0x07, 0x74, 0x0A, 0xC7, 0x83, 0xDC, 0xEB, 0x00, 0x00, 0x07]);
// In room.
addr = PatternScanner.FindFirst(Pattern.FromString("8B 9F CC 00 00 00 81 FB F9 01 00 00 74 0C 8B CB E8 95 3F 65 01 83 F8 05 75 11 48 8B 0D 61 C8 F6 04 BA 02 00 00 00 E8 DF 2D 8C 01 48 8B 0D A0 C7 F6 04 8B D3"));
Assert(addr == 0x140257AE6);
- defaultViewModeLODLimit_1 = new Patch(addr + 0x22, [0x07]);
+ defaultViewModeLodLimit_1 = new Patch(addr + 0x22, [0x07]);
// Forging/Changing Equipment.
addr = PatternScanner.FindFirst(Pattern.FromString("BA 02 00 00 00 E8 6E C0 80 00 48 8B 74 24 38 48 8B 57 28 48 8D 4F 30 E8 4C 79 B4 FE 48 8B 0D 0D FF A6 03 BA 04 00 00 00 E8 8B 64 3C 00 48 8B 05 D4 01 A7 03 80 B8 FD 46 01 00 00"));
Assert(addr == 0x141754438);
- defaultViewModeLODLimit_2 = new Patch(addr + 0x24, [0x07]);
+ defaultViewModeLodLimit_2 = new Patch(addr + 0x24, [0x07]);
// Talking to NPC.
- defaultViewModeLODLimit_3 = new Patch((nint)0x14128F1AC + 0x1, [0x07]);
- defaultViewModeLODLimit_4 = new Patch((nint)0x14128F1AC + 0xF, [0x07]);
+ defaultViewModeLodLimit_3 = new Patch((nint)0x14128F1AC + 0x1, [0x07]);
+ defaultViewModeLodLimit_4 = new Patch((nint)0x14128F1AC + 0xF, [0x07]);
defaultCharaCreatorParam = new Patch((nint)0x141B1A0C1 + 0x6, [0x1]);
@@ -2861,10 +2861,10 @@ namespace WorldTuningTool
{
value2ForVolumeQuality.Enable();
}
- disableLODLimits = patches.DisableLODLimits;
- if (disableLODLimits)
+ disableLodLimits = patches.DisableLODLimits;
+ if (disableLodLimits)
{
- disableLODLimitsEnable();
+ disableLodLimitsEnable();
}
charaCreatorFace = patches.CharacterCreatorFaceRendering;
if (charaCreatorFace)
@@ -2881,6 +2881,12 @@ namespace WorldTuningTool
{
zeroFrameSkip.Enable();
}
+ viewModeLodOverride = patches.OverrideViewModeLODs;
+ if (viewModeLodOverride)
+ {
+ viewModeAddressLod1.Enable();
+ viewModeAddressLod2.Enable();
+ }
}
public void OnLoad()
@@ -4254,17 +4260,17 @@ namespace WorldTuningTool
ImGui.EndTooltip();
}
- if (ImGui.Checkbox("Disable Player/Palico/NPC LOD Limit in Gameplay", ref disableLODLimits))
+ if (ImGui.Checkbox("Disable Player/Palico/NPC LOD Limit in Gameplay", ref disableLodLimits))
{
- if (disableLODLimits)
+ if (disableLodLimits)
{
- disableLODLimitsEnable();
+ disableLodLimitsEnable();
}
else
{
- disableLODLimitsDisable();
+ disableLodLimitsDisable();
}
- patches.DisableLODLimits = disableLODLimits;
+ patches.DisableLODLimits = disableLodLimits;
config.Patches = patches;
saveConfig(config);
}
@@ -4341,10 +4347,13 @@ namespace WorldTuningTool
viewModeAddressLod1.Disable();
viewModeAddressLod2.Disable();
}
+ patches.OverrideViewModeLODs = viewModeLodOverride;
+ config.Patches = patches;
+ saveConfig(config);
}
if (ImGui.BeginItemTooltip())
{
- ImGui.Text("View Mode still won't consider LOD Length/Pixel Size Bias.");
+ ImGui.Text("View Mode won't consider LOD Length/Pixel Size Bias when Bias 1/2 are 0.");
ImGui.EndTooltip();
}
}