blob: ffb3b7256bfc4d325cbe7a6d512478846a0b9465 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package at.hannibal2.skyhanni.config
import at.hannibal2.skyhanni.SkyHanniMod
import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper
import io.github.notenoughupdates.moulconfig.gui.MoulConfigEditor
object ConfigGuiManager {
var editor: MoulConfigEditor<Features>? = 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)
}
}
|