feat: moulconfig beta v4
This commit is contained in:
@@ -71,7 +71,7 @@ jarvis = "1.1.4"
|
|||||||
nealisp = "1.1.0"
|
nealisp = "1.1.0"
|
||||||
|
|
||||||
# Update from https://github.com/NotEnoughUpdates/MoulConfig/tags
|
# Update from https://github.com/NotEnoughUpdates/MoulConfig/tags
|
||||||
moulconfig = "3.11.0"
|
moulconfig = "4.0.0-beta"
|
||||||
|
|
||||||
# Update from https://repo.nea.moe/#/releases/moe/nea/mc-auto-translations/moe.nea.mc-auto-translations.gradle.plugin
|
# Update from https://repo.nea.moe/#/releases/moe/nea/mc-auto-translations/moe.nea.mc-auto-translations.gradle.plugin
|
||||||
mcAutoTranslations = "0.3.0"
|
mcAutoTranslations = "0.3.0"
|
||||||
|
|||||||
@@ -113,11 +113,3 @@ class BarComponent(
|
|||||||
fun Identifier.toMoulConfig(): MyResourceLocation {
|
fun Identifier.toMoulConfig(): MyResourceLocation {
|
||||||
return MyResourceLocation(this.namespace, this.path)
|
return MyResourceLocation(this.namespace, this.path)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun RenderContext.color(color: Color) {
|
|
||||||
color(color.red, color.green, color.blue, color.alpha)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun RenderContext.color(red: Int, green: Int, blue: Int, alpha: Int) {
|
|
||||||
color(red / 255f, green / 255f, blue / 255f, alpha / 255f)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ open class FirmButtonComponent(
|
|||||||
getBackground(context),
|
getBackground(context),
|
||||||
0f, 0f, context.width, context.height
|
0f, 0f, context.width, context.height
|
||||||
)
|
)
|
||||||
context.renderContext.translate(insets.toFloat(), insets.toFloat(), 0f)
|
context.renderContext.translate(insets.toFloat(), insets.toFloat())
|
||||||
element.render(getChildContext(context))
|
element.render(getChildContext(context))
|
||||||
context.renderContext.popMatrix()
|
context.renderContext.popMatrix()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class FirmHoverComponent(
|
|||||||
|
|
||||||
override fun render(context: GuiImmediateContext) {
|
override fun render(context: GuiImmediateContext) {
|
||||||
if (context.isHovered && (permaHover || lastMouseMove.passedTime() > hoverDelay)) {
|
if (context.isHovered && (permaHover || lastMouseMove.passedTime() > hoverDelay)) {
|
||||||
context.renderContext.scheduleDrawTooltip(hoverLines.get())
|
context.renderContext.scheduleDrawTooltip(context.mouseX, context.mouseY, hoverLines.get())
|
||||||
permaHover = true
|
permaHover = true
|
||||||
} else {
|
} else {
|
||||||
permaHover = false
|
permaHover = false
|
||||||
|
|||||||
@@ -23,11 +23,13 @@ class ImageComponent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun render(context: GuiImmediateContext) {
|
override fun render(context: GuiImmediateContext) {
|
||||||
context.renderContext.bindTexture(resourceLocation.get())
|
context.renderContext.drawComplexTexture(
|
||||||
context.renderContext.drawTexturedRect(
|
resourceLocation.get(),
|
||||||
0f, 0f,
|
0f, 0f,
|
||||||
context.width.toFloat(), context.height.toFloat(),
|
context.width.toFloat(), context.height.toFloat(),
|
||||||
u1, v1, u2, v2
|
{
|
||||||
|
it.uv(u1, v1, u2, v2)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class MoulConfigFragment(
|
|||||||
m.translate(position.x.toFloat(), position.y.toFloat(), 0F)
|
m.translate(position.x.toFloat(), position.y.toFloat(), 0F)
|
||||||
context.root.render(ctx)
|
context.root.render(ctx)
|
||||||
m.pop()
|
m.pop()
|
||||||
ctx.renderContext.doDrawTooltip()
|
ctx.renderContext.renderExtraLayers()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
|
|||||||
Reference in New Issue
Block a user