aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-03-25 03:02:33 +0100
committernea <nea@nea.moe>2023-03-26 16:37:00 +0200
commit2eae56fabfd8c43ad2b5decc96a840e741796082 (patch)
tree8a772952d673b08a466962f773efccf89b2364bf /src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
parentf82c30cbd7c191051aae239b9df06c2c2181c8d4 (diff)
downloadskyhanni-2eae56fabfd8c43ad2b5decc96a840e741796082.tar.gz
skyhanni-2eae56fabfd8c43ad2b5decc96a840e741796082.tar.bz2
skyhanni-2eae56fabfd8c43ad2b5decc96a840e741796082.zip
The non controversial config changes
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
index 90573542f..e3b040391 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
@@ -3,6 +3,9 @@ package at.hannibal2.skyhanni.config
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import com.google.gson.GsonBuilder
+import io.github.moulberry.moulconfig.processor.BuiltinMoulConfigGuis
+import io.github.moulberry.moulconfig.processor.ConfigProcessorDriver
+import io.github.moulberry.moulconfig.processor.MoulConfigProcessor
import java.io.*
import java.nio.charset.StandardCharsets
@@ -13,7 +16,7 @@ class ConfigManager {
var configDirectory = File("config/skyhanni")
private var configFile: File? = null
-
+ lateinit var processor: MoulConfigProcessor<Features>
fun firstLoad() {
try {
@@ -39,6 +42,16 @@ class ConfigManager {
SkyHanniMod.feature = Features()
saveConfig()
}
+
+ val features = SkyHanniMod.feature
+ processor = MoulConfigProcessor(SkyHanniMod.feature)
+ BuiltinMoulConfigGuis.addProcessors(processor)
+ ConfigProcessorDriver.processConfig(
+ features.javaClass,
+ features,
+ processor
+ )
+ SkyHanniMod.DEPENDENCIES
}
fun saveConfig() {