Thread Tools Display Modes
02-19-10, 02:52 PM   #21
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
Will do...I'll let you kow...I'm currently off to a tasting with the wedding caterer.
  Reply With Quote
02-19-10, 04:54 PM   #22
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
Originally Posted by Xhelius View Post
Will do...I'll let you kow...I'm currently off to a tasting with the wedding caterer.
i had to go help my mom move some furnature anyway and i know there's gonna be more bugs.... such as the druid problem, and it'll be the same problem with warlocks and priests and possibly other classes also. i'll see if i can find a easy way to fix it but i'm betting you're going to have to have conditionals if you want it perfect (along with the delay on changing sizes).
  Reply With Quote
02-19-10, 06:29 PM   #23
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I was not aware that the bar's frame didn't really have dimensions. I suppose that it makes sense, though. First button gets anchored to the 1x1 (or whatever size) bar, and additional buttons are anchored to the previous button(s). Glad you got it worked out, though.
__________________
"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, 07:57 PM   #24
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
yah, what i put works for everything other than when a warlock, priest or druid change talents.... i think i have it figured out for when they do, but not sure yet.... problem is bartender seems to delay the creation of the buttons, and i don't know how to delay a onevent script. think i have it aboot working, but i'm out of time for the night. might be able to help figure it out more tomorrow though.
  Reply With Quote
02-19-10, 08:04 PM   #25
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
Food was wonderful and I know have a caterer for my wedding. YAY !

back to the matter at hand....

I've reread the kgPanels thread again and googled everywhere...Can't find anything to delay the <OnLoad>. So I'm going to assume that there need to be a different conditional set...What that is I'm not sure tho
  Reply With Quote
02-19-10, 08:23 PM   #26
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
i've gotten it to work with onupdate.... and really it's working entirely, but it's a total and complete mess (added a ton of crap, and it's quite lengthy and sloppy). i'm thinking now that instead of using the bartender bar as parent / anchor / getting width and height, it's probably best to do this entirely different.

it should be easier to do the following:
we can use GetNumShapeshiftForms() to get the ammount of buttons on the stance bar.
from there, you can use the width set in the bartender options and spacing in the bartender options to find out how wide the bar should be.
you can use the height option and spacing in the bartender settings to find out what the height of the bar should be.
then, in the onload and onevent you can have kgpanels figure the width and height independant of there being a stance bar made already.

as for the positioning, there's 2 easy ways....
do the same as we did for height and width
or
just position them manually as they shouldn't need to be moved (have the anchor point be the same as used in bartender)

also, could have it just hide if GetNumShapeshiftForms() =0 0 and show if GetNumShapeshiftForms() >= 1...

i just am out of time, so can't write out the scripts right now, i'm not sure if you can access the bartender saved variables with another addon, so might have to enter them manually as you do in bartender.

