WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF - Layout discussion (https://www.wowinterface.com/forums/showthread.php?t=18363)

p3lim 09-28-09 07:49 AM

Quote:

Originally Posted by Icerat (Post 160366)
Back again sorry:

I have the following to show my experience bar and it works great does all i expected it to do, hide until mouse over and show a tooltip on my player.

For some reason though it wont show a bar for my hunters pet (pets not max lvl nor is me hunter)

Code:

-- EXPERIENCE BAR --
        if(IsAddOnLoaded('oUF_Experience') and (unit == 'player' or unit == 'pet')) then
                        self.Experience = CreateFrame('StatusBar', nil, self)
                        self.Experience:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 5)
                        self.Experience:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 5)
                                if(unit == "pet") then
                                        self.Experience:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -25)
                                        self.Experience:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -25)
                                end
                        self.Experience:SetHeight(3)
                        self.Experience:SetStatusBarTexture(texture2)
                        self.Experience:SetStatusBarColor(0.15, 0.7, 0.1)
                        self.Experience.Tooltip = true
                       
                        self.Experience.Rested = CreateFrame('StatusBar', nil, self)
                        self.Experience.Rested:SetParent(self.Experience)  -- Parent to the Experiance bar to get it to hide
                        self.Experience.Rested:SetAllPoints(self.Experience)
                        self.Experience.Rested:SetStatusBarTexture(texture2)
                        self.Experience.Rested:SetStatusBarColor(0, 0.4, 1, 0.6)
                        self.Experience.Rested:SetBackdrop(backdrop)
                        self.Experience.Rested:SetBackdropColor(0, 0, 0)

--                        self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallOutline')
--                        self.Experience.Text:SetPoint('CENTER', self.Experience)

                        self.Experience.bg = self.Experience.Rested:CreateTexture(nil, 'BORDER')
                        self.Experience.bg:SetAllPoints(self.Experience)
                        self.Experience.bg:SetTexture(0.3, 0.3, 0.3)
                       
                        self.Experience:SetScript ('OnEnter', function(self) self:SetAlpha(1) end)
                        self.Experience:SetScript ('OnLeave', function(self) self:SetAlpha(0) end)
                        self.Experience:SetAlpha(0)
                end

What am i doing wrong? bets its something stupid, thanks in advance

You sure the pet aint the same level as the player?

Icerat 09-28-09 01:20 PM

At some point i swapped the reputation and experience code around for some reason and never noticed the loss of the pet experience bar, it was only after going through a few previous revision back ups that i noticed what i did, working code below:

Code:

-- REPUTATION BAR --               
        if(IsAddOnLoaded("oUF_Reputation")) then
                        self.Reputation = CreateFrame("StatusBar", nil, self)
                if(IsAddOnLoaded("oUF_Experience") and UnitLevel("player") ~= MAX_PLAYER_LEVEL) then
                                self.Reputation:SetPoint("BOTTOM", self, "TOP", 0, 12)
                        else
                                self.Reputation:SetPoint('BOTTOM', self, 'TOP', 0, 5) -- RepBar Position Once at max LvL
                end
                        self.Reputation:SetHeight(3)
                        self.Reputation:SetWidth(width)               
                        self.Reputation:SetStatusBarTexture(texture2)
                        self.Reputation:SetBackdrop(backdrop)
                        self.Reputation:SetBackdropColor(0,0,0)       
                        self.Reputation.PostUpdate = PostUpdateReputation
                       
--                        self.Reputation.Text = self.Reputation:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallOutline')
--                        self.Reputation.Text:SetPoint('CENTER', self.Reputation)

                        self.Reputation.bg = self.Reputation:CreateTexture(nil, "BORDER")
                        self.Reputation.bg:SetAllPoints(self.Reputation)
                        self.Reputation.bg:SetTexture(0.3, 0.3, 0.3)
                       
                        self.Reputation:SetScript ('OnEnter', function(self) self:SetAlpha(1) end)
                        self.Reputation:SetScript ('OnLeave', function(self) self:SetAlpha(0) end)
                        self.Reputation:SetAlpha(0)
                       
                        self.Reputation.Tooltip = true       
                end               
        end

