• 0

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

    party is not defined, so you cant do that..

    in the function every unit is known.

    party and raid tho, they are not units, theyre headers.

    so that means, if its not unit then its a party/raid. see?

    myself, i use two diffrent functions for party and raid :)


    I can see clearly now 8) oh, hi.

    Ye, makes sence :) thanks :]
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    if I want to make another abouw that "if not unit then" shall I then write "if not unit or party then"

    end
    ?
    Posted in: Unit Frames
  • 0

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

    either anchor it differently or write different SetPoint's for party frames.
    if not unit then
    .. code here ..
    end



    thanks I'll try that :)
    Posted in: Unit Frames
  • 0

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

    You can remove that line, as it does nothing :).


    oh, hehe :p thanks xD
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I have a small problem. I wrote this

    local PvP = pp:CreateTexture(nil, "OVERLAY")
    PvP:SetPoint("BOTTOM", hp, "TOP", -72, -36)
    PvP:SetHeight(20)
    PvP:SetWidth(20)
    PvP:SetTexture"PvP"
    self.PvP = PvP


    it works perfectly and is exactly where I want it to be on my unitframe, but its way of the party frame, how do I make a different tho still the same setup for only party to be placed att the correct spot?
    Posted in: Unit Frames
  • 0

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

    Like Slakah said, learn the Tutorials from WoWWiki and other sites, and then try and make your own addons. They don't have to do much, just to get the hang of it. The absolute best way to learn is by doing it yourself.

    Other addons that might be helpful in learning are evl's and Lolzen's:
    http://evladdons.googlecode.com/
    http://fizz.googlecode.com/


    thanks alot :) I will absolutely check it out!
    Posted in: Unit Frames
  • 0

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

    It proberly doesnt work because your not calling the function anywhere. Just because it is in the file doesnt mean that it is called anywhere, COPYPASTA isnt going to make imba unit frames unless you understand what your doing and why your doing it and what effect it will have. Seriously go use pitbull.


    I managed to do it without copypasting now. and seriously if you're not going to give me any good advice sence Im a novice on this you can just shut it. Ty..
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Okay Im sitting here trying to make this PvP and leader mode working. I copied it from Coldfurys layout.

    local updateLeader = function(self, unit) 
    	if (unit) then 
    		if unit == "player" then 
    			if IsPartyLeader() then 
    				self.Leader:SetText("[Ldr]") 
    			end 
    		elseif (GetNumPartyMembers()) then 
    			local partyleader = GetPartyLeaderIndex() 
    			local partyunit = "party"..partyleader 
    			if unit == partyunit then 
    				self.Leader:SetText("[Ldr]") 
    			else 
    				self.Leader:SetText("") 
    			end 
    		else 
    			self.Leader:SetText("") 
    		end 
    	end 
    end 
    
    local updatePvp = function(self, unit) 
    	if (unit) then 
    		if unit == "pet" or unit == "pettarget" or unit == "targettarget" then 
    			self.Pvp:SetText("") 
    		elseif UnitIsPlayer(unit) and UnitIsPVP(unit) then 
    			self.Pvp:SetText("P") 
    		else 
    			self.Pvp:SetText("") 
    		end 
    	end 
    end 


    I putted it here

    local updateLevel = function(self, event, unit)
    	if(self.unit ~= unit) then return end
    	if(unit == "player") then return nil end
    	
    	local lvl = self.Lvl
    	local level = UnitLevel(unit)
    	local classification = UnitClassification(unit)
    
    	if(classification=="worldboss") then
    		lvl:SetText("|cffff0000Boss|r")
    	elseif(classification=="rareelite") then
    		lvl:SetText(level.."+ Rare")
    	elseif(classification=="elite") then
    		lvl:SetText(level.."+")
    	elseif(classification=="rare") then
    		lvl:SetText(level.." Rare")
    	else
    		lvl:SetText(level)
    	end
    
    	if (UnitCanAttack("player", unit)) then
    		local color = getDifficultyColor(level)
    		lvl:SetTextColor(color.r, color.g, color.b)
    	else
    		lvl:SetTextColor(1.0, 1.0, 1.0)
    	end
    
    end
    
    local updateLeader = function(self, unit) 
    	if (unit) then 
    		if unit == "player" then 
    			if IsPartyLeader() then 
    				self.Leader:SetText("[Ldr]") 
    			end 
    		elseif (GetNumPartyMembers()) then 
    			local partyleader = GetPartyLeaderIndex() 
    			local partyunit = "party"..partyleader 
    			if unit == partyunit then 
    				self.Leader:SetText("[Ldr]") 
    			else 
    				self.Leader:SetText("") 
    			end 
    		else 
    			self.Leader:SetText("") 
    		end 
    	end 
    end 
    
    local updatePvp = function(self, unit) 
    	if (unit) then 
    		if unit == "pet" or unit == "pettarget" or unit == "targettarget" then 
    			self.Pvp:SetText("") 
    		elseif UnitIsPlayer(unit) and UnitIsPVP(unit) then 
    			self.Pvp:SetText("P") 
    		else 
    			self.Pvp:SetText("") 
    		end 
    	end 
    end 
    
    local menu = function(self)
    	local unit = self.unit:sub(1, -2)
    	local cunit = self.unit:gsub("(.)", string.upper, 1)
    
    	if(unit == "party" or unit == "partypet") then
    		ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
    	elseif(_G[cunit.."FrameDropDown"]) then
    		ToggleDropDownMenu(1, nil, _G[cunit.."FrameDropDown"], "cursor", 0, 0)
    	end
    end
    
    local updateName = function(self, event, unit)
      if(self.unit == unit or (not unit and self.unit)) then
       local u = unit or self.unit
       local name = UnitName(u)
       if not name then return end
       if UnitIsTapped(u) and not UnitIsTappedByPlayer(u) or not UnitIsConnected(u) then
         self.Name:SetTextColor(.6, .6, .6)
       else
         self.Name:SetTextColor(1, 1, 1)
       end
    
       if u ~= "targettarget" then
         updateLevel(self, event, u)
       end
       
       if u == "target" then
         local index = GetRaidTargetIndex(u)
         if index then
          self.Name:SetText(ICON_LIST[index].."22|t"..name)
         else
          self.Name:SetText(name)
         end
       elseif self:GetParent():GetName():sub(1, 8) == "oUF_Raid" then
         self.Name:SetText(name:sub(1,4))
       else
         self.Name:SetText(name)
       end
      end
    end


    I dont get any error messages but at the same time I dont get the "P" to show up on my unitframe either. Anyone knows what Im doing wrong?
    Posted in: Unit Frames
  • 0

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

    best method is trial and error and looking at other ppl's code tbh.


    maybe but I get confused like hell when trying! (but I wont give up)

    Quote from zariel »

    If you know lua and take the time to understand what oUF does then it becomes very easy.


    how do you learn to know lua? is it like tiana said? trial and error?
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Where do you learn to make these codes and where to put em? Im trying and trying and gets more confused by the second :/ i really wanna learn how to do it but its so confusing ^^
    Posted in: Unit Frames
  • 0

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

    local combat = self:CreateFontString(nil, "OVERLAY")
    combat:SetFont(font, size)
    combat:SetText("C")
    combat:SetPoint("CENTER")
    self.Combat = combat



    thanks but where should I put that?
    Posted in: Unit Frames
  • 0

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

    oUF_Banzai should do that.


    thanks I saw that abit later :)
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I cant get the PvP flagging to work and Im wondering if there is a way to make your unitframe turn red if someone is targeting you? I've checked Coldfurys lua but I dont get where to put what xD I found this and guessing it might be atleast the pvp flagging thingie tho where should I put it?
    local updatePvp = function(self, unit) 
      if (unit) then 
        if unit == "pet" or unit == "pettarget" or unit == "targettarget" then 
          self.Pvp:SetText("") 
        elseif UnitIsPlayer(unit) and UnitIsPVP(unit) then 
          self.Pvp:SetText("[PvP]") 
        else 
          self.Pvp:SetText("") 
        end 
      end 
    end 


    and if there is a way to get some kind of combat notification on the bars like a C that turns visiable when you enter combat.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Thanks for the help :) I will remember to copy the whole code next time, as I mentioned before Im super new to this so Im on the very beginning of the long road so I guess you'll see me post quite some newbie questions here :] (I will ofc look for an answer before posting!)
    Posted in: Unit Frames
  • 0

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

    Gotta start somewhere :)


    ye :]

    I've gotten like everything to work except when I left the bg this error message came up. Anyone know what it might be?

    Interface\AddOns\oUF_Lolzen\layout.lua:104:bad argument #1 to 'strsub' (string expected, got nil)

    most be something with this:

    elseif(self:GetParent():GetName():sub(1, 8 ) =="oUF_Raid") then
    self.Name:SetText(strsub(name,0,4))

    because I cant find anything else with strsub in it :p if it helps some?
    Posted in: Unit Frames
  • To post a comment, please or register a new account.