hide ResetConfirmation config menu

I couldn't easily implement a reset button since I can't control the config UI from Core.
This commit is contained in:
James Seibel
2023-06-11 18:25:19 -05:00
parent 531af72173
commit 5a33a4511b
2 changed files with 37 additions and 1 deletions
@@ -119,7 +119,7 @@ public class Config
public static ConfigCategory advanced = new ConfigCategory.Builder().set(Advanced.class).build();
public static ConfigCategory resetSettingsConfirmation = new ConfigCategory.Builder().set(ResetConfirmation.class).build();
// public static ConfigCategory resetSettingsConfirmation = new ConfigCategory.Builder().set(ResetConfirmation.class).build();
public static class Advanced
{
@@ -0,0 +1,36 @@
package com.seibel.lod.core.config.eventHandlers;
import com.seibel.lod.api.DhApiMain;
import com.seibel.lod.api.enums.config.EHorizontalResolution;
import com.seibel.lod.api.enums.config.EVerticalQuality;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.config.listeners.ConfigChangeListener;
import com.seibel.lod.core.config.listeners.IConfigListener;
import com.seibel.lod.core.util.DetailDistanceUtil;
public class ResetConfigEventHandler
{
public static ResetConfigEventHandler INSTANCE = new ResetConfigEventHandler();
public final ConfigChangeListener<Boolean> configChangeListener;
/** private since we only ever need one handler at a time */
private ResetConfigEventHandler()
{
this.configChangeListener = new ConfigChangeListener<>(Config.Client.ResetConfirmation.resetAllSettings, (resetSettings) -> { doStuff(resetSettings); });
}
private void doStuff(boolean resetSettings)
{
if (!resetSettings)
{
return;
}
Config.Client.ResetConfirmation.resetAllSettings.set(false);
}
}