package at.hannibal2.skyhanni.config import at.hannibal2.skyhanni.SkyHanniMod import io.github.moulberry.moulconfig.gui.GuiScreenElementWrapper import io.github.moulberry.moulconfig.gui.MoulConfigEditor object ConfigGuiManager { var editor: MoulConfigEditor? = null fun getEditorInstance() = editor ?: MoulConfigEditor(SkyHanniMod.configManager.processor).also { editor = it } fun openConfigGui(search: String? = null) { val editor = getEditorInstance() if (search != null) { editor.search(search) } SkyHanniMod.screenToOpen = GuiScreenElementWrapper(editor) } }