Your parentheses are off.
string.format("%d || |cff%02x%02x%02x%d%%|r")
>> needs to be something like:
string.format("%d || |cff%02x%02x%02x%d%%|r", num1, num2, num3, num4, num5)
Among other ridiculousness:
Don't define a new function (ColourGradient) inside your updateHealth function.
You check to see if the unit is player, focus, pet, or target, then try to set your string to the value of the player:
local curhealth, maxhealth = UnitHealth("player"), UnitHealthMax("player")
>> needs to be something like:
local curhealth, maxhealth = UnitHealth(unit), UnitHealthMax(unit)
- Registered User
Member for 11 years
Last active Tue, Sep, 30 2008 14:06:02
- 0 Followers
- 50 Total Posts
- 0 Thanks
Jun 23, 2008@GankuuPosted in: Raid AddOns
Check this mod out for school lockouts:
I don't use it, so it may blow, but in concept it does what you want.
Jun 16, 2008@BOOBLIK:Posted in: Unit Frames
Your OverrideUpdateHealth or PostUpdateHealth will be given the following args: (self, event, bar, unit, min, max). If you have a color table with r, g and b values, you can make them darker on, for example, a StatusBar, like so:
bar:SetStatusBarColor(color.r * min/max, color.g * min/max, color.b * min/max)
Not sure if max can ever be 0, so you may want to watch out for that.
If this information doesn't help you, you may want to consider learning more about Addons and Lua before banging your head against oUF. Most people here are willing to help, but there's a limit to 'how much.' :)
Jun 11, 2008Posted in: Unit FramesQuote from Snago »
...levelFormats table don't have an entry for "trivial"...
Wow, hey, thanks for that! I've been using L[UnitClassification(unit)] or "" for like a month now after being too lazy to find the source of the problem.
Jun 7, 2008@SuzumiyaPosted in: Unit Frames
Check out this older post, it has an example that should give you an idea of what to do:
Also the attributes you need to set on your party and raid headers can be found in SecureTemplates.lua:
showRaid = [BOOLEAN] -- true if the header should be shown while in a raid
showParty = [BOOLEAN] -- true if the header should be shown while in a party and not in a raid
Jun 6, 2008Posted in: Unit FramesQuote from Slakah »
You can put a stationary statusbar behind your moving one. Have your moving status bar reveal the hidden one inversly. If you can understand what I'm trying to say.
How would that produce a result any different from the above (background texture + statusbar)?
Jun 6, 2008Posted in: Unit FramesQuote from Borhast »
You've noticed how alpha blending works with WoW. I can give you a few hints from my testing, but I'm afraid my knowledge is limited.
- When you set a frame's alpha, it is applied to all child frames and regions, too. Hence you can see through the 50% of your statusbar texture to the 50% of your background. Which means you need to draw your background texture exactly to the size of the area the statusbar does not cover.
- The texture of a 'StatusBar' frame is actually sized to the whole frame no matter what value is set. Which means, for example, you can't do something like :SetPoint("LEFT", statusbartexture, "RIGHT") for your background texture.
And since you can't tell a statusbar to fill in the opposite direction, I think you're going to have to make your own version of a StatusBar to suit your needs. As far as I know, oUF only uses the :SetMinMaxValues, :SetValue, and :SetStatusBarColor methods (plus whatever you use in your layout).
Jun 6, 2008Posted in: Unit FramesQuote from seventoes »
self.unit is a string, and the unit ID of that unit's target is going to be that same string with the other string 'target' stuck on the end of it:
self.unit .. "target"
May 19, 2008I was looking at this to try to solve Ganders' problem (and met with 0 success), but I think the following is true for .Auras:Posted in: Unit Frames
If you specify b buffs and d debuffs, the first b entries in .Auras will be buffs and the remaining d will be debuffs.
If b is less than half of (b + d), the debuffs will start repeating themselves because the index used for UnitDebuff will be (<the current aura number> % b). (maybe try subtraction here instead, eh?)
Anything you do in .PostCreateAuraIcon involving hiding/showing the .overlay texture will fail because it is shown and hidden in the updateIcon function.
I might be wrong (I'm not that great with programming), but some of this may help you guys. Cheers.
Edit: I was wrong about the first thing. Which means you might want to create your own, separate overlay texture in .PostCreateAuraIcon:
local tex = button:CreateTexture(nil, "OVERLAY") tex:SetTexture(buffborder) tex:SetAllPoints(button) button.overlay2 = tex
and then make a .PostUpdateAura function that scans through each icon in .Auras and hides .overlay and shows and colors .overlay2 as appropriate. Though you may want to look into just disabling the .ovelay somehow so you don't show/hide it a bunch of times.
Edit 2: Jesus I fail at forums.
Apr 26, 2008Posted in: Unit FramesQuote from Alarisha »is there any way to make a 5-man raid show as party, rather than raid frames?
The way I had been doing it was by watching the PARTY_MEMBERS_CHANGED and RAID_ROSTER_UPDATE events (and checking to see if the player is in combat and registering the PLAYER_REGEN_ENABLED event as needed), and checking to see if GetNumPartyMembers() + 1 == GetNumRaidMembers(). Then you just set the showRaid attribute for your raid and party frames as needed.
I have a ghetto little mod that rearranges crap in my UI based on the number of raid members, this is its event handler:
local state, nr local mod = CreateFrame"Frame" mod:SetScript("OnEvent", function(self, event, ...) if(InCombatLockdown()) then self:RegisterEvent"PLAYER_REGEN_ENABLED" else self:UnregisterEvent"PLAYER_REGEN_ENABLED" nr = GetNumRaidMembers() if(nr == 0 or -- No raid members or one-party raid (arena) nr == (GetNumPartyMembers() + 1)) then if(state == 0) then return end -- .. do whatever here state = 0 else -- Raid is present if(state == 1) then return end -- .. do whatever else here state = 1 end end end) mod:RegisterEvent"PLAYER_ENTERING_WORLD" mod:RegisterEvent"RAID_ROSTER_UPDATE" mod:RegisterEvent"PARTY_MEMBERS_CHANGED"
- To post a comment, please login or register a new account.