Thread Tools Display Modes
05-25-24, 10:30 AM   #1
savo
A Defias Bandit
AddOn Author - Click to view addons
Join Date: May 2024
Posts: 2
Trying to Hide/Disable fields in bindings.xml via lua

hey, i wanna preface this with that i'm very new to lua.
Link to code: https://www.wowinterface.com/downloa...nds.html#other

i'm creating an addon that adds common macros as additional bindings in the default keybinds menu, like "/stopcast + /stopattack" for same keybind, "/cast [@focus] shadowstep" etc..

My issue is that the list of additional fields added to the keybindings menu became flooded, and starts to lag the menu when i added macros for every class, so what i'm trying to do is only display whichever class the player is currently playing and hide macros for other classes.

So basically i have 1000 lines of <binding> tags inside bindings.xml, they are grouped to the specific class. Since it's XML im wondering how i go about hiding or disabling them via lua.
I only know of how to change name/header: "BINDING_NAME_" and "BINDING_HEADER_".

any help appreciated
  Reply With Quote
05-25-24, 01:57 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,966
I doubt you will be able to hide them, as the bindings.xml file is not listed in your toc file, so Blizzard is doing something in the background. All we have to do is have a global (if I remember rightly ) variable that equates to the values in the bindings file.

I've personally only recently figured out how to use it myself, and I could only get rid of them by removing them from the Bindings.xml file.

Maybe there is someone out there more knowledgable in this area that can confirm one way or another.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-26-24, 02:41 AM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,336
For dynamically creating keybinds, you need to use the SetBinding* functions.

Here's an additional link you may be interested in.
https://warcraft.wiki.gg/wiki/Creati...indings_in_Lua
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
05-26-24, 05:02 AM   #4
savo
A Defias Bandit
AddOn Author - Click to view addons
Join Date: May 2024
Posts: 2
Originally Posted by SDPhantom View Post
For dynamically creating keybinds, you need to use the SetBinding* functions.

Here's an additional link you may be interested in.
https://warcraft.wiki.gg/wiki/Creati...indings_in_Lua
The reason i'm creating the addon the way i am is because they register on KeyDown as opposed to the SetBinding functions, which only triggers on KeyUp.

Also i would really prefer to use default Key Bindings UI as im not really experienced enough to build my own UI to set it up.


I did manage to figure out a workaround that im satisfied with by just changing the name of the category to "Additional Bindings - ClassName", which reduces the flood/amount of lines and should not overwhelm the player.

Thanks for the replies.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Trying to Hide/Disable fields in bindings.xml via lua


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