#new to Json Ui can someone explain theese errors

1 messages · Page 1 of 1 (latest)

silver scroll
#
"hud_actionbar_text": {
    "type": "image",
    "size": [
      "100%c + 12px",
      "100%c + 5px"
    ],
    "offset": [
      0,
      "50%-68px"
    ],
    "texture": "textures/ui/hud_tip_text_background1",
    "alpha": 1,
    "controls": [
      {
        "actionbar_message": {
          "type": "label",
          "anchor_from": "center",
          "anchor_to": "center",
          "color": "$tool_tip_text",
          "layer": 31,
          "text": "$actionbar_text",
          "localize": true,
          "alpha": "@hud.anim_actionbar_text_alpha_out",
          "bindings": [
            {
              "binding_name": "$actionbar_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "($actionbar_text = 'ABF')",
              "target_property_name": "visible"
            }
          ]
        }
      }
    ]
  },
cinder eagle
#

first!

#

ez

#

okay

silver scroll
#

so what are bindings?

potent depot
silver scroll
#

i think bindings are for ediding hard coded varialbes

cinder eagle
potent depot
#

bindings don't work with variables, how hard you try

potent depot
#

I mean you can assign its value like : "$text": "#text" but nonthing else

silver scroll
potent depot
#

and much more

silver scroll
cinder eagle
#

like use it to get it

silver scroll
#

"bindings": [
{
"binding_name": "$actionbar_text"
}
],

#

like this?

potent depot
cinder eagle
#

i give up

#

everything i learned is being disproved

silver scroll
#

so now how is it supposed to change the texture

#

i just have to change this?
"texture": "textures/ui/hud_tip_text_background1",

potent depot
silver scroll
#

to something like if (condition) texture1 else texture2

silver scroll
potent depot
#

yeah

silver scroll
potent depot
silver scroll
silver scroll
potent depot
silver scroll
#

and then how does it choose the textuer

potent depot
#

theres are these operators u use inside variables array or in bindigns

#
{
  "element": {
    ...
    "$actionbar_text": "$atext",
    "text": "$text",
    "$text|default": "",
    "variables": {
      "requires": "($atext = 'hello')",
      "$text": "hello"
    }
  }
}
#

if actionbar is hello then it sets the text to hello

#

Again, I cannot explain everything. Just read the wiki and vanilla files

silver scroll
#

string1 - string2 = 'text' ?

potent depot
#

(not (($atext - 'hello') = $atext))

#

this statement is true if actionbar has hello in it

silver scroll
#

y i understand

#

game crashes 💀
"$atext": "$actionbar_text",
"variables": {
"$texture|default": "textures/ui/hud_tip_text_background1",
"requires": "(not (($atext - 'hello') = $atext))",
"$texture": "textures/ui/hud_tip_text_background",
"#texture": "$texture"
},

cinder eagle
silver scroll
cinder eagle
#

you will need only #texture and requires

river mortar
#

"#" is only for bindings and property bag

#

you can't use it in variables or variations

silver scroll
#

like why is json ui this complicated

#

it doesnt make sense

silver scroll
river mortar
#

and use compiler to make it work native

silver scroll
#

its like prefering old events instead of js custom components

river mortar
#

hm

#

is someone will use such thing?

silver scroll
#

what

river mortar
#

Json-UI in html by framework

cinder eagle
#

or am i trippin

silver scroll
#

oreui does work like this

river mortar
cinder eagle
silver scroll
#

"texture": "textures/ui/hud_tip_text_background",
"variables": {
"#texture": "textures/ui/hud_tip_text_background1",
"requires": "(not (($atext - 'hello') = $atext))"
},
is that right?

river mortar
cinder eagle
cinder eagle
river mortar
#

I have already thought about this concept, it should be better than regular Json-UI.

silver scroll
cinder eagle
#

it would be cool to see

#

if youre up to it sure

river mortar
cinder eagle
silver scroll
#

i wanted also to make that but then i rembembered that neither i do know json ui]

river mortar
river mortar
silver scroll
river mortar
#

Also I know how to optimize this thing in Json-UI

river mortar
silver scroll
silver scroll
silver scroll
patent topaz
#

I ran out of battery lol

patent topaz
patent topaz
silver scroll
patent topaz
#

😰

silver scroll
patent topaz
#

hope it works

#

just include §l§i§g§h§t in your text to enable light mode

silver scroll
#

Okk ty

paper cloak
cinder eagle
patent topaz
patent topaz
#

brownThe quick brown fox jumps over the lazy dog => The quick fox jumps over the lazy dog
now with §b§r§o§w§n
§b§r§o§w§n§rThe quick brown fox jumps over the lazy dog => The quick brown fox jumps over the lazy dog
(Also, there is no need to remove the prefix from the text, as §b§r§o§w§n is not displayed)

paper cloak
#

ty

paper cloak
#

the element that the offset its working on is mines_image

patent topaz
#

not possible

#

but youre using panel -> image

#

just set the offset in the image

paper cloak
patent topaz
#
    "mines_image": {
        "type": "panel",
        "size": ["20%","100%"],
        "anchor_from" : "center",
        "anchor_to" : "center",
        "controls": [
            {
                "image": {
                    "type":"image",
                    "texture":"textures/ui/mines",
                    "offset": [ 10, -20 ],
                    "size": ["100%","100%"]
                }
            }
        ]
    }
#

just like that

paper cloak
#

ty