diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/MoulConfigUtils.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/MoulConfigUtils.kt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/MoulConfigUtils.kt b/src/main/kotlin/moe/nea/firmament/util/MoulConfigUtils.kt new file mode 100644 index 0000000..bea3bc6 --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/util/MoulConfigUtils.kt @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe> + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package moe.nea.firmament.util + +import io.github.moulberry.moulconfig.common.MyResourceLocation +import io.github.moulberry.moulconfig.gui.GuiContext +import io.github.moulberry.moulconfig.xml.XMLUniverse + +object MoulConfigUtils { + val universe = XMLUniverse.getDefaultUniverse() + fun loadGui(name: String, bindTo: Any): GuiContext { + return GuiContext(universe.load(bindTo, MyResourceLocation("firmament", "gui/$name.xml"))) + } +} |