From 4e9d0f4861e9c67792aa6c86e2893bde48667b5b Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 21 Jul 2024 16:13:55 -0500 Subject: [PATCH] Fix ConfigEntry String value saving --- .../common/wrappers/gui/ClassicConfigGUI.java | 17 ++++++++++------- coreSubProjects | 2 +- 2 files changed, 11 insertions(+), 8 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 f3543fba2..2ca6c27a0 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 @@ -158,19 +158,22 @@ public class ClassicConfigGUI // button.active = entries.stream().allMatch(e -> e.inLimits); - if (((ConfigEntry) info).isValid(value) == 0 && info.getType() != List.class) + if (info.getType() == String.class + || info.getType() == List.class) + { + ((ConfigEntry) info).uiSetWithoutSaving(stringValue); + } + else if (((ConfigEntry) info).isValid(value) == 0) { if (!cast) + { ((ConfigEntry) info).uiSetWithoutSaving(value); + } else + { ((ConfigEntry) info).uiSetWithoutSaving(value.intValue()); + } } -// else if (((ConfigEntry) info).isValidMemoryAddress() == 0) -// { -// if (((List) info.get()).size() == ((EntryInfo) info.guiValue).index) -// 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; }; diff --git a/coreSubProjects b/coreSubProjects index 568ff40df..44fe1eafb 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 568ff40df6d346c4d5418c7d11217ff94aed1072 +Subproject commit 44fe1eafb148191f0e5737f59dae7507cc6ed496