#custom buttons in server form(variables not work)

1 messages · Page 1 of 1 (latest)

stiff walrus
#

Help please

       "form_button@common_buttons.light_text_button": {
          "$pressed_button_name": "button.form_button_click",
          "anchor_from": "center",
          "anchor_to": "center",
          "size":[ 32, 32 ],
          "offset":"$offset",
          "$offset|default":[0,0],
          "$button_text": "#form_button_text",
          "$button_text_binding_type": "collection",
          "$button_text_grid_collection_name": "form_buttons",
          "$button_text_max_size": [ "100%", 20 ],
          "variables":[
{
"requires":"(#form_button_text = 'btn1')",
"$offset":[0,0]
},
{
"requires":"(#form_button_text = 'btn2')",
"$offset":[32,0]
}
],
          "bindings": [
            {
              "binding_type": "collection_details",
              "binding_collection_name": "form_buttons"
            }
          ]
        }
slim granite
#

You cannot use bindings in variables array

stiff walrus
#

Is there another way?

slim granite
#

using bindings

#

search in #old-json-ui

stiff walrus
#

/: glitch

#
       "button1@common_buttons.light_text_button": {
          "$pressed_button_name": "button.form_button_click",
          "anchor_from": "top_right",
          "anchor_to": "top_right",
          "size":[ 32, 32 ],
          "$button_text": "#form_button_text",
          "$button_text_binding_type": "collection",
          "$button_text_grid_collection_name": "form_buttons",
          "$button_text_max_size": [ "100%", 20 ],
          "bindings": [
            {
      "binding_name": "(#form_button_text = 'btn1')",
      "binding_type": "collection_details",
      "binding_collection_name": "form_buttons",
      "binding_name_override": "#visible"
            }
          ]
        }
      },
      {
       "button2@common_buttons.light_text_button": {
          "$pressed_button_name": "button.form_button_click",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "size":[ 32, 32 ],
          "$button_text": "#form_button_text",
          "$button_text_binding_type": "collection",
          "$button_text_grid_collection_name": "form_buttons",
          "$button_text_max_size": [ "100%", 20 ],
          "bindings": [
            {
      "binding_name": "(#form_button_text = 'btn2')",
      "binding_type": "collection_details",
      "binding_collection_name": "form_buttons",
      "binding_name_override": "#visible"
stiff walrus
#

How I Can fix that?

molten jasper
slim granite
#

?question