I'm tired of seeing p3lim fail over and over and over again, so here have a working version:
if unit == "target" then
local cpoints = self:CreateFontString(nil, "OVERLAY")
cpoints:SetPoint("LEFT", self, "RIGHT")
cpoints:SetFont(GameFontNormalSmall:GetFont(), 36, "OUTLINE")
cpoints:SetJustifyH"RIGHT"
self.CPoints = cpoints
local combocolor = {
{ 1*.2, 0, 0 },
{ 1*.4, 0, 0 },
{ 1*.6, 0, 0 },
{ 1*.8, 0, 0 },
{ 1, 0, 0 },
}
function self:PLAYER_COMBO_POINTS()
local cp = GetComboPoints()
local cpoints = self.CPoints
if(cp > 0) then
cpoints:SetText(cp)
-- unpack because it's less work to add alpha that way
cpoints:SetTextColor(unpack(combocolor[cp]))
else
cpoints:SetText()
end
end
end
Same here, and you have been alot of help, trial and error has been good for me. i have no programming background at all, so I'm a tad challenged. Rather frustrated with this last one thing I just can't get to work. I might put my husband to work and see if he has any ideas what is wrong.
Thankyou to all of you guys that have helped me the last couple days, I really appreciate it. Haste was kind enough to help me quite a bit today himself, which i am very grateful for. Still having one issue that I can't seem to figure out:
That is the code to right click my player buffs to cancel, and for the life of me I can't figure out why it doesn't work. Hasste wrote it for me, but I'm not sure if it hates my buffborders or what.
Here is the whole layout if anyone wants to take a whack at either to see if they know why it doesn't work.
I tried new ouf and some new layouts last night , after playing with ag_uf's ( Moon, this time I will make a clean code i hope :P ) in the past I finally managed to place my hands on some free time and noticed that most of the other UF addons got loads of garbage in it, which just...disgusts me...
and now I'm going to start coding and configuring oUF, but before that I need to know 2 things:
1 ) your hp is 100%, someone hits you for 100 damage, your hp drops to 50%, now the 50% lost will normally just dissapear, but I was wondering if it is possible to code in a white flash that lasts for 1 second similar to Smooth bar fading in random other Unit frames? ( if you don't know what I am looking for, check out this very old pvp movie and the bar fading in action-livestream on google.video : here
2) what about portraits? can they be coded in? where can I find some guides to start sorting it out?
[edit] nvm, I found out about portraits, now just that flash and I am good to go into the land of coders :S [/edit]
I hope someone will answer me seriously, but just in case,
if you're lazy to type, just post a link to some other guide on how to do those stuff, I just need some general pointers!
edit: Didnt know oUF made a overlay for buffs then hides it :o That was neat to know!
It has done this since .Auras was added, which is also why I had the trouble to see why you would need a :PostUpdateAuraIcon().
Quote from Raen »
1 ) your hp is 100%, someone hits you for 100 damage, your hp drops to 50%, now the 50% lost will normally just dissapear, but I was wondering if it is possible to code in a white flash that lasts for 1 second similar to Smooth bar fading in random other Unit frames?
It's fully possible to add this to oUF, even from a layout point, but it hasn't been done by anyone I believe.
edit: Didnt know oUF made a overlay for buffs then hides it :o That was neat to know!
I wonder if something to do with this is why the right click to cancel buff doesn't work:/ Haste even rewrote it for me and it still doesn't work. Could another function be stopping it?
Okay, seriously wtf is all i have to say. I got the right click to work with the buff borders FINALLY, but the code is majorly terrible on my part. I'm not sure if it's possible to clean up what i did at all, but I had to call the postcreateauraicon function in BOTH the player and target frame to get the target frames buff border to still function while having the right click functionality. I'm not sure myself if I can clean it up at all but anyone is welcome to look and see what I hacked up to make it work. Or help in taking things out that don't belong.
Good gosh I though I would never get to stop banging my head on the wall.
You want buff's right click removable on the target too?
Well my buffs are, but it was the only way I could make the border on the target frame buffs work. Otherwise it was broken and only the player buff border worked. If I can clean up the code please tell me. Haste fixed the whole thing, but I hacked this part up a way lot to make it work.
I dont even know lua properly, so no wonder I keep failing :p
Couldn't you get rid of that table and just do
Yes you could. Someone did however post a color scale which altered between different colors earlier in the thread.
Anyways, which is more efficent?
http://www.pastey.net/88831
That is the code to right click my player buffs to cancel, and for the life of me I can't figure out why it doesn't work. Hasste wrote it for me, but I'm not sure if it hates my buffborders or what.
Here is the whole layout if anyone wants to take a whack at either to see if they know why it doesn't work.
http://www.pastey.net/88824-2lgq:88822-en0l
edit: Didnt know oUF made a overlay for buffs then hides it :o That was neat to know!
and now I'm going to start coding and configuring oUF, but before that I need to know 2 things:
1 ) your hp is 100%, someone hits you for 100 damage, your hp drops to 50%, now the 50% lost will normally just dissapear, but I was wondering if it is possible to code in a white flash that lasts for 1 second similar to Smooth bar fading in random other Unit frames? ( if you don't know what I am looking for, check out this very old pvp movie and the bar fading in action-livestream on google.video : here
2) what about portraits? can they be coded in? where can I find some guides to start sorting it out?
[edit] nvm, I found out about portraits, now just that flash and I am good to go into the land of coders :S [/edit]
I hope someone will answer me seriously, but just in case,
if you're lazy to type, just post a link to some other guide on how to do those stuff, I just need some general pointers!
It has done this since .Auras was added, which is also why I had the trouble to see why you would need a :PostUpdateAuraIcon().
It's fully possible to add this to oUF, even from a layout point, but it hasn't been done by anyone I believe.
Just take a look at how the other add-ons do it.
The Layout you copied was my current PB style.
I wonder if something to do with this is why the right click to cancel buff doesn't work:/ Haste even rewrote it for me and it still doesn't work. Could another function be stopping it?
Good gosh I though I would never get to stop banging my head on the wall.
Well my buffs are, but it was the only way I could make the border on the target frame buffs work. Otherwise it was broken and only the player buff border worked. If I can clean up the code please tell me. Haste fixed the whole thing, but I hacked this part up a way lot to make it work.
http://www.pastey.net/88872
I am so excited it works I'm like bouncing off the walls, hahahha.