here's a quick example:
local buttonQuantity = GetNumShapeshiftForms()
local totalButtonWidth = floor(buttonQuantity*(width from either bartender variable or same number shown in bartender options))
local buttonSpacing = floor((buttonQuantity+1)*(spacing from either bartender variable or same number shown in bartender options))
(that one included spacing outside the buttons)
local barWidth = floor((totalButtonWidth+buttonSpacing)
self:SetWidth(barWidth)

i mighta messed up quite a bit in that example, was just throwing it together really quick... it's just to show an idea.
  Reply With Quote
02-19-10, 09:49 PM   #27
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
From StanceBar.lua I'm seeing:

Code:
if GetNumShapeshiftForms() == 0 then
        self:Disable()
    end
And
Code:
StanceBar.button_width = 30
StanceBar.button_height = 30
Dunno if this helps...I also looked in the ActionButton.lua didn't see anything. Also the savedvariables doesn't have anything in it.
  Reply With Quote
02-19-10, 10:12 PM   #28
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
yah, i've noticed that the button width and height are always 30, it just changes the scale, which is easy to get with BT4BarStancebar:GetScale(), think i might have it pretty close right now.

(couldn't get this outa my mind and have some more time now)
  Reply With Quote
02-19-10, 10:47 PM   #29
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
ok, got it....

onload:
Code:
self:RegisterEvent("PLAYER_TALENT_UPDATE")
self:RegisterEvent("TRAINER_CLOSED")
self:RegisterEvent("PLAYER_AURAS_CHANGED")
self:RegisterEvent("LEARNED_SPELL_IN_TAB")
self:RegisterEvent("ADDON_LOADED", Bartender)

local spacing = 2
local borderW = 10
local borderH = 7
local offsetX = 0
local offsetY = 2

local w = 30
local h = 30
local scale = BT4BarStanceBar:GetScale()
local  buttonCount = GetNumShapeshiftForms()
local totalButtonWidth = floor(buttonCount*w)
local totalBarHeight = floor(h+4)
if buttonCount >= 1 then
  if buttonCount == 1 then
    local totalButtonSpacing = floor(buttonCount)
    local totalBarWidth = floor((totalButtonWidth+totalButtonSpacing)+borderW)
    self:SetWidth(totalBarWidth)
  else
    local totalButtonSpacing = floor((buttonCount-1)*spacing)
    local totalBarWidth = floor(totalButtonWidth+totalButtonSpacing+borderW)
    self:SetWidth(totalBarWidth)
  end
  self:SetScale(scale)
  self:SetHeight(floor(totalBarHeight+borderH))
  self:ClearAllPoints()
  self:SetPoint("TOPLEFT", BT4BarStanceBarOverlay, "TOPLEFT", offsetX, offsetY)
  self:Show()
else
  self:Hide()
end
onevent:
Code:
local spacing = 2
local borderW = 10
local borderH = 7
local offsetX = 0
local offsetY = 2

local w = 30
local h = 30
local scale = BT4BarStanceBar:GetScale()
local  buttonCount = GetNumShapeshiftForms()
local totalButtonWidth = floor(buttonCount*w)
local totalBarHeight = floor(h+4)
if buttonCount >= 1 then
  if buttonCount == 1 then
    local totalButtonSpacing = floor(buttonCount)
    local totalBarWidth = floor((totalButtonWidth+totalButtonSpacing)+borderW)
    self:SetWidth(totalBarWidth)
  else
    local totalButtonSpacing = floor((buttonCount-1)*spacing)
    local totalBarWidth = floor(totalButtonWidth+totalButtonSpacing+borderW)
    self:SetWidth(totalBarWidth)
  end
  self:SetScale(scale)
  self:SetHeight(floor(totalBarHeight+borderH))
  self:ClearAllPoints()
  self:SetPoint("TOPLEFT", BT4BarStanceBarOverlay, "TOPLEFT", offsetX, offsetY)
  self:Show()
else
  self:Hide()
end
i have the bar parented and anchored to UIParent, because BT4BarStanceBar seems to be being loaded after kgpanels. it re-anchors them when bartender is loaded and other events fire.

also, you may need to change:
Code:
local spacing = 2
local borderW = 10
local borderH = 7
local offsetX = 0
local offsetY = 2
to different values in both onload and onevent, depending on how you have the panel background / border set up and how you have bartender set up.

hope this helps, i haven't found any bugs with it yet.

i also have no idea if all those events are necesary, i kinda doubt it but it shouldn't hurt much O.o
  Reply With Quote
02-19-10, 10:53 PM   #30
Warlocomotif
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 26
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?
I think what he means is that if you hit level x and you learn a new stance, that the panel might not update by just onload/onupdate. However I could be wrong with my interpetation of what he means, and for all I know it might update aswell.
  Reply With Quote
02-19-10, 11:00 PM   #31
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
Originally Posted by Warlocomotif View Post
I think what he means is that if you hit level x and you learn a new stance, that the panel might not update by just onload/onupdate. However I could be wrong with my interpetation of what he means, and for all I know it might update aswell.
yah, that's what i meant. i'm not too good at explaining what i'm thinking it's all good now, should work fine.
  Reply With Quote
02-19-10, 11:11 PM   #32
Warlocomotif
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 26
Originally Posted by Aerials View Post
yah, that's what i meant. i'm not too good at explaining what i'm thinking it's all good now, should work fine.
I err, am not a regular on these forums and had not realized this thread was a good way into the 2nd page already Oops.
  Reply With Quote
02-19-10, 11:17 PM   #33
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
well, theoretically, if we could get a confirmation as to whether the issue is resolved or not this thread might be able to be closed O.o but i dono if they do that..... i've had way too much coffee and think i kinda hijacked the thread unintentionally.
  Reply With Quote
02-20-10, 07:56 AM   #34
Xhelius
An Aku'mai Servant
Join Date: Jan 2010
Posts: 39
Definitely didn't hijack the thread. Your help has been tremendous and much appreciated. Gonna pop in and test now. Once again, can't thank you enough. If I find anything I'll let you know. I don't think they "close" threads that are useful

**EDIT**

When/If you change the Bar Scale, you will have to /reloadui to reset the scale for the bar. Other than that, works like a charm so far. What I thought would be something simple turned out to be, not so simple. Thanks again Aerials ! ! ! ! Simply...YOU ROCK !

**EDIT EDIT**

local spacing=3 will need to be changed depending on setup. My panel was a tad short. Changing this to 5 worked just fine

Last edited by Xhelius : 02-20-10 at 08:13 AM.
  Reply With Quote
02-20-10, 01:50 PM   #35
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
the panel should be getting the scale from the onload / onevent from the scale of the bartender bar. i did that because the button size will always be 30 * that scale (among other things). so shouldn't need to change the scale as it should be set to the scale of the BT4BarStanceBar each time the addon loads or one of the events fire.

the spacing should need to be whatever you have the spacing of the stance bar set to in bartender's setup, borderW and borderH are just for personal preference reasons, i dono how much wider and taller than the bar you want the panel to be, and the offsets *cough* shouldn't *cough* need to be changed, but i put them there just incase (nobody's perfect )

glad it's working out for ya

or did you mean you have to reload ui after changing the scale in bartender settings? 'cuz that's true..... dono how to get around that short of having the code run all the time. actually i think i do know a way, i'll try it later.

Last edited by Aerials : 02-20-10 at 01:52 PM.
  Reply With Quote
02-20-10, 02:42 PM   #36
Taryble
A Molten Giant
 
Taryble's Avatar
Join Date: Jan 2009
Posts: 811
Why bother with the size/scale of the buttons?

Just parent/anchor the panel to the first button, set to 100%+10 height, and then set width to (100*GetNumShapeshiftForms())%+10.

The +10 gives you room for your border, most likely. Fiddle with those. :P

And if BT4 is loading after kgPanels, in the "Dependencies" section of that particular panel, just list Bartender.
__________________
-- Taryble
  Reply With Quote
02-20-10, 03:25 PM   #37
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
didn't know there was a dependencies area.... that probably makes all i did useless lol. i'll try it later. figured there would be something like that, but till now nobody said anything.

one thing though, kgpanels has a completely annoying habbit of changing the width / height / offsets / etc... (pretty much any number entered) a little bit every time it's loaded, making it over time not line up right. that's why i usually do all the anchoring and sizes in scripting. nothing like logging out after fixing all panels by about 1 pixel just to log into another character and have to do it again.

really i prefer to just make the frames in lua in my Aerials_Junk addon that i have.
  Reply With Quote
02-20-10, 06:48 PM   #38
Taryble
A Molten Giant
 
Taryble's Avatar
Join Date: Jan 2009
Posts: 811
Yeah, each panel offers a separate "Dependencies" section for the scripts in that panel to load.

Well, you DO have to do it in script, sorta. I mean, in the standard anchoring/parenting, instead of anchoring/parenting to the bar frame, just anchor/parent to the first button.

That'll give you the appropriate show/hide/alpha info, as well as the height of 1 button, and the width of 1 button.

Actually, now that I think about it, you'd probably have to do the width as an absolute, not a percentage. If the buttons are 30 wide, then just multiply 30 by the number of buttons. Also for padding, just multiply the padding by the number of buttons -1.

It ends up looking vaguely like this (I am no good at lua, btw )
Code:
local wide = 30
local pad = 4
local bord = 5
local numbut = GetNumShapeshiftButtons()
self.width = (numbut*wide)+((numbut-1)*pad)+bord
I'd probably deal with scaling just by multiplying the actual bar's width by the scale on that last line. But this is my old bad habit of lazy coding from my C++ days. ;-)
Code:
local wide = 30
local pad = 4
local bord = 5
local barscale = 0.75
local numbut = GetNumShapeshiftButtons()
self.width = barscale((numbut*wide)+((numbut-1)*pad))+bord
__________________
-- Taryble
  Reply With Quote

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


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