From 7d53f506ad066d331f69201ec0b8c733175e4d10 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Wed, 28 Oct 2026 00:51:16 -0400 Subject: Load overrides config earlier Signed-off-by: Andrew Opalach --- Plugin.cs | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'Plugin.cs') diff --git a/Plugin.cs b/Plugin.cs index 9c49249..95088a4 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -1310,7 +1310,10 @@ namespace WorldTuningTool } setBroadAreaShadowResolution(multiplier); currentShadowResMultiplier = multiplier; - setShadowQuality.Invoke(sMhScene!.Get(0x5530) + 1); + if (sMhScene != null) + { + setShadowQuality.Invoke(sMhScene.Get(0x5530) + 1); + } } private static void shadowResDisable() @@ -1862,7 +1865,7 @@ namespace WorldTuningTool public void OnPreMain() { Config config = getConfig(); - setSelection = new(config.Sets, "Set"); + disableLightsFeature = config.DisableLightsFeature; if (!disableLightsFeature) { @@ -1947,25 +1950,7 @@ namespace WorldTuningTool viewModeAddressLod1.Enable(); viewModeAddressLod2.Enable(); } - } - public void OnLoad() - { - sMhScene = SingletonManager.GetSingleton("sMhScene")!; - sMhMain = SingletonManager.GetSingleton("sMhMain")!; - sMhRender = SingletonManager.GetSingleton("sMhRender")!; - sMhGUI = SingletonManager.GetSingleton("sMhGUI")!; - sTime = SingletonManager.GetSingleton("sTime")!; - sQuest = SingletonManager.GetSingleton("sQuest")!; - sLightLinker = SingletonManager.GetSingleton("sLightLinker")!; - sLightProbes = SingletonManager.GetSingleton("sLightProbes")!; - sVolumeRenderer = SingletonManager.GetSingleton("sVolumeRenderer")!; - sMhSpeedTree = SingletonManager.GetSingleton("sMhSpeedTree")!; - foreach (Parameter param in sLightProbesParameters) - { - param.Update(sLightProbes!.Instance); - } - Config config = getConfig(); if (config.SelectedGlobal == "") { config.SelectedGlobal = "Base"; @@ -2007,7 +1992,24 @@ namespace WorldTuningTool break; } } + saveConfig(config); + + setSelection = new(config.Sets, "Set"); + } + + public void OnLoad() + { + sMhScene = SingletonManager.GetSingleton("sMhScene")!; + sMhMain = SingletonManager.GetSingleton("sMhMain")!; + sMhRender = SingletonManager.GetSingleton("sMhRender")!; + sMhGUI = SingletonManager.GetSingleton("sMhGUI")!; + sTime = SingletonManager.GetSingleton("sTime")!; + sQuest = SingletonManager.GetSingleton("sQuest")!; + sLightLinker = SingletonManager.GetSingleton("sLightLinker")!; + sLightProbes = SingletonManager.GetSingleton("sLightProbes")!; + sVolumeRenderer = SingletonManager.GetSingleton("sVolumeRenderer")!; + sMhSpeedTree = SingletonManager.GetSingleton("sMhSpeedTree")!; } // It's hard to test, but I'm pretty sure just updating stepTime isn't enough for a higher rate to look right. -- cgit v1.2.3-101-g0448