Thread Tools Display Modes
08-10-10, 08:57 AM   #41
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Okey works! got back the borders!
  Reply With Quote
08-10-10, 09:05 AM   #42
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Now is it only the health problem :P
  Reply With Quote
08-10-10, 09:14 AM   #43
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Originally Posted by Game92 View Post
Now is it only the health problem :P
It's not an easy thing to fix.

You need to create a Tag for displaying the text health value, which should replicate the functionality of lines 93 to 113.

Then you can set your colour gradient table and set the health bar to update with
Code:
self.Health.colorSmooth = true
  Reply With Quote
08-10-10, 09:24 AM   #44
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by yj589794 View Post
It's not an easy thing to fix.

You need to create a Tag for displaying the text health value, which should replicate the functionality of lines 93 to 113.

Then you can set your colour gradient table and set the health bar to update with
Code:
self.Health.colorSmooth = true
or nvm how can i remove the gradient? and just use normal color

Last edited by Aftermathhqt : 08-10-10 at 09:43 AM.
  Reply With Quote
08-10-10, 09:34 AM   #45
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Originally Posted by Game92 View Post
so where do i put "
Code:
self.Health.colorSmooth = true
"
replace the existing line 171
Code:
hp.Smooth = true
to
Code:
hp.colorSmooth = true

that *should* do that part
  Reply With Quote
08-10-10, 09:56 AM   #46
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Lets skip Gradient Color and lets just use normal.
  Reply With Quote
08-10-10, 10:08 AM   #47
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
take a look at http://wiki.github.com/haste/oUF/element-health-bar


there are many ways to colour the health bar...
  Reply With Quote
08-10-10, 10:13 AM   #48
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
oh... i just through like this
Code:
Health:SetStatusBarColor(.25, .25, .25)
  Reply With Quote
08-10-10, 10:25 AM   #49
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Originally Posted by Game92 View Post
oh... i just through like this
Code:
Health:SetStatusBarColor(.25, .25, .25)
That will work. The other possibilities can give you a different colour dependant upon the units class, status, reaction, etc...
  Reply With Quote
08-10-10, 10:38 AM   #50
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by yj589794 View Post
That will work. The other possibilities can give you a different colour dependant upon the units class, status, reaction, etc...
oke but how do i do with line: 91-122?
  Reply With Quote
08-10-10, 11:42 AM   #51
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
So how do i fix this? so i get back my bar color, and health/mana text? Since i have no idea
  Reply With Quote
08-10-10, 12:01 PM   #52
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Really, what do you think how we have learned this stuff?!

Open your browser, bring up google and search for Lua-documentation.
Open Wowwiki.com in another tab, here you will find the whole WoW-API-documentation.
Read (READ) the oUF-code. You will understand how it is working by reading.

I suggested a fix for your bar-coloring some posts ago, it was even repeated in this thread.

Insert
lua Code:
  1. hp:SetStatusBarColor(.25, .25, .25)
after line 169 and it will be fine.

This will be my last post in this thread. You don't seem to want to learn, you want other people to update your rip-off of another layout. I really tried to give you all necessary information, give you hints on what to do. But you seem to ignore it, because it will involve some work. You should let the people do the coding, who are willing to read, to learn...
__________________
  Reply With Quote
08-10-10, 12:19 PM   #53
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Mischback View Post
Really, what do you think how we have learned this stuff?!

Open your browser, bring up google and search for Lua-documentation.
Open Wowwiki.com in another tab, here you will find the whole WoW-API-documentation.
Read (READ) the oUF-code. You will understand how it is working by reading.

I suggested a fix for your bar-coloring some posts ago, it was even repeated in this thread.

Insert
lua Code:
  1. hp:SetStatusBarColor(.25, .25, .25)
after line 169 and it will be fine.

