File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
mod/src/main/kotlin/gg/skytils/skytilsmod/core/structure/v2 Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import gg.essential.elementa.layoutdsl.*
2424import gg.essential.elementa.state.v2.MutableState
2525import gg.essential.elementa.state.v2.memo
2626import gg.essential.elementa.state.v2.mutableStateOf
27+ import gg.essential.elementa.state.v2.stateOf
2728import gg.essential.elementa.utils.withAlpha
2829import gg.essential.universal.UResolution
2930import gg.skytils.skytilsmod.core.GuiManager
@@ -67,10 +68,16 @@ abstract class HudElement(
6768 }.then(mouseConstraint)
6869 }
6970
71+ open val toggleState = stateOf(true )
72+
7073 val component
7174 get() = UIContainer ()
7275 .apply {
73- layout(Modifier .then(position).childBasedSize(2f )) { render() }
76+ layout(Modifier .then(position).childBasedSize(2f )) {
77+ if_(toggleState) {
78+ render()
79+ }
80+ }
7481 }
7582
7683 val demoComponent
@@ -82,8 +89,11 @@ abstract class HudElement(
8289 .childBasedSize(2f )
8390 .hoverScope()
8491 .hoverColor(Color .WHITE .withAlpha(100 ))
85- , block = { demoRender() }
86- )
92+ ) {
93+ if_(toggleState) {
94+ demoRender()
95+ }
96+ }
8797 }
8898
8999
You can’t perform that action at this time.
0 commit comments