• 0

    posted a message on Unofficial oUF - methods used for layouts
    Hello-

    I like have the "range" function on my target. I tried using the following code snippet on my target - but unless I am targeting MYSELF any target "fades" even though I am standing right next to them.

    This function seems to work on the party frames - what am I missing?

    Thanks for the help.

    	if(unit == "target" or not unit) then
    		self.Range = true
    		self.inRangeAlpha = 1
    		self.outsideRangeAlpha = .5
    	end
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I have this in my updateHealth function:

     local pvp = ""
    	if UnitIsPVP(unit) then
    		pvp = "[PvP]"
        end


    I am not surprised that when my PvP flag goes DOWN and my health is not actively changing the PvP flag stays up. As soon as my health changes the PvP notification text goes away.

    How can I "register" an event that looks for this change without having to have my health updated?

    Thanks for the help!
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from Caellian »

    Oh thanks, missread Tex for Text, one last thing, cuz i didn't find on wowwiki, how do i read/understand (0.57, 0.90, 0.08, 0.41), because it's obviously not colors, or coordinates so.


    I can help with this one - I asked the same a long time ago. Those are color representations using the 0-1 format. Instead of doing RGB 0-255 they divide each number by 255 and display the decimal.

    So - 255 would be 255/255 = 1. The fourth number is optional, it is the transparency of the color.

    Hope this helps!
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from 8izips »

    if you add event, it will work instantly.
    This event is called when blizzard basic ui option (HIDE_PARTY_INTERFACE) is changed.

    partyToggle:RegisterEvent("CVAR_UPDATE")




    I found this to be inconsistent - it actually got out of synch somehow - as I clicked on and off it had the opposite effect - unchecking the "hide party in raid" would hide the party, checking it would show party - and I had trouble getting rid of the partytargets (didn't have pets in my party to know if they had a problem).

    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from Zariel »

    @8izips

    Why delete and recreate each frame? Hide() and showing really should work and i see no reason other to the fact that maybe oUF does a frame:Show() in some function.


    As I posted - for some reason it doesn't work.

    Thanks 8izips - I will try this

    EDIT: @ 8izips: This works - but I need to ReloadUI to get it to change - is this the expected behavior or should it turn them on/off instantly?
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from Zariel »

    Spawn has the arguments: unit, name, isPet. So for spawning pets you want a true at the end. I dont think you need to hide the frames as oUF should do that for you, but frame:Hide() and frame:Show() should still apply.





    The true must be by default, because like I said they spawn perfectly. The firs code posting works perfectly - they frames spawn while in party.

    The second code posting shows 2 methods I have tried using to HIDE the frames. In my code right before the 2nd code posting is party:Hide() - which works great - the party frames HIDE but the partyPets and partytargets are still displayed.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from Zariel »

    you should append true to the spawn function which indicates that it is a pet


    Hmm - I am not sure what you mean. They spawn fine, I am trying to create a function to hide them. Sorry for being thick, I am a Lua newbie.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Hi- I am having some trouble hiding my partypet and partytarget frames. They are spawned as such:

    local pets = {}
    pets[1] = oUF:Spawn("partypet1", "oUF_PartyPet1")
    pets[1]:SetPoint("TOPRIGHT", party, "TOPRIGHT", 0, -44)
    for i =2, 4 do
    	pets[i] = oUF:Spawn("partypet"..i, "oUF_PartyPet"..i)
    	pets[i]:SetPoint("TOP", pets[i-1], "BOTTOM", 0, -50)
    end
    
    local pts = {}
    pts[1] = oUF:Spawn("party1target", "oUF_Party1Target")
    pts[1]:SetPoint("TOPLEFT", party, "TOPRIGHT", 5, 0)
    for i =2, 4 do
    	pts[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    	pts[i]:SetPoint("TOP", pts[i-1], "BOTTOM", 0, -50)
    end


    I have tried several methods of hiding them to no avail.

    	   for i =1, 4 do
    	    pets[i]:Hide()
    	    pts[i]:Hide()
    	   end
    
    and
    
           for i =1, 4 do
    	    oUF:Hide("partypet"..i)
    	    oUF:Hide("party"..i.."target")
    	   end


    Any help would be appreciated!
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from haste »

    You do a :SetPoint at line 412, so you have to use :ClearAllPoints().


    Thank you Haste! And another thank you for creating this framework. I have learned quite a bit about Lua from messing with these frames, something I would never have done if I had continued using PitBull. I know there is still a long road ahead before I "really" understand what is going on.

    Thanks!

    edited to properly reference the Lua programming language :)
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from p3lim »

    *cough*

    hp.value:SetPoint("CENTER", hp)



    *puke*



    Something is modifying I believe in Ammo's setup - LEFT LEFT seems to force it into place.

    The culprit - Ammo's getFontString function. Seems I need to rewrite everything, which I wanted to do anyways :)

    local function getFontString(parent)
    	local fs = parent:CreateFontString(nil, "OVERLAY")
    	fs:SetFont(font, fontHeight)
    	fs:SetShadowColor(0,0,0)
    	fs:SetShadowOffset(0.8, -0.8)
    	fs:SetTextColor(1,1,1)
    	fs:SetJustifyH("LEFT")
    	return fs
    end


    All text is getting SetJustifyH("LEFT") - DOH!
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from Krag72 »

    if unit == "targettarget" then 
      hp.value:SetFont(font_ital, fontHeight-2) 
      hp.value:SetPoint("CENTER", hp, "CENTER") 
      hp.value:SetJustifyH("CENTER") 
    end

    I think :)


    I keep trying that - I think there is something else changing the position. As I am editing Ammo's code I admit to not knowing 100% of what is going on.



    When I try

    hp.value:SetPoint("LEFT", hp, "CENTER") 


    it is closer - but something keeps moving it RIGHT it seems after the centering.



    And consider me BAFFLED - the following seems to work:

     hp.value:SetPoint("LEFT", hp, "LEFT") 




    I don't understand why this is working. But it is lol.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Thanks Haste - that did the trick.

    I am hoping someone can take a look at my pastey - line 416 - I am having MUCH trouble getting the health text to center exactly on the targettarget frame.

    I know it is my noobish hack ways - perhaps someone can take a peek?

    Me Pastey Linky
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    It is sad, yes, I know, but I admit defeat. I am having trouble figuring out the changes needed to now get the pet happiness to display.

    So far I have not seen anyone update their layouts yet to capture this change. I have read this thread and I admit not having the correct number of cells aligned in the proper order to get this to work.

    I will continue scratching the hair off of my already balding head, but if someone could throw me a very descriptive bone here I would be most appreciative. I am using oUF_Ammo as the "base" for my layout.

    Thanks in advance for any help providide, /duck, /cover and /hide for any snide comments such as "L2LUA" or similar.

    Posted in: Unit Frames
  • 0

    posted a message on Centering Text in a frame
    Quote from Slakah »

    :SetJustifyH("CENTER")


    Thank you very much!
    Posted in: Lua Code Discussion
  • 0

    posted a message on Centering Text in a frame
    Hello-

    I am attempting to make my health text centered on an oUF frame. I figured this was a general coding question so I would post it here.

    I had thought textobject:SetPoint("CENTER", <frame>, "CENTER", 0,0) would translate into: "The center point of the text object to be placed in the center of the <frame> with no offsets".

    What I get is the text on the RIGHT of the frame.

    Do I need to manually calculate an offset based on the number of characters in the textobject I am trying to center? Perhaps there is no "center" of a text string?

    Thanks for any help...

    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.