#button on stack panel to show/remove mods on hud

1 messages · Page 1 of 1 (latest)

barren stream
#

i want to make this compatible with global_variables.json so that you could have configurations to enable and disable certain mods so that when u load mc up every time, your mods that you have enabled and disabled get saved in global variables

mental storm
barren stream
#

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 🙂

mental storm
barren stream
#

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) ..

mental storm
#
{
        "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"
      }
    ]
}
barren stream
#

thank you 🙂

#

how could I show stuff in the toggle if visible is on

barren stream
#

ohhhh

#

sry

mental storm
#

If the toggle is on then my_elemtn will be visible else not

barren stream
#

OHHH

#

so "source" could be the element name?

mental storm
#

yeah in simple words you can say, it is just a name that toggle checks for in bindings

barren stream
#

ok

#

tysm!

barren stream
mental storm
#

yeah, these have to be on the same screen

mental storm
#

you just try and you'll know

barren stream
#

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

mental storm
#

yeah

#

make sure they are on same screen (hud)

barren stream
mental storm
#

means the toggle have to be on the same screen as speedo meter

barren stream
#

oh. wait so it's it not possible to display a mod menu with an enabled or disabled option for the speed meter?

mental storm
barren stream
#

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

mental storm
barren stream
#

oh

#

I had a file with mod_menu.json which contained the toggles code. those are separate.

#

so it won't work

mental storm
barren stream
#

but no it's not

mental storm
#

You just TRY and show what's happening

barren stream
#

ok

#

lol

#

thank you

sick jolt
sick jolt