-- EXPERIENCE BAR --
        if(IsAddOnLoaded('oUF_Experience') and (unit == 'player' or unit == 'pet')) then
                        self.Experience = CreateFrame('StatusBar', nil, self)
                        self.Experience:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 5)
                        self.Experience:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 5)
                                if(unit == "pet") then
                                        self.Experience:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, -25)
                                end
                        self.Experience:SetHeight(3)
                        self.Experience:SetStatusBarTexture(texture2)
                        self.Experience:SetStatusBarColor(0.15, 0.7, 0.1)
                        self.Experience.Tooltip = true
                       
                        self.Experience.Rested = CreateFrame('StatusBar', nil, self)
                        self.Experience.Rested:SetParent(self.Experience)  -- Parent to the Experiance bar to get it to hide
                        self.Experience.Rested:SetAllPoints(self.Experience)
                        self.Experience.Rested:SetStatusBarTexture(texture2)
                        self.Experience.Rested:SetStatusBarColor(0, 0.4, 1, 0.6)
                        self.Experience.Rested:SetBackdrop(backdrop)
                        self.Experience.Rested:SetBackdropColor(0, 0, 0)

--                        self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallOutline')
--                        self.Experience.Text:SetPoint('CENTER', self.Experience)

                        self.Experience.bg = self.Experience.Rested:CreateTexture(nil, 'BORDER')
                        self.Experience.bg:SetAllPoints(self.Experience)
                        self.Experience.bg:SetTexture(0.3, 0.3, 0.3)
                       
                        self.Experience:SetScript ('OnEnter', function(self) self:SetAlpha(1) end)
                        self.Experience:SetScript ('OnLeave', function(self) self:SetAlpha(0) end)
                        self.Experience:SetAlpha(0)
        end

I don't understand fully why this made a difference but it did, i can only figure that it has something to do with the following in the Reputation bar code that sets the position of the rep bar at max lvl when the exp bar is no longer needed.
Code:

                if(IsAddOnLoaded("oUF_Experience") and UnitLevel("player") ~= MAX_PLAYER_LEVEL) then
                                self.Reputation:SetPoint("BOTTOM", self, "TOP", 0, 12)
                        else
                                self.Reputation:SetPoint('BOTTOM', self, 'TOP', 0, 5) -- RepBar Position Once at max LvL
                end

As my knowledge improves I'm sure ill figure it out lol :)

Another question, whats the differeance between

Code:

self.Auras:SetPoint("BOTTOMRIGHT", self, 30, 0)
Code:

self.Auras:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 30, 0)
From what I've observed the first put the aura icon where i want it 30 away from the bottom right edge of my target frame and the second puts it 30 away from the top right edge of the frame.

My question is why not use the first example, why do the various layouts I've looked at use the second example, whats the point of the "BOTTOMRIGHT" in the second example?

As always thanks for the responses and i look forward to learning from them.

haste 09-28-09 11:12 PM

Quote:

Originally Posted by Icerat (Post 160436)
Another question, whats the differeance between

Code:

self.Auras:SetPoint("BOTTOMRIGHT", self, 30, 0)
Code:

self.Auras:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 30, 0)
From what I've observed the first put the aura icon where i want it 30 away from the bottom right edge of my target frame and the second puts it 30 away from the top right edge of the frame.

My question is why not use the first example, why do the various layouts I've looked at use the second example, whats the point of the "BOTTOMRIGHT" in the second example?

As always thanks for the responses and i look forward to learning from them.

Code:

self.Auras:SetPoint("BOTTOMRIGHT", self, 30, 0)
is the same as
Code:

self.Auras:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 30, 0)
http://wowprogramming.com/docs/widgets/Region/SetPoint

PaleSamurai 09-29-09 01:40 PM

simeple question:

what do i put in to make the health numbers show the full value like 10,000 instead of 10k?

Icerat 09-29-09 03:07 PM

Quote:

Originally Posted by p3lim (Post 160371)
You sure the pet aint the same level as the player?

Sorry not sure what you mean, what do you mean by same level?

v6o 09-30-09 02:40 AM

Quote:

Originally Posted by PaleSamurai (Post 160548)
simeple question:

what do i put in to make the health numbers show the full value like 10,000 instead of 10k?

Using oUF_Lily as example

Code:

local updateHealth = function(self, event, unit, bar, min, max)    if(UnitIsDead(unit)) then
        bar:SetValue(0)
        bar.value:SetText"Dead"
    elseif(UnitIsGhost(unit)) then
        bar:SetValue(0)
        bar.value:SetText"Ghost"
    elseif(not UnitIsConnected(unit)) then
        bar.value:SetText"Offline"
    else
        if(not UnitIsFriend('player', unit)) then
            bar.value:SetFormattedText('%s', siValue(min))
        elseif(min ~= 0 and min ~= max) then
            bar.value:SetFormattedText("-%s", siValue(max - min))
        else
            bar.value:SetText(max)
        end
    end
 
    bar:SetStatusBarColor(.25, .25, .35)
    updateName(self, event, unit)
