Thread Tools Display Modes
10-28-14, 02:11 AM   #1
Iezabel
A Deviate Faerie Dragon
 
Iezabel's Avatar
Join Date: Oct 2014
Posts: 10
Kgpanels Woes

Alright, so what I am trying to do is have Bartender's Bar 6 show when I click and then hide when not clicked.
Problem is my code doesn't seem to like me very much. This is what I am working with:
Code:
if pressed then
if BT4Bar6:IsVisible() then
Bartender4.Bar.barregistry["10"]:SetVisibilityOption("always",true)
else
Bartender4.Bar.barregistry["10"]:SetVisibilityOption("always",false)
end
end
Any help would be much appreciated
  Reply With Quote
10-28-14, 02:37 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Can you be more specific about what your code is doing vs. what you expect it to do?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-28-14, 09:50 AM   #3
Iezabel
A Deviate Faerie Dragon
 
Iezabel's Avatar
Join Date: Oct 2014
Posts: 10
My code for whatever reason is doing nothing, kgpanels won't even allow me to hit accept on it.

What I am trying to do is have when a button is activated it brings the Bartender Action Bar out. I saw this done in MayronUI Gen4.
  Reply With Quote
10-28-14, 10:02 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Where is "pressed " comming from and what is it set too when you click? I don't know KgPanels but how do you detect "not clicked"?
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-28-14, 10:10 AM   #5
Iezabel
A Deviate Faerie Dragon
 
Iezabel's Avatar
Join Date: Oct 2014
Posts: 10
Originally Posted by Fizzlemizz View Post
Where is "pressed " comming from and what is it set too when you click? I don't know KgPanels but how do you detect "not clicked"?
The "pressed" is coming from the script on Kgpanels wowace page.

Code:
if pressed then
  -- do mouse down actions
elseif released then
  -- do mouse up actions
end
  Reply With Quote
10-28-14, 10:19 AM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
So you wnat to hold the mouse down to show the bar and when you release the mouse, hide the bar again?

Your code is missing the

Code:
elseif released then
Assuming the WoWAce code is correct then:

Code:
if pressed then
	Bartender4.Bar.barregistry["10"]:SetVisibilityOption("always",true)
elseif released then
	Bartender4.Bar.barregistry["10"]:SetVisibilityOption("always",false)
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-28-14 at 10:22 AM.
  Reply With Quote
10-28-14, 10:30 AM   #7
Iezabel
A Deviate Faerie Dragon
 
Iezabel's Avatar
Join Date: Oct 2014
Posts: 10
I'll check it as soon as the game is back up.
Will that work for Action Bar 6?
  Reply With Quote
10-28-14, 10:32 AM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Originally Posted by Iezabel View Post
I'll check it as soon as the game is back up.
Will that work for Action Bar 6?
If it works for one it should work for the others but like KgPanels I don't know Bartender.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-28-14, 02:05 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Actually, if your goal is to have the bar shown only while the mouse button is held down, that won't work in combat, because action buttons are secure frames, and cannot be shown/hidden in combat through insecure means like a kgPanels script.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-28-14, 02:47 PM   #10
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
I was scratching my head over the whole thing because the only use for this action I can think of is to see a keybinding.

If you know what key it is you don't need to see the bar and if it gets hidden when you release the mouse button you can't click on it.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-28-14, 06:01 PM   #11
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
When I first read the post I thought he wanted a click toggle -- click once to show the bar, click again to hide the bar -- which would make more sense, but still wouldn't work in combat from kgPanels because it doesn't use a real OnClick script, and the OnMouseDown/OnMouseUp scripts it does use don't count as "hardware events" for the purpose of performing secure actions.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-28-14, 06:54 PM   #12
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
I suspect you know more about KgPanels than I do .

Would it need a secure button click or an any old button click as in Dart? Not plugging, just wondering.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-28-14, 07:00 PM   #13
Iezabel
A Deviate Faerie Dragon
 
Iezabel's Avatar
Join Date: Oct 2014
Posts: 10
Still no luck getting this to work. Even with the new code provided.
  Reply With Quote
10-29-14, 09:44 PM   #14
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Fizzlemizz View Post
Would it need a secure button click or an any old button click as in Dart? Not plugging, just wondering.
Hiding/showing secure frames arbitrarily (eg. not in response to an allowed event) requires a secure codepath, so you couldn't do it from any old button's OnClick script either, but many other actions only require a hardware event. See here for some lists of protected vs. secure actions.

Originally Posted by Iezabel View Post
Still no luck getting this to work. Even with the new code provided.
Check your other visibility settings in Bartender for Bar 10. The commands you're using did not work for me on Bar 1 because I have other visibility settings that override the "Always" checkbox, but after I enabled another bar with default visibility settings, they did work on that bar.

You can try running the commands from the chat frame to verify that they will work with your settings, eg.

Code:
/run Bartender4.Bar.barregistry["10"]:SetVisibilityOption("always",false)
Finally, keep in mind that it's not possible to change the visibility of an action bar from a kgPanels script while you're in combat, and attempting to do so will trigger an error message. You should add this to the top of your script:

Code:
if InCombatLockdown() then return end
... or just set your panel to be hidden in combat if that's an option (I don't personally use kgPanels).
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-29-14, 09:53 PM   #15
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Thank you Phanx for the information and link, it is greatly appreciated.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Kgpanels Woes


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