Thread Tools Display Modes
08/08/23, 02:23 AM   #1
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 186
Originally Posted by Baertram View Post
"what it already was to the opposite" or "Change" means:
if true, do no set it to false (or other values that might even fail to work at all then )
if false, do not set it to true (or other values that might even fail to work at all then )
OK, what I don't get yet is why do we have to set it to the same value if it is already set :

vanilla code is :
<Layer name="GamepadUIMode" allowFallthrough="false">

but I have to set this to allow using custom keybinds in menus with gamepad mode :
<Layer name="GamepadUIMode" allowFallthrough="false">
if I use this :
<Layer name="GamepadUIMode" >
then it doesn't work.

Is our XML totally overwriting the vanilla XML to the point we have to set all the variables that are in the tags again?

I think my problem is a misunderstanding of the XML and it's purpose...
Why this second language, in what cases I should use it over LUA...
  Reply With Quote
08/08/23, 07:05 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,048
Originally Posted by Masteroshi430 View Post
OK, what I don't get yet is why do we have to set it to the same value if it is already set :

...
Is our XML totally overwriting the vanilla XML to the point we have to set all the variables that are in the tags again?

As far as I know:
Yes. It's the same for lua and all other codes.
If someone defined some code (ZOs vanillla, or any other addon) but you need to change it again "later" you need to hook it, or overwrite it to add new code, or to change it somehow.
For lua you can prehook or posthook it to add your additional code.

For XML there is no such feature so if you define the same "name" you will overwrite existing XML code.
Normally this fails and says "Control already exists with same name" (if you were using a <Control> xml tag e.g.).
But for some xml tags like the <Bindings> <Layer> you will just redefine (if it exists in vanilla code, or another addon which was loaded before your's was loaded) the layer data then.
> This will overwrite the parts you did specify in your xml data then.

e.g. if you redefine
Code:
<Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
        <Category name="SI_KEYBINDINGS_CATEGORY_MOVEMENT">
            <Action name="MOVE_FORWARD">
It either fails and says not allowed as some of the keybinds are protected afaik.
Or it will overwrite the MOVE_FORWARD with your definition then.

And if you add a new one which didn't exist yet
Code:
<Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
        <Category name="SI_KEYBINDINGS_CATEGORY_MOVEMENT">
            <Action name="MOVE_BACKFLIPP">
You define the surrounding tags and attributes and create a new keybind possibility that way, which is named "MOVE_BACKFLIPP".
Nothing overwritten.

Why this second language, in what cases I should use it over LUA...
In the case of keybindings as you cannot define keybindings via lua only.
And in any other case where you feel it's more easy to create UI elements via XML instead of using lua do dynamically create the controls.
And in any case where you define virtual templates for lua controls in XML and just load them via lua functions then that accept virtual template names as parameters (as virtual templates cannot be created without XML, in lua, afaik).



In your example with "<Layer name="GamepadUIMode" allowFallthrough="false">"
It was defined with that attribute allowFallthrough="false" and if you redefine (overwrite) that row again by removing allowFallthrough="false" it will fail to work properly as this was not intended to work/is not supported. (no client crash and no error message, just silently fails).
Same if you change that to "true" -> client crash (maybe error message in the future).

I'm not sure if there is any list which atributes in the XML behave like that.
e.g. would it behave the same if it would haven been hideAction="true" in original definition and you overwrite it with hideAction="false" or just remove the hideAction attribute in total? I don't know but I think it would behave the same (hopefully except the "client crash" :-)).
Else you might be able to change the general idea/usage of those keybinds by just removing info like "do not allow to be pressed while dead" etc.

Last edited by Baertram : 08/08/23 at 07:41 AM.
  Reply With Quote
08/08/23, 12:49 PM   #3
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 183
Originally Posted by Masteroshi430 View Post
OK, what I don't get yet is why do we have to set it to the same value if it is already set :

vanilla code is :
<Layer name="GamepadUIMode" allowFallthrough="false">

but I have to set this to allow using custom keybinds in menus with gamepad mode :
<Layer name="GamepadUIMode" allowFallthrough="false">
if I use this :
<Layer name="GamepadUIMode" >
then it doesn't work.

Is our XML totally overwriting the vanilla XML to the point we have to set all the variables that are in the tags again?

I think my problem is a misunderstanding of the XML and it's purpose...
Why this second language, in what cases I should use it over LUA...
The default for allowFalthrough (if you don't specify it) is true. So by omitting it, that's the same as saying true. Meaning you're trying to change it from false to true, which is a no-no.
  Reply With Quote
08/08/23, 01:53 PM   #4
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 186
Originally Posted by ZOS_DanBatson View Post
The default for allowFalthrough (if you don't specify it) is true. So by omitting it, that's the same as saying true. Meaning you're trying to change it from false to true, which is a no-no.
Ah! That explains a lot! Thanks!
That is totally counter intuitive because in my mind a non-set bool is false, but here there is a default true value... Okay I'll keep that in mind.
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Update 39 (Version 9.1)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off