From 1ac1b7ee2df55e3a51d97d4b223ba4684c879635 Mon Sep 17 00:00:00 2001 From: coolGi Date: Sun, 20 Aug 2023 02:36:48 +0930 Subject: [PATCH] Fixed ui modify, and made file handeler use its own set function --- .../common/wrappers/gui/ClassicConfigGUI.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java index 5e3129c60..cd0b35ab2 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java @@ -161,15 +161,15 @@ public class ClassicConfigGUI if (((ConfigEntry) info).isValid(value) == 0 && info.getType() != List.class) { if (!cast) - ((ConfigEntry) info).setWithoutSaving(value); + ((ConfigEntry) info).uiSetWithoutSaving(value); else - ((ConfigEntry) info).setWithoutSaving(value.intValue()); + ((ConfigEntry) info).uiSetWithoutSaving(value.intValue()); } // else if (((ConfigEntry) info).isValidMemoryAddress() == 0) // { // if (((List) info.get()).size() == ((EntryInfo) info.guiValue).index) -// info.set(((List) info.get()).add("")); -// info.set(((List) info.get()).set(((EntryInfo) info.guiValue).index, Arrays.stream(((EntryInfo) info.guiValue).tempValue.replace("[", "").replace("]", "").split(", ")).collect(Collectors.toList()).get(0))); +// info.uiSet(((List) info.get()).add("")); +// info.uiSet(((List) info.get()).set(((EntryInfo) info.guiValue).index, Arrays.stream(((EntryInfo) info.guiValue).tempValue.replace("[", "").replace("]", "").split(", ")).collect(Collectors.toList()).get(0))); // } return true; @@ -309,7 +309,7 @@ public class ClassicConfigGUI if (ConfigEntry.class.isAssignableFrom(info.getClass())) { Button.OnPress btnAction = button -> { - ((ConfigEntry) info).setWithoutSaving(((ConfigEntry) info).getDefaultValue()); + ((ConfigEntry) info).uiSetWithoutSaving(((ConfigEntry) info).getDefaultValue()); ((EntryInfo) info.guiValue).index = 0; this.reload = true; Objects.requireNonNull(minecraft).setScreen(this); @@ -463,7 +463,7 @@ public class ClassicConfigGUI Function func = value -> TextOrTranslatable((Boolean) value ? "True" : "False").withStyle((Boolean) value ? ChatFormatting.GREEN : ChatFormatting.RED); ((EntryInfo) info.guiValue).widget = new AbstractMap.SimpleEntry>(button -> { - ((ConfigEntry) info).setWithoutSaving(!(Boolean) info.get()); + ((ConfigEntry) info).uiSetWithoutSaving(!(Boolean) info.get()); button.setMessage(func.apply(info.get())); }, func); } @@ -503,7 +503,7 @@ public class ClassicConfigGUI } - info.set(enumValue); + ((ConfigEntry>) info).uiSetWithoutSaving(enumValue); button.setMessage(func.apply(info.get())); }, func); }