end

The red should be changed to just min and max - min

PaleSamurai 09-30-09 08:46 AM

The red should be changed to just min and max - min[/quote]

ok i got it all set thanks a bunch

Aerials 10-01-09 01:03 PM

anyone know a layout with party frames spawned individually i could check out? trying to figure how to spawn rames as follows:

party3 party1 player target party2 party4

v6o 10-01-09 01:20 PM

Quote:

Originally Posted by Aerials (Post 160765)
anyone know a layout with party frames spawned individually i could check out? trying to figure how to spawn rames as follows:

party3 party1 player target party2 party4



Something like this.

Code:

-- This defines the position

local player = oUF:Spawn("player")
player:SetPoint("TOPRIGHT", UIParent, "CENTER", -3, 0)

-- going left

local party1 = oUF:Spawn("party1")
 party1:SetPoint("RIGHT", player, "LEFT", -6, 0)

local party3 = oUF:Spawn("party3")
  party3:SetPoint("RIGHT", party1, "LEFT", -6, 0)

-- going right

local target = oUF:Spawn("target")
target:SetPoint("LEFT", player, "RIGHT", 3, 0)

local party2 = oUF:Spawn("party2")
 party2:SetPoint("LEFT", target, "RIGHT", 6, 0)

local party4 = oUF:Spawn("party4")
  party4:SetPoint("LEFT", party2, "RIGHT", 6, 0)


Aerials 10-01-09 01:42 PM

thanks, i'll give it a try.... just wasn't sure if there was naming or something i needed to know. was gonna be trying this:

Code:

local partymember = {}
for i = 1, 4 do
        local party = oUF:Spawn('oUF_Party'..i)

        party:SetManyAttributes(

                'showParty', true,

                "template", "oUF_TestingParty"

        )

        table.insert(partymember, party)
        if(i==1) then
                partymember[i]:SetPoint('RIGHT', player, 'LEFT', -30, 0)
        elseif(i==2) then
                partymember[i]:SetPoint('LEFT', target, 'RIGHT', 30, 0)
        elseif(i==3) then
                partymember[i]:SetPoint('RIGHT', partymember[1], 'LEFT', -30, 0)
        elseif(i==4) then
                partymember[i]:SetPoint('LEFT', partymember[2], 'RIGHT', 30, 0)
        end
end

but no idea if it would have worked at all.
lol, didn work fully..... gonna try a couple more times this way thn try it your way

well.... doesnt seem like either way is working well, the way i was doing it gives me 4 party groups (all the same group), then they way you said doesn't do anything..... I really don't know much about the way the groups are spawned and there's no documentation for ouf anywhere and info on the actual wow api for it is incredibly lacking.

giakaama 10-01-09 03:08 PM

Hi i couldn't read 61 pages and the search tool didn't get me any results so i'll ask !

Is there a way to make the player border frame glow red when you are targeted by an hostile ?

v6o 10-01-09 03:16 PM

I think oUF_Freebgrid and a few other use UnitThreatSituation(friendlyunit)==3

Afraid I don't have an example.

Waverian 10-01-09 05:47 PM

Probably just register your own UNIT_THREAT_SITUATION_UPDATE event and manipulate your border color in that function.

giakaama 10-02-09 02:03 AM

Quote:

Originally Posted by Waverian (Post 160795)
Probably just register your own UNIT_THREAT_SITUATION_UPDATE event and manipulate your border color in that function.

Hmmm interesting, never thought of that ... thank you ! :)

yj589794 10-02-09 05:01 AM

In my raid frames I have a small corner indicator for showing who has threat using the UNIT_THREAT_SITUATION_UPDATE event. It shouldn't be difficult to change it to colour the border instead.

Have a look here:
http://github.com/Evilpaul/oUF_EPRaid

haste 10-06-09 12:22 AM

I've decided to close this thread due to the following reasons:
1. It's insanely large
2. Searching it for information is close to impossible.
3. There is a entire forum dedicated to oUF here, yet people use this thread even though I've recommended people not to several times.

If something you posted here hasn't been answered -- make a new thread. Your question might have been absorbed in the mess that this thread is.


All times are GMT -6. The time now is 01:26 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI