Implement the Quick enable render toggle

Also improve the logic for setting UI only config values
This commit is contained in:
James Seibel
2023-06-12 22:19:11 -05:00
parent 288459c88b
commit e0e6ac402e
2 changed files with 19 additions and 3 deletions
@@ -1,5 +1,8 @@
package com.seibel.lod.common.wrappers.gui;
import com.seibel.lod.core.config.eventHandlers.QuickRenderToggleConfigEventHandler;
import com.seibel.lod.core.config.eventHandlers.presets.RenderQualityPresetConfigEventHandler;
import com.seibel.lod.core.config.eventHandlers.presets.ThreadPresetConfigEventHandler;
import com.seibel.lod.coreapi.ModInfo;
import com.seibel.lod.core.config.ConfigBase;
import com.seibel.lod.core.config.gui.ConfigScreen;
@@ -24,8 +27,9 @@ public class GetConfigScreen
// Generate the language
// This shouldn't be here, but I need a way to test it after Minecraft inits its assets
//System.out.println(ConfigBase.INSTANCE.generateLang(false, true));
runGuiOnlyConfigSetup();
return switch (useScreen)
{
case Classic -> ClassicConfigGUI.getScreen(ConfigBase.INSTANCE, parent, "client");
@@ -35,4 +39,16 @@ public class GetConfigScreen
default -> null;
};
}
/**
* Updates any config values that are UI only
* and adds any listeners that depend on multiple config values.
*/
private static void runGuiOnlyConfigSetup()
{
ThreadPresetConfigEventHandler.INSTANCE.setUiOnlyConfigValues();
RenderQualityPresetConfigEventHandler.INSTANCE.setUiOnlyConfigValues();
QuickRenderToggleConfigEventHandler.INSTANCE.setUiOnlyConfigValues();
}
}