#button on stack panel to show/remove mods on hud
1 messages · Page 1 of 1 (latest)
not possible to my knowledge
possible. just ignore it when you dont want it to enable
yeah
but for the actual toggles, idk how I could display something when checked. conditional rendering with variables maybe?
thank you for that, cuz I'm trying to make saveable settings 🙂
you check for #toggle_state on the element and if the toggle is in toggle state make it visible else false
i COULD use conditional rendering with variables, as that would let me get saveable settings, but I don't know how to load the actual hud stuff I want to add. ex: (not $speedometer_enabled) ..
oh yeah
{
"toggle@common_toggles.light_text_toggle": {
"$toggle_name": "whatever",
"$button_text": "A",
"$toggle_view_binding_name": "source", // this is imp
"anchor_from": "bottom_right",
"anchor_to": "bottom_right",
"size": [18, 18]
}
}```vanilla files have toggles for you that work
"my_elemtn": {
"type": "panel",
"bindings": [
{
"binding_type": "view",
"source_control_name": "source", // toggle view binding name
"source_property_name": "#toggle_state",
"target_property_name": "#visible"
}
]
}
If the toggle is on then my_elemtn will be visible else not
yeah in simple words you can say, it is just a name that toggle checks for in bindings
so source could be any name, and then it looks for the same name, and "links" them? if you were to display elemnt on the hud, is that element in the hud file where the toggle is in the mod menu?
yeah, these have to be on the same screen
yes
you just try and you'll know
Ok so speedometer_renderer could be in the hud, have type custom, and could be linked to a diff file which contains the info for what shows when. speedometer_renderer does not have to have toggle code right?
I'll try it
Thanks
wdym
means the toggle have to be on the same screen as speedo meter
oh. wait so it's it not possible to display a mod menu with an enabled or disabled option for the speed meter?
only if the mod menu is on the same screen
The menu will have a button from the pause screen, which it will then open with the buttons. idk if that is one the same screen
on*
if you had put your mod menu code on pause_screen.json then it will not work
oh
I had a file with mod_menu.json which contained the toggles code. those are separate.
so it won't work
uh is your mod_menu.json linked to hud_screen?
I was thinking that I could code the toggles on the menu, so that when they are clicked, the things on the hud are shown. the actual hud elements could be linked with @ and they would have a type of "custom"
but no it's not
You just TRY and show what's happening
hey, i randomly found your code, what do this shows when it gets on?
Can the panel be image?
"my_elemtn": {
"type": "image",
"texture": "textures/items/apple",
"size": [200, 200],
"bindings": [
{
"binding_type": "view",
"source_control_name": "source", // toggle view binding name
"source_property_name": "#toggle_state",
"target_property_name": "#visible"
}
]
}