Thread Tools Display Modes
08-06-11, 11:19 PM   #1
starlon
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 107
status bars and unit events

Do status bars lock down during a UNIT_HEALTH/UNIT_POWER event?

Code:
local Update = function(self)
        local widget = self
        local bar = widget.bar
        if bar and bar:GetObjectType() == "StatusBar" then

                print(widget.min, widget.max, widget.val1)

                bar:SetMinMaxValues(widget.min, widget.max)
                bar:SetStatusBarTexture(widget.texture)
                bar:SetValue(widget.val1 * widget.max)
                bar:SetHeight(widget.height)
                bar:SetWidth(widget.length)

                local r, g, b, a = 1, 1, 1, 1
                
                if widget.color1 then
                        r, g, b, a = widget.color1.ret1, widget.color1.ret2, widget.color1.ret3, widget.color1.ret4
                end


                if type(r) == "number" then
                        bar:SetStatusBarColor(r, g, b, a)
                end
        end
end
Here's what it prints:


Edit: Here's more output showing Values and Colors, since I missed showing the color values above.


Edit 2:


It stays just like that. The one above that's white and partial width. (It is, trust me. )
__________________
Wake up Sheeple! Cataclysm was an inside job!

Legalize WoW gold purchases directly from Blizzard! Yeah, my doctor thinks I'm crazy too. >.<

"It was either going to school for programming or working at the Genetically Modified Wildlife Preserve. I've always had a love for the wildlife, but technology won out in the end."

Note: If you know of a library that you want to make available in your own scripts. let me know and I'll see about writing a plugin for it.

LCD4WoW

Last edited by starlon : 08-06-11 at 11:30 PM.
  Reply With Quote
08-06-11, 11:50 PM   #2
starlon
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 107
I figured it out. Was due to the status bar changing places with another.
__________________
Wake up Sheeple! Cataclysm was an inside job!

Legalize WoW gold purchases directly from Blizzard! Yeah, my doctor thinks I'm crazy too. >.<

"It was either going to school for programming or working at the Genetically Modified Wildlife Preserve. I've always had a love for the wildlife, but technology won out in the end."

Note: If you know of a library that you want to make available in your own scripts. let me know and I'll see about writing a plugin for it.

LCD4WoW
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » status bars and unit events


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