Thread Tools Display Modes
05-14-24, 10:05 AM   #1
teakaek
A Murloc Raider
Join Date: May 2024
Posts: 4
Having trouble with showing/hiding action bars.

Hi all, apologies if this is ground that's been covered before but I'm new to writing addons and haven't been able to find the answer to this in the API references.

All I want to do is, from an addon, flip the checkboxes in the action bar section of the options. So just enable all 8 bars on startup if they aren't enabled. This feels like a really simple thing to want to do but I can't find the info anywhere!

Thanks in advance!
  Reply With Quote
05-14-24, 03:55 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,961
There are a set of cvar values you can use to set the values once they are loaded in or whenever the user changes them to the other option ( if you don't want them to )

I played with them once but I must have removed the code as it doesn't seem to be in my code anymore.

If you have an addon coded up to watch events, you can try registering for https://warcraft.wiki.gg/wiki/CVAR_UPDATE . You can then use https://warcraft.wiki.gg/wiki/API_C_CVar.GetCVarInfo to retrieve the name and current value amongst others.

You can use that to test for the name of the changed setting when you check and uncheck the box. Then use that name to specifically set the value using https://warcraft.wiki.gg/wiki/API_C_CVar.SetCVar.

If you haven't created an addon yet, this page gives you an example that has an event watcher set up.
https://warcraft.wiki.gg/wiki/Create..._in_15_Minutes


Give that a go as a learning curve. But feel free to shout out if you start hitting problems.
__________________


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-15-24, 02:14 AM   #3
teakaek
A Murloc Raider
Join Date: May 2024
Posts: 4
Thanks a lot for the pointers, will take a look at it today!
  Reply With Quote
05-15-24, 03:18 AM   #4
teakaek
A Murloc Raider
Join Date: May 2024
Posts: 4
I have my addon now setup listening for the CVAR UPDATE events, and correctly printing the values for other cvar changes. However, no CVAR seems to update when I toggle those bars.
  Reply With Quote
05-15-24, 07:45 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,961
Hmm there should be..

Let me check.

edit: You're right. They must have changed something there since I looked at it. Or maybe it didn't and I did what I am doing now to get the names.

Aha .. it was still in my code.

elseif event == "SETTINGS_LOADED" then
-- Dragonflight - Make sure all secondary action bars are shown
--[[ Let the user choose to hide or show the extra bars
Settings.SetValue("PROXY_SHOW_ACTIONBAR_2", false);
Settings.SetValue("PROXY_SHOW_ACTIONBAR_3", false);
Settings.SetValue("PROXY_SHOW_ACTIONBAR_4", false);
Settings.SetValue("PROXY_SHOW_ACTIONBAR_5", false);
Settings.SetValue("PROXY_SHOW_ACTIONBAR_6", false);
Settings.SetValue("PROXY_SHOW_ACTIONBAR_7", false);
Settings.SetValue("PROXY_SHOW_ACTIONBAR_8", false);
--]]

I found those codes from their file : https://github.com/Gethe/wow-ui-sour...rrides.lua#L28
__________________


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

Last edited by Xrystal : 05-15-24 at 07:52 AM.
  Reply With Quote
05-15-24, 08:29 AM   #6
teakaek
A Murloc Raider
Join Date: May 2024
Posts: 4
Hero! Thank you!

Am I right in saying that the various wow API references that are out there are incomplete/out of date?

Is the best way to figure things out by cribbing from other addons/blizzards addons?
  Reply With Quote
05-15-24, 10:40 AM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,961
https://warcraft.wiki.gg/wiki/Warcraft_Wiki is a good place to go for the new up to date information.

https://github.com/Gethe/wow-ui-source is a good place to see how Blizzard is doing stuff and to find names of things like frames etc.

Both are kept up to date by regular people but may be delayed in being updated. But, you can always download your own copy of the blizzard source if you need to via instructions at https://warcraft.wiki.gg/wiki/Viewin...interface_code if you haven't done that before or need a reminder.


Checking other peoples addons or Blizzard files are a good way to learn. Other addons being slightly better as they will share the same access limitations you will whereas Blizzard will have full access.
__________________


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

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Having trouble with showing/hiding action bars.

Thread Tools
Display Modes

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