diff options
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.kt index a8190ca5b..94f609c6e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.kt @@ -18,7 +18,7 @@ class ConfigGuiForgeInterop : IModGuiFactory { override fun getHandlerFor(element: RuntimeOptionCategoryElement): RuntimeOptionGuiHandler? = null - class WrappedSkyHanniConfig(private val parent: GuiScreen) : GuiScreenElementWrapper(ConfigGuiManager.editor) { + class WrappedSkyHanniConfig(private val parent: GuiScreen) : GuiScreenElementWrapper(ConfigGuiManager.getEditorInstance()) { @Throws(IOException::class) override fun handleKeyboardInput() { if (Keyboard.getEventKeyState() && Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { @@ -28,4 +28,4 @@ class ConfigGuiForgeInterop : IModGuiFactory { super.handleKeyboardInput() } } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt index 9708c513b..f6bcd3bbc 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt @@ -8,11 +8,10 @@ object ConfigGuiManager { var editor: MoulConfigEditor<Features>? = null + fun getEditorInstance() = editor ?: MoulConfigEditor(SkyHanniMod.configManager.processor).also { editor = it } + fun openConfigGui(search: String? = null) { - if (editor == null) { - editor = MoulConfigEditor(SkyHanniMod.configManager.processor) - } - val editor = editor ?: return + val editor = getEditorInstance() if (search != null) { editor.search(search) |