This will be my last post in this thread. You don't seem to want to learn, you want other people to update your rip-off of another layout. I really tried to give you all necessary information, give you hints on what to do. But you seem to ignore it, because it will involve some work. You should let the people do the coding, who are willing to read, to learn...
It does really say me alot when you say go to that website go and look up that it doesnt make any sense..to me and when i see all that... ugh i just get confused...dont know where to start, where to look.. what to find...? And ripp off... fu all i asked for was some help, since i dont really know anything about oUF and coding.. Do you really think i understand go on this site.. and you understand yeah, sure.. sure sure.. and what i can see.. is there nothing about the health/mana text... in the API... wohoow!
  Reply With Quote
08-10-10, 12:35 PM   #54
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
And those sites has nothing to do with oUF .....
  Reply With Quote
08-10-10, 01:00 PM   #55
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
How about both of you take some time to cool off?
  Reply With Quote
08-10-10, 01:15 PM   #56
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Im cool..
  Reply With Quote
08-10-10, 01:24 PM   #57
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
yj589794, Mischback and Rostok have already helped you quite a lot. I'm honestly amazed that yj589794 and Mischback have lasted this long. To me the thread has pretty much followed the following pattern:
1. That didn't help, I get an error.
2. Can you post the error?
3. <error />; how do I fix?
4. <solution>
5. GOTO 1;

Not having the most recent version of the code doesn't help the case much either, as all error messages get further and further offset from their reported line numbers.

If you want to fix your layout for 1.4 I'd suggest that you follow at least some of Mischback suggestions. Reading and attempting to understand some of the oUF element update could would be a tremendous help for your understanding. It generally is pretty straight forward.

Saying that neither the Lua manual, nor the WoW API has anything to do with oUF is also.. quite wrong. I can understand your discomfort with the Lua manual because it's written in a very terse from, and mainly aimed at people with prior knowledge about programming. The WoW API is however highly related, since it's pretty much what oUF works as a wrapper on top of.

There isn't too much about "health/power text" on the pages because it's simply values returned from API calls. You call UnitPower(unit) to fetch the current power value and UnitPowerMax(unit) to fetch the maximum. This then just get formatted and displayed into a fontstring. There isn't really much more to it than that.

The easiest way to do text is just to abuse tags, as it disconnects you from much of the update handling:
Lua Code:
  1. local siValue = function(val)
  2.     if(val >= 1e6) then
  3.         return ('%.1f'):format(val / 1e6):gsub('%.', 'm')
  4.     elseif(val >= 1e4) then
  5.         return ("%.1f"):format(val / 1e3):gsub('%.', 'k')
  6.     else
  7.         return val
  8.     end
  9. end
  10.  
  11. oUF.Tags['lily:health'] = function(unit)
  12.     if(not UnitIsConnected(unit) or UnitIsDead(unit) or UnitIsGhost(unit)) then return end
  13.  
  14.     local min, max = UnitHealth(unit), UnitHealthMax(unit)
  15.     if(not UnitIsFriend('player', unit)) then
  16.         return siValue(min)
  17.     elseif(min ~= 0 and min ~= max) then
  18.         return '-' .. siValue(max - min)
  19.     else
  20.         return max
  21.     end
  22. end
  23. oUF.TagEvents['lily:health'] = oUF.TagEvents.missinghp

All that being said. oUF puts the bar damn high. It was never meant as a "easy" and "straightforward" solution to making unit frames in WoW. It was written to I didn't have to copy/paste code between my various layout experiments.

If you don't want to invest time and brain power into writing/updating your own layout, then I suggest you change to another unit frame add-on or hire someone who will.

I'm trying to not be an ass about this, but you aren't really in the group of intended users (which in all honestly consists of one person; me).
__________________
「貴方は1人じゃないよ」
  Reply With Quote
