Well what I did works. No errors at all. Linked the code in my last post if you want to use it, feel free. It's probably not the most efficient, but I have no idea what I am doing so I'm amazed it works at all :D
And if you are as frustrated as I was, I feel for you. I even tried to scrap the player frame buffs for satrina until button facade wouldn't do what I wanted either. Then I was more than determined to fix it. My problem is, I don't know why the code haste wrote for me didn't work. It was like some function was blocking the right click cancelling, because when you change it around it works.
I have a problem with coloring my pet name by happyness level
if(unit=="pet") then
local color = oUF.colors.happiness[GetPetHappiness()]
if(color) then self.Name:SetVertexColor(color.r, color.g, color.b) end
end
Works like a charm but doesn't update, if the pet dies and get resurected then it loose one happyness level but when i feed him it doesn't go up, i have to /rl
--THIS SECTION SETS PET TEXT TO HAPPINESS AND PET HEALTH BAR COLOR TO HUNTER CLASS COLOR
if (unit == "pet" and GetPetHappiness()) then
color = oUF.colors.happiness[GetPetHappiness()] or oUF.colors.power[UnitPowerType(unit)]
if(color) then
self.Name:SetTextColor(color.r, color.g, color.b)
end
-- THIS NEXT LINE IS A SUCCESS
color = RAID_CLASS_COLORS[select(2, UnitClass("player"))]
elseif(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) or not UnitIsConnected(unit)) then
color = health[1]
else
color = UnitIsPlayer(unit) and RAID_CLASS_COLORS[select(2, UnitClass(unit))] or UnitReactionColor[UnitReaction(unit, "player")]
--color = health[2]
end
if(color) then
bar:SetStatusBarColor(color.r, color.g, color.b)
if(bar.bg) then
bar.bg:SetVertexColor(1,1,1,0.3)
end
end
My husband put this together for me, but I''ve not yet tested it in combat. It colors my pet bar by my hunter class color and my pet text by happiness.
Well what I did works. No errors at all. Linked the code in my last post if you want to use it, feel free. It's probably not the most efficient, but I have no idea what I am doing so I'm amazed it works at all :D
And if you are as frustrated as I was, I feel for you. I even tried to scrap the player frame buffs for satrina until button facade wouldn't do what I wanted either. Then I was more than determined to fix it. My problem is, I don't know why the code haste wrote for me didn't work. It was like some function was blocking the right click cancelling, because when you change it around it works.
Nah I have no use in buffs on player frame, I had it working once, but I dont bother trying to get it now :p
Was just testing something to try and help you.
Quote from Halcyon »
I have a problem with coloring my pet name by happyness level
if(unit=="pet") then
local color = oUF.colors.happiness[GetPetHappiness()]
if(color) then self.Name:SetVertexColor(color.r, color.g, color.b) end
end
Works like a charm but doesn't update, if the pet dies and get resurected then it loose one happyness level but when i feed him it doesn't go up, i have to /rl
Make sure you have the latest oUF version, I belive pet happiness updating got fixed a while back
Nah I have no use in buffs on player frame, I had it working once, but I dont bother trying to get it now :p
Was just testing something to try and help you.
Oh I see what you mean. Appreciated. I tried it a bunch of other ways and that was the only way it worked. And since I don't know anything about this really, I wasn't sure what was causing it to be blocked.
Make sure you have the latest oUF version, I belive pet happiness updating got fixed a while back
I even redownloaded it seeing your answer, doesn't help. It doesn't update unless i /rl
Edit:Ah well,, fixed the issue, just had to move the code at the right place...
Now getting the right click cancel player buffs to work is another story, i don't understand, i've added the code haste posted but it doesn't work at all.
Another question, I'm trying to have the name of my player and target frame aligned to the left if there's no power to display, and to the center if unit's power is available, i did the following, but it doesnt seems to align left when there's no power...
if(unit=="player" or unit=="target" or unit=="pet" or unit=="focus" or unit=="focustarget" or unit=="targettarget") then
self.Name = setFontString(hp, fontnormal, 10)
if(unit=="pet" or unit=="focus" or unit=="focustarget" or unit=="targettarget") then
self.Name:SetPoint("LEFT", 2, -1)
elseif(unit=="player" or unit=="target") then
if pp.value then
self.Name:SetPoint("CENTER", hp, 2, -1)
else
self.Name:SetPoint("LEFT", hp, 2, -1)
end
end
self.UNIT_NAME_UPDATE = updateName
end
what did i do wrong, it seems to always consider pp.value is true even when i target my pet.
pp.value:GetText() will return a string. Try
if pp.value:GetText() ~= "" then
It doesn't work as it's not a problem of having it true, it's a problem of having it false, it's when i target something without power that it doesn't work
if pp.value:GetText() ~= "" then
self.Name:SetPoint("CENTER", hp, 2, -1)
else
self.Name:SetPoint("LEFT", hp, 2, -1)
end
Does the same as what i did, it's the "else" that doesn't work :(
ChatFrame1:AddMessage(pp.value:GetText())
if pp.value:GetText() then
self.Name:SetPoint("CENTER", hp, 2, -1)
else
self.Name:SetPoint("LEFT", hp, 2, -1)
end
yes, register "PLAYER_REGEN_DISABLED" and "PLAYER_REGEN_ENABLED" and just do :SetAlpha() on the frames you want.
I have the events registered, but I'm not sure how to write the setalpha for the frames. I know one alpha will be 0 and one will be 1 but I'm not sure how to write it out.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
And if you are as frustrated as I was, I feel for you. I even tried to scrap the player frame buffs for satrina until button facade wouldn't do what I wanted either. Then I was more than determined to fix it. My problem is, I don't know why the code haste wrote for me didn't work. It was like some function was blocking the right click cancelling, because when you change it around it works.
Works like a charm but doesn't update, if the pet dies and get resurected then it loose one happyness level but when i feed him it doesn't go up, i have to /rl
My husband put this together for me, but I''ve not yet tested it in combat. It colors my pet bar by my hunter class color and my pet text by happiness.
Nah I have no use in buffs on player frame, I had it working once, but I dont bother trying to get it now :p
Was just testing something to try and help you.
Make sure you have the latest oUF version, I belive pet happiness updating got fixed a while back
Oh I see what you mean. Appreciated. I tried it a bunch of other ways and that was the only way it worked. And since I don't know anything about this really, I wasn't sure what was causing it to be blocked.
I even redownloaded it seeing your answer, doesn't help. It doesn't update unless i /rl
Edit:Ah well,, fixed the issue, just had to move the code at the right place...
Now getting the right click cancel player buffs to work is another story, i don't understand, i've added the code haste posted but it doesn't work at all.
Oooh! One other question. Can I combat fade all my frames, not raid and party though, just the rest?
http://i72.photobucket.com/albums/i167/sarahmkratz/WoWScrnShot_060408_002557.jpg
yes, register "PLAYER_REGEN_DISABLED" and "PLAYER_REGEN_ENABLED" and just do :SetAlpha() on the frames you want.
what did i do wrong, it seems to always consider pp.value is true even when i target my pet.
pp.value:GetText() will return a string. Try
if pp.value:GetText() ~= "" then
It doesn't work as it's not a problem of having it true, it's a problem of having it false, it's when i target something without power that it doesn't work
Does the same as what i did, it's the "else" that doesn't work :(
Wasn't sure to understand how to do that, anyway did this
Adn this time the name text was to the left for everything, with or without power :)
Did this, nothing in chat.
I have the events registered, but I'm not sure how to write the setalpha for the frames. I know one alpha will be 0 and one will be 1 but I'm not sure how to write it out.