Wow wait slow down, omg so here's the original code
if(max==100) then
if(unit=="target" and not UnitIsPlayer("target")) then
local cur, maxhp = LibMobHealth:GetUnitHealth(unit)
bar.value:SetFormattedText("%d (%d|cff0090ff%%|r)", cur, floor(cur/maxhp*100))
else
bar.value:SetFormattedText("%d|cff0090ff%%", min)
end
elseif(min~=max) then
bar.value:SetFormattedText("|cffff8080%d|r", min-max, floor(min/max*100))
else
bar.value:SetText(max)
end
Wow wait slow down, omg so here's the original code
if(max==100) then
if(unit=="target" and not UnitIsPlayer("target")) then
local cur, maxhp = LibMobHealth:GetUnitHealth(unit)
bar.value:SetFormattedText("%d (%d|cff0090ff%%|r)", cur, floor(cur/maxhp*100))
else
bar.value:SetFormattedText("%d|cff0090ff%%", min)
end
elseif(min~=max) then
bar.value:SetFormattedText("|cffff8080%d|r", min-max, floor(min/max*100))
else
bar.value:SetText(max)
end
What does this become then ?
becomes
if(max==100) then
if(unit=="target" and not UnitIsPlayer("target")) then
if (UnitPlayerControlled("target")) then
local cur, maxhp = LibMobHealth:GetUnitHealth(unit)
bar.value:SetFormattedText("%d (%d|cff0090ff%%|r)", cur, floor(cur/maxhp*100))
else
if min < max then
local cur, maxhp = LibMobHealth:GetUnitHealth(unit)
bar.value:SetFormattedText("%d (%d|cff0090ff%%|r)", cur, floor(cur/maxhp*100))
else
bar.value:SetText("")
end
end
else
bar.value:SetFormattedText("%d|cff0090ff%%", min)
end
elseif(min~=max) then
bar.value:SetFormattedText("|cffff8080%d|r", min-max, floor(min/max*100))
else
bar.value:SetText(max)
end
Well it works, but the thing is, it also hide mobs's hp if it's 100%, not only NPC's hp
that i can not help.
it does however shows a mob hp when it goes below 100% so you should be fine.
could be possible to check if its a neutral npc but other than that thers nothing you could do about it i think.
May i ask why local cur, maxhp = LibMobHealth:GetUnitHealth(unit) appear twice ?
and also the elseif(min~=max) then part ?
Just being curious :)
yes as far as the health part goes its correct yes
the reason for double entrys of the libmobhealth part is, and im purely guessing here as im a nublet myself, is that you use it locally withing the if statement so anything outside of it cant use that info so thats why i used it twice.
im sure you could declare it at the top of the function and save urself a row.
regarding the elseif(min~=max)
its basically just if current hp aint max hp do this
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.
I've made oUF_CombatFader, it doesn't do everything which Pitbull_CombatFader does, all it does is sets the objects alpha to
I've made oUF_CombatFader, it doesn't do everything which Pitbull_CombatFader does, all it does is sets the objects alpha to .CombatFader.Combat while in combat and .CombatFader.NoCombat when out of combat.
To use this in your oUF layout you will need a CombatFader table in your oUF unit object (self):
self.CombatFader = {NoCombat = 0.2, Combat = 1}
NoCombat being the alpha out of combat and Combat being the alpha in. The alpha's have to be a value between 1 and 0.
Hope this helps Blizz.
All I can say is I love you. Ammo and I were talking and what needed to be done is just beyond my very slim coding skills. I will try it out a little later on today. Thankyou again.
Edit: Well if it IS possible for me to screw something up that is so easy, then I guess I will. Because I can't get it to work. It doesn't cause any errors. I tried it quite a few different places just to see if i was misunderstanding you also.
All I can say is I love you. Ammo and I were talking and what needed to be done is just beyond my very slim coding skills. I will try it out a little later on today. Thankyou again.
Edit: Well if it IS possible for me to screw something up that is so easy, then I guess I will. Because I can't get it to work. It doesn't cause any errors. I tried it quite a few different places just to see if i was misunderstanding you also.
for player frame alpha do this
--[[ Player ]]--
if(unit and unit == "player") then
name:SetPoint("LEFT", 2, 0)
hpp:SetPoint("RIGHT", -2, 0)
self:SetWidth(223)
self:SetHeight(23)
hp:SetHeight(18)
pp:SetHeight(4)
self.CombatFader = {NoCombat = 0.2, Combat = 1}
target
--[[ Target ]]--
if(unit and unit == "target") then
name:SetPoint("RIGHT", -2, 0)
self:SetWidth(223)
self:SetHeight(23)
hp:SetHeight(18)
self.CombatFader = {NoCombat = 0.2, Combat = 1}
pp:SetHeight(4)
hpp:SetPoint("LEFT", 2, 0)
ppp:Hide()
Basically add it where the layout is created for each unit
worked like a charm for me.
try this.
make a lvl 1 char enable just oUF oUF_Atal and oUF_CombatFader.
this is what i did with the pastey you linked and it worked like a charm.
nahh it just returns true if its a player controlled character ie not a npc, nothing to do with mindcontrol
What does this become then ?
becomes
that i can not help.
it does however shows a mob hp when it goes below 100% so you should be fine.
could be possible to check if its a neutral npc but other than that thers nothing you could do about it i think.
http://pastey.net/88988
Correct ?
May i ask why local cur, maxhp = LibMobHealth:GetUnitHealth(unit) appear twice ?
and also the elseif(min~=max) then part ?
Just being curious :)
yes as far as the health part goes its correct yes
the reason for double entrys of the libmobhealth part is, and im purely guessing here as im a nublet myself, is that you use it locally withing the if statement so anything outside of it cant use that info so thats why i used it twice.
im sure you could declare it at the top of the function and save urself a row.
regarding the elseif(min~=max)
its basically just if current hp aint max hp do this
I've made oUF_CombatFader, it doesn't do everything which Pitbull_CombatFader does, all it does is sets the objects alpha to
All I can say is I love you. Ammo and I were talking and what needed to be done is just beyond my very slim coding skills. I will try it out a little later on today. Thankyou again.
Edit: Well if it IS possible for me to screw something up that is so easy, then I guess I will. Because I can't get it to work. It doesn't cause any errors. I tried it quite a few different places just to see if i was misunderstanding you also.
for player frame alpha do this
target
Basically add it where the layout is created for each unit
you sure you actually have have oUF_combatfade activated ??
cause what i just pasted works 100% as i tested it myself
Positive, it comes up perfectly fine in my addons list. Player frame example. I did to both exactly what you did.
ok wanna upload your layout.lua file or something.
http://www.pastey.net/89000
worked like a charm for me.
try this.
make a lvl 1 char enable just oUF oUF_Atal and oUF_CombatFader.
this is what i did with the pastey you linked and it worked like a charm.
hmm ok wanna try and just upload the whole thing ie oUF_atal you're using ?
http://files.filefront.com/oUF+Atalrar/;10509715;/fileinfo.html Thankyou for looking at it for me.