08-10-10, 01:27 PM   #58
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Code:
-- Health Function
local updateHealth = function(health, unit, min, max)
        if(max ~= 0) then
                r, g, b = self.ColorGradient(min/max, .69,.31,.31, .65,.63,.35, .33,.59,.33)
        end
 
        if(not UnitIsConnected(unit)) then
                health:SetValue(0)
                health.value:SetText('|cffD7BEA5'..'Offline')
        elseif(unit == 'targettarget' or unit == 'pet' or unit == 'focus') then
                health.value:SetText()
        elseif(UnitIsDead(unit)) then
                health.value:SetText('|cffD7BEA5'..'Dead')
        elseif(UnitIsGhost(unit)) then
                health.value:SetText('|cffD7BEA5'..'Ghost')
        else
                if(min~=max) then
                        health.value:SetFormattedText("|cffAF5050%d|r |cffD7BEA5-|r |cff%02x%02x%02x%d%%|r", (min), r*255, g*255, b*255, (min/max)*100)
               
                else
                        health.value:SetText('|cff559655'..(max))
                end
        end
 
        -- BarColor
        if(max ~= 0)then
          x,y,z = self.ColorGradient((min/max), .65,.25,.25, .25,.25,.25, .25,.25,.25)
        else
          x,y,z = .25,.25,.25
        end
          health:SetStatusBarColor(x,y,z)
end
 
-- Power Function
local updatePower = function(power, unit, min, max)
        if(min == 0 or UnitIsDead(unit) or UnitIsGhost(unit) or unit == 'pet' or unit == 'focus' or not UnitIsConnected(unit)) then
          power.value:SetText()
        else
          power.value:SetFormattedText((min))
        end
        local _, pType = UnitPowerType(unit)
        local color = self.colors.power[pType]
        if(color) then power.value:SetTextColor(color[1], color[2], color[3]) end
end
try this

with
hp.PostUpdate = updateHealth
and
pp.PostUpdate = updatePower

not tested though.
  Reply With Quote
08-10-10, 02:04 PM   #59
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Rostok View Post
Code:
-- Health Function
local updateHealth = function(health, unit, min, max)
        if(max ~= 0) then
                r, g, b = self.ColorGradient(min/max, .69,.31,.31, .65,.63,.35, .33,.59,.33)
        end
 
        if(not UnitIsConnected(unit)) then
                health:SetValue(0)
                health.value:SetText('|cffD7BEA5'..'Offline')
        elseif(unit == 'targettarget' or unit == 'pet' or unit == 'focus') then
                health.value:SetText()
        elseif(UnitIsDead(unit)) then
                health.value:SetText('|cffD7BEA5'..'Dead')
        elseif(UnitIsGhost(unit)) then
                health.value:SetText('|cffD7BEA5'..'Ghost')
        else
                if(min~=max) then
                        health.value:SetFormattedText("|cffAF5050%d|r |cffD7BEA5-|r |cff%02x%02x%02x%d%%|r", (min), r*255, g*255, b*255, (min/max)*100)
               
                else
                        health.value:SetText('|cff559655'..(max))
                end
        end
 
        -- BarColor
        if(max ~= 0)then
          x,y,z = self.ColorGradient((min/max), .65,.25,.25, .25,.25,.25, .25,.25,.25)
        else
          x,y,z = .25,.25,.25
        end
          health:SetStatusBarColor(x,y,z)
end
 
-- Power Function
local updatePower = function(power, unit, min, max)
        if(min == 0 or UnitIsDead(unit) or UnitIsGhost(unit) or unit == 'pet' or unit == 'focus' or not UnitIsConnected(unit)) then
          power.value:SetText()
        else
          power.value:SetFormattedText((min))
        end
        local _, pType = UnitPowerType(unit)
        local color = self.colors.power[pType]
        if(color) then power.value:SetTextColor(color[1], color[2], color[3]) end
end
try this

with
hp.PostUpdate = updateHealth
and
pp.PostUpdate = updatePower

not tested though.
doesnt work, sorry thanks for the help.. anyways this was my last post about help people doesnt seem to like it.. and they think its very annyoing since your a noob, and dont know anything about LUA or API
  Reply With Quote
08-10-10, 02:28 PM   #60
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
I don't think haste was being mean, he just would like to point that you should learn the basics in lua and coding a bit before asking questions, like most of the oUF users did while haste provided us these UF.
I did not know anything in lua before trying oUF, and i learned most of the few things i know now when i was studying layouts from others (like p3lim, Freeb).

Try lots of different solutions and when you're really out of idea, ask for help.

And for the code i put, i'm like you learning all the time (much slower since i quit playing) so there will obvsiously be lots of error.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Help with 1.4 oUF


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