Thread Tools Display Modes
02-19-10, 09:08 AM   #1
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
kgPanels Help

Hi All,

I'm trying to set up a kgPanel to resize based on the class/stance bar. I've tried with both BT4 and Dominos using in the OnEvent script:

if not self.resized then
DominosClassBar:SetScript("OnSizeChanged", function(f)
self:SetWidth(f:GetWidth())
self:SetHeight(f:GetHeight())
end)
self:SetWidth(DominosClassBar:GetWidth())
self:SetHeight(DominosClassBar:GetHeight())
end
(above was last used for Dominos.)

And using on the OnLoad:

self.resized = false

and setting the script dependency to Dominos/Bartender4. Seems I'm having trouble getting the bar name correct. I can parent/anchor using Button Names, but won't resize.

Any help or suggestions would be greatly appreciated.
  Reply With Quote
02-19-10, 09:48 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Set your panel's parent and anchor to DominosClassBar. Set anchor to and from to CENTER.

Under height, put the height you want for your panel (height doesn't change with the class bar, only width). If the class bar was 100 x 40, for example, and you want an offset of 5 on each side for your panel... Your height would be 50 (40+5+5).

Since the width is what changes on your bar, this is what you need to be more creative about. A lot of people don't realize that kgPanels takes percentages for dimensions. I *think* that it even still does math on those percentages. So... Under width put "100% + 10" (without the quotes). If kgPanels happens to not want to do the math, then try something like 110%.


In short, scripts aren't always the answer.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-19-10, 10:58 AM   #3
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
Hi Seerah,

Thanks for the reply. Parenting/Anchoring to DominosClassBar isn't working (atleast for me). I can parent/anchor to the buttons tho i.e., DominosClassButton1.
  Reply With Quote
02-19-10, 11:56 AM   #4
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
I can't even get the names of the frames... was trying to help out, but move anything just fires an error if you try to get the parent name by mousing over it and looking what the nudger says, and the macro:
Code:
/script DEFAULT_CHAT_FRAME:AddMessage(GetMouseFocus():GetParent():GetName() );
doesn't respond with anything. one version of a script command i tried to do to get the name just said string expected, got table...

i'm guessing that your best bet if you want it to be easy at least is bartender, it's easy to get the name of the bar with bartender.... i'm guesssing this is part of the reason that so many ui compilations use Bartender (that along with the ease of the profiles in it).

another option would be to dig through the lua of Dominos to try to find the name, or send a message to the developer of Dominos, asking what the names are for the frames.

after looking through the lua, it seems that the parent for the button is Dominos.ClassBar, but i still haven't had any luck at all with getting anything to work on it, it doesn't throw errors though...


if you decide to go with bartender, the name of the bar is BT4BarStanceBar, and should work with any scripts you want to do.
in my experience, I prefer Dominos because of the normal vehicle bar, and the fact that you can keybind empty buttons... but it's generally not worth it because of so many flaws.... such as it doesn't seem to keybind properly, etc..... this is all seems to be caused by the way Dominos allows bars smaller than 12 buttons (not the fact that it does, but the way it's handled), it seems to start the next bar on the button you left off at, instead of starting it after that set of 12, regardless of whether you used 12 buttons on it or not. this also leads to a huge mess of button moving if you change your mind and want to add another button to bar 1. all that, in my opinion, makes Dominos not worth using (there's also virtually no (properly) functioning totem bar in dominos (in my opinion). i do prefer the way bars are edited and stored in Dominos though).

Last edited by Aerials : 02-19-10 at 12:06 PM.
  Reply With Quote
02-19-10, 11:59 AM   #5
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
/framestack.
  Reply With Quote
02-19-10, 12:25 PM   #6
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
Originally Posted by mrruben5 View Post
/framestack.
Holy ****!!!! that is AWESOME!!!!!!! wow, thanks a ton! (not being sarcastic!)

Edit: still doesn't seem to work for Dominos...... just gives tables. hmm..... doesn't even give the name of the parents for bartender....

Last edited by Aerials : 02-19-10 at 12:31 PM.
  Reply With Quote
02-19-10, 12:25 PM   #7
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
Thanks for the replies. Switched over to BT4 and, well, I can parent and anchor to the Stance Bar but it won't resize.

More specifically, my pally has 8 buttons on the stance bar vs. 3 for my warrior. So i'm wanting the panel to resize according to the number of bottons. Was thinking that just using the stance bar to parent/anchor to or get the height/width would be enough, but guess not.

I'm guessing at this point I should set up different profiles for each? Surely someone has done this already.

And /framestack is awesome ! !

**EDIT**
Ok, the panel will SCALE with the bar but not adjust to the number of buttons.

Last edited by Xhelius : 02-19-10 at 12:27 PM.
  Reply With Quote
02-19-10, 12:37 PM   #8
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
hmm, the width seems to be 1.... is there a way to get a count of the things parented to a frame? (children?)

u can set the width to the overlay.....

ie: BT4StanceBarOverlay:GetWidth()

Last edited by Aerials : 02-19-10 at 12:49 PM.
  Reply With Quote
02-19-10, 12:44 PM   #9
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
I was gonna say....that it appears the StanceBar doesn't technically have a height or width. So in order to get the panel to resize it has to be done according to the number of buttons.

Once again I'm readying thru kgPanels forums for a clue...I'm sure I've seen something...rereading 110+ forums pages is not fun :P

**EDIT**
Aerials...I was thinking the same thing. If I parent/anchor to Overlay, set the panel to 100% height/width, unlick the bars to move them, the panel resizes just fine. Then disappears once I lock the bars...hmmmm

Last edited by Xhelius : 02-19-10 at 01:07 PM.
  Reply With Quote
02-19-10, 01:16 PM   #10
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
Originally Posted by Xhelius View Post
I was gonna say....that it appears the StanceBar doesn't technically have a height or width. So in order to get the panel to resize it has to be done according to the number of buttons.

Once again I'm readying thru kgPanels forums for a clue...I'm sure I've seen something...rereading 110+ forums pages is not fun :P

**EDIT**
Aerials...I was thinking the same thing. If I parent/anchor to Overlay, set the panel to 100% height/width, unlick the bars to move them, the panel resizes just fine. Then disappears once I lock the bars...hmmmm
parent and anchor to BT4BarStanceBar.
in on load / on update:
local w = BT4BarStanceBarOverlay:GetWidth()
local h = BT4BarStanceBarOverlay:GetHeight()
self:SetWidth(w)
self:SetHeight(h)

seems to be working on my test bar, not sure where all you would need to have it change the widths, might need to register some events and put it in there.

oh, i anchored from TOPRIGHT to TOPRIGHT, and set offsets to x: 2, y: 2 (might need to change this, depending on how you have yours laid out)
you could just parent to the bar, anchor to the overlay, then set the points to CENTER, CENTER, then set offsets to 0, 2

Last edited by Aerials : 02-19-10 at 01:43 PM.
  Reply With Quote
02-19-10, 01:38 PM   #11
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
lol...I have seemingly broken my panel now. This is what I'm getting now:



What events are you using? I did try parenting to the bar and anchoring to the overlay but the panel won't show until it's parented to the overlay. Once that happens the panel is fine, just hides when the overlay is turned off.

Last edited by Xhelius : 02-19-10 at 01:50 PM.
  Reply With Quote
02-19-10, 01:49 PM   #12
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
haven't been using any right yet..... just been messing around with onload and onupdate.

i found after that last post that it's much easier to do this:

parent: BT4BarStanceBar
anchor: BT4BarStanceBarOverlay
points: CENTER, CENTER
offsets: 0, 2 (x, y)
in onload:
local w = BT4BarStanceBarOverlay:GetWidth()
local h = BT4BarStanceBarOverlay:GetHeight()
self:SetWidth(w)
self:SetHeight(h)
in onupdate:
local w = BT4BarStanceBarOverlay:GetWidth()
local h = BT4BarStanceBarOverlay:GetHeight()
self:SetWidth(w)
self:SetHeight(h)

i'm not sure how those are handled entirely really though, so you might need to register an event and put:
local w = BT4BarStanceBarOverlay:GetWidth()
local h = BT4BarStanceBarOverlay:GetHeight()
self:SetWidth(w)
self:SetHeight(h)

in the onevent. (this is all assuming that you have some characters that aren't max lvl and so don't have all stances yet..... otherwise you only need the onload).

Last edited by Aerials : 02-19-10 at 01:54 PM.
  Reply With Quote
02-19-10, 02:00 PM   #13
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
You are my Hero. Thank you soooo much. Working like a charm.

/em does the snoopy dance

**EDIT**
Now onto the pet bar :P
  Reply With Quote
02-19-10, 02:02 PM   #14
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
Originally Posted by Xhelius View Post
You are my Hero. Thank you soooo much. Working like a charm.

/em does the snoopy dance

**EDIT**
Now onto the pet bar :P
should be a lot easier now that we've figured out the basics of it.
  Reply With Quote
02-19-10, 02:10 PM   #15
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
lol...just my luck...not working with pet bar :O


pfffttt...nvm.....BT4 not Bt4 :P

Last edited by Xhelius : 02-19-10 at 02:14 PM.
  Reply With Quote
02-19-10, 02:20 PM   #16
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
incase you decide to make a lowbie, these are probably the events i'd register it to:
"TRAINER_CLOSED"
"PLAYER_TALENT_UPDATE"

it's actually a good idea to use "PLAYER_TALENT_UPDATE" anyway, because of drooders.
hmm, wont work for drooders that dont have tree form...... for some reason bartender doesn't change the size of the overlay... makes me wonder if it'll be the same for lowbies.

Last edited by Aerials : 02-19-10 at 02:30 PM.
  Reply With Quote
02-19-10, 02:21 PM   #17
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
Pet bar working, Stance Bar working....

In case someone else reads this, just an FYI, the script will not allow you to adjust the height or width of the frame.
  Reply With Quote
02-19-10, 02:22 PM   #18
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
Originally Posted by Aerials View Post
incase you decide to make a lowbie, these are probably the events i'd register it to:
"TRAINER_CLOSED"
"PLAYER_TALENT_UPDATE"

it's actually a good idea to use "PLAYER_TALENT_UPDATE" anyway, because of drooders.
I'm not real good with the event registering....I made a lvl 1 rogue real quick and worked just fine without events. Maybe you could explain it to me?

And on non-stance/class bar characters there is a gray box in the center of the screen.....

**EDIT**
What if I used the:

local _, class = UnitClass("player");
if class == "WARRIOR" then
local w = BT4BarStanceBarOverlay:GetWidth()
local h = BT4BarStanceBarOverlay:GetHeight()
self:SetWidth(w)
self:SetHeight(h)

So on and so farth for Paladin, Rogue, Druid, Deathknight? Or something along those lines.

Last edited by Xhelius : 02-19-10 at 02:40 PM.
  Reply With Quote
02-19-10, 02:38 PM   #19
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
Originally Posted by Xhelius View Post
I'm not real good with the event registering....I made a lvl 1 rogue real quick and worked just fine without events. Maybe you could explain it to me?

And on non-stance/class bar characters there is a gray box in the center of the screen.....
for the events, i can't get them to work yet because the event fires and it's trying to change the size of the panel before bartender updates, but also if the bar gets shorter rather than larger (ie: druids changing talents out of resto), bartender doesn't update that at all and it's size doesn't change until the ui is reloaded. but pretty much, to register the event you would put:

self:RegisterEvent("TRAINER_CLOSED")
self:RegisterEvent("PLAYER_TALENT_UPDATE")

in the on load

then copy the rest of the on load to on event (but leave it in on load also)...

how to add a delay, i'm not sure yet.... i'm sure you can have a little timer in there somehow, but i've never used those yet so don't know how yet.

as for the non stance bar characters, i'll check it out i'm guessing the bar isn't hidden, just doesn't have buttons added to it.
  Reply With Quote
02-19-10, 02:42 PM   #20
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
ok, got a fix for the grey box....

change the script to:
local w = BT4BarStanceBarOverlay:GetWidth()
local h = BT4BarStanceBarOverlay:GetHeight()
if w >= 2 then
self:SetWidth(w)
self:SetHeight(h)
self:Show()
else
self:Hide()
end

bartender still creates the frame, but the width is 1, this checks if it's greater or equal to 2 and if it is it's rezised and shown, else hidden.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » kgPanels Help

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