Bump MoulConfig
[no changelog]
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -27,3 +27,5 @@ gradle-app.setting
|
|||||||
|
|
||||||
# loom runClient
|
# loom runClient
|
||||||
/run/
|
/run/
|
||||||
|
*.xsd
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ hotswap_agent = "1.4.2-SNAPSHOT"
|
|||||||
mixinextras = "0.3.5"
|
mixinextras = "0.3.5"
|
||||||
jarvis = "1.1.1"
|
jarvis = "1.1.1"
|
||||||
nealisp = "1.0.0"
|
nealisp = "1.0.0"
|
||||||
moulconfig = "3.0.0-beta.5"
|
moulconfig = "3.0.0-beta.12"
|
||||||
manninghamMills = "2.4.1"
|
manninghamMills = "2.4.1"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import io.github.notenoughupdates.moulconfig.xml.ChildCount
|
|||||||
import io.github.notenoughupdates.moulconfig.xml.XMLContext
|
import io.github.notenoughupdates.moulconfig.xml.XMLContext
|
||||||
import io.github.notenoughupdates.moulconfig.xml.XMLGuiLoader
|
import io.github.notenoughupdates.moulconfig.xml.XMLGuiLoader
|
||||||
import io.github.notenoughupdates.moulconfig.xml.XMLUniverse
|
import io.github.notenoughupdates.moulconfig.xml.XMLUniverse
|
||||||
|
import io.github.notenoughupdates.moulconfig.xml.XSDGenerator
|
||||||
|
import java.io.File
|
||||||
import javax.xml.namespace.QName
|
import javax.xml.namespace.QName
|
||||||
import me.shedaniel.math.Color
|
import me.shedaniel.math.Color
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
@@ -38,7 +40,7 @@ object MoulConfigUtils {
|
|||||||
val color = uni.mapXMLObject(it, java.awt.Color::class.java)
|
val color = uni.mapXMLObject(it, java.awt.Color::class.java)
|
||||||
Color.ofRGBA(color.red, color.green, color.blue, color.alpha)
|
Color.ofRGBA(color.red, color.green, color.blue, color.alpha)
|
||||||
}
|
}
|
||||||
uni.registerLoader(object : XMLGuiLoader<BarComponent> {
|
uni.registerLoader(object : XMLGuiLoader.Basic<BarComponent> {
|
||||||
override fun getName(): QName {
|
override fun getName(): QName {
|
||||||
return QName(firmUrl, "Bar")
|
return QName(firmUrl, "Bar")
|
||||||
}
|
}
|
||||||
@@ -62,6 +64,28 @@ object MoulConfigUtils {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun generateXSD(
|
||||||
|
file: File,
|
||||||
|
namespace: String
|
||||||
|
) {
|
||||||
|
val generator = XSDGenerator(universe, namespace)
|
||||||
|
generator.writeAll()
|
||||||
|
generator.dumpToFile(file)
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun main(args: Array<out String>) {
|
||||||
|
generateXSD(File("MoulConfig.xsd"), XMLUniverse.MOULCONFIG_XML_NS)
|
||||||
|
generateXSD(File("MoulConfig.Firmament.xsd"), firmUrl)
|
||||||
|
File("wrapper.xsd").writeText("""
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<xs:import namespace="http://notenoughupdates.org/moulconfig" schemaLocation="MoulConfig.xsd"/>
|
||||||
|
<xs:import namespace="http://firmament.nea.moe/moulconfig" schemaLocation="MoulConfig.Firmament.xsd"/>
|
||||||
|
</xs:schema>
|
||||||
|
""".trimIndent())
|
||||||
|
}
|
||||||
|
|
||||||
fun loadGui(name: String, bindTo: Any): GuiContext {
|
fun loadGui(name: String, bindTo: Any): GuiContext {
|
||||||
return GuiContext(universe.load(bindTo, MyResourceLocation("firmament", "gui/$name.xml")))
|
return GuiContext(universe.load(bindTo, MyResourceLocation("firmament", "gui/$name.xml")))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
|
|||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Root xmlns="http://notenoughupdates.org/moulconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<Root xmlns="http://notenoughupdates.org/moulconfig"
|
||||||
xsi:schemaLocation="http://notenoughupdates.org/moulconfig https://raw.githubusercontent.com/NotEnoughUpdates/MoulConfig/master/MoulConfig.xsd"
|
|
||||||
xmlns:firm="http://firmament.nea.moe/moulconfig"
|
xmlns:firm="http://firmament.nea.moe/moulconfig"
|
||||||
>
|
>
|
||||||
<Column>
|
<Column>
|
||||||
|
|||||||
Reference in New Issue
Block a user