• 0

    posted a message on Unofficial oUF - methods used for layouts
    Hmm it's just pMinimap, nothing else there.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I'm not sure to understand what you mean.

    See in my previous post, if someone from group 4 leave the raid (group 4 is resized with one less player) then the whole groups 6 and 8 will go up of one raid frame, what i want is to have each group to have their position and not move if someone leave. and i'm sure i've seen somewhere that it's doable without anchoring every groups to UIParent.

    It's hard to explain.

    I've got a screenshot i'll edit in a sec



    In the screenshot someone from group 1 left the raid, now see how group 3, 5 and 7 are gone up of one raid frame; well i'd like to prevent that and have 3, 5 and 7 at their original position even if someone from group 1 left.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I'm trying to have my raid displayed like this

    Group 1 Group 2
    Group 3 	 Group 4
    Group 5	  Group 6
    Group 7	 Group 8


    It's pretty easy but the issue i'm having is, when someone from group 2 leave the raid, the groups 4, 6 and 8 are going up from one "player frame"

    Here's how it's done now and semi working.

    local raid = {}
    for i = 1, 8 do
    	local raidgroup = oUF:Spawn('header', 'oUF_Raid'..i)
    	raidgroup:SetManyAttributes('groupFilter', tostring(i), 'showRaid', true, 'yOffSet', -4)
    	table.insert(raid, raidgroup)
    	if(i==1) then
    		raidgroup:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
    	elseif(i==2) then
    		raidgroup:SetPoint('TOPLEFT', raid[i-1], 'TOPRIGHT', 8, 0)
    	else
    		raidgroup:SetPoint('TOPLEFT', raid[i-2], 'BOTTOMLEFT', 0, -15)
    	end
    	raidgroup:Show()
    end


    I'd like each group to stick to its original position, to achieve that, do i have to anchor all groups separately to UIParent ?
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I only briefly tested but Aesyl's code seems to do the trick, Coldfury's doesn't, i'll log for the night and test some more tomorrow, thanks both.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Aight, that was working with an error and now it's not working anymore

    local PartyTargetsCreated = false
    local partytarget = {}
    function CreatePartyTargets()
    	if not PartyTargetsCreated then
    		partytarget[1] = oUF:Spawn("party1target", "oUF_Party1Target")
    		partytarget[1]:SetPoint("TOPLEFT", party, "TOPRIGHT", 8, 0)
    		for i = 1, 5 do
    			partytarget[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    			partytarget[i]:SetPoint("TOP", partytarget[i-1], "BOTTOM", 0, -4)
    		end
    		PartyTargetsCreated = true
    	end
    end
    
    function DeletePartyTargets()
    	if PartyTargetsCreated then
    		for key, object in ipairs(partytarget) do
    			UnregisterUnitWatch(object)
    				object:Hide()
    		end
    		PartyTargetsCreated = false
    	end
    end


    I think i will just remove this until i understand it better. Gonna spend some time on that wiki i guess.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Meh, it was too good to be true, but i had to restart the game completely to have the error pop up

    Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:606: attempt to concatenate global 'i' (a nil value)

    local PartyTargetsCreated = false
    local partytarget = {}
    function CreatePartyTargets()
    	if not PartyTargetsCreated then
    		partytarget[1] = oUF:Spawn("party1target", "oUF_Party1Target")
    		partytarget[1]:SetPoint("TOPLEFT", party, "TOPRIGHT", 8, 0)
    		for key, object in ipairs(partytarget) do
    			RegisterUnitWatch(object)
    			partytarget[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target") -- LINE 606
    			partytarget[i]:SetPoint("TOP", partytarget[i-1], "BOTTOM", 0, -4)
    		end
    		PartyTargetsCreated = true
    	end
    end
    Posted in: Unit Frames
  • 0

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

    I hate forums even more now. :(


    You hate forums but we love you, makes a difference i'm sure of it... or not ;)
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Got everything working and hiding just fine now, thanks again Haste.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    i was googling RegisterUnitWatch and found a layout with that feature but apparently it doesn't work, seems i'm not the only one having the issue, damn i don't even use those frames, though i admit it could be usefull.

    local PartyTargetsCreated = false;
    local partytarget = {}
    function CreatePartyTargets()
    	if not PartyTargetsCreated then
    		partytarget[1] = oUF:Spawn("party1target", "oUF_Party1Target")
    		partytarget[1]:SetPoint("TOPLEFT", party, "TOPRIGHT", 8, 0)
    		for i =2, 4 do
    			partytarget[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    			partytarget[i]:SetPoint("TOP", partytarget[i-1], "BOTTOM", 0, -4)
    		end
    		PartyTargetsCreated = true;
    	end
    end
    
    function DeletePartyTargets()
    	if PartyTargetsCreated then
    		for i = 1, 4 do
    			UnregisterUnitWatch(partytarget);
    			partytarget:Hide();
    		end
    		PartyTargetsCreated = false;
    	end
    end
    
    local partyToggle = CreateFrame("Frame")
    partyToggle:SetScript("OnEvent", function(self)
      if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED")
      else self:UnregisterEvent("PLAYER_REGEN_ENABLED")
       if(HIDE_PARTY_INTERFACE=="1" and GetNumRaidMembers() > 0) then
         party:Hide()
         DeletePartyTargets()
       elseif (GetNumPartyMembers() > 0) then
         party:Show()
         CreatePartyTargets()
       end
      end
    end)
    
    partyToggle:RegisterEvent("PARTY_MEMBERS_CHANGED")
    partyToggle:RegisterEvent("PARTY_LEADER_CHANGED")
    partyToggle:RegisterEvent("RAID_ROSTER_UPDATE")
    partyToggle:RegisterEvent("PLAYER_LOGIN")
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Aesyl and P3lim, none of those 3 solutions worked

    local PartyTargets = {}
    for i = 1, 5 do
    	PartyTargets[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    	PartyTargets[i]:SetAttribute('showRaid', false)
    	if i == 1 then
    		PartyTargets[1]:SetPoint("TOPLEFT", party, "TOPRIGHT", 8, 0)
    	else
    		PartyTargets[i]:SetPoint("TOP", PartyTargets[i-1], "BOTTOM", 0, -4)
    	end
    end


    if(GetNumRaidMembers() > 0) then
    	party:Hide()
    	for i = 1, 5 do
    		PartyTargets[i]:Hide()
    	end
    else
    	party:Show()
    	for i = 1, 5 do
    		PartyTargets[i]:Show()
    	end
    end


    for _, i in ipairs(partytarget) do
    	i:Hide()
    end


    Test situation, join a party, ask someone in range to pick a target, switch to raid group.

    Their target should dissapear when switching but it doesn't.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I'm having a small problem here, i've been asked several time to add party target to my layout.
    Here's the code i use
    local partytarget = {}
    partytarget[1] = oUF:Spawn("party1target", "oUF_Party1Target")
    partytarget[1]:SetPoint("TOPLEFT", party, "TOPRIGHT", 8, 0)
    for i =2, 4 do
    	partytarget[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    	partytarget[i]:SetPoint("TOP", partytarget[i-1], "BOTTOM", 0, -4)
    end


    My party targets spawn just fine but the thing is, if i am in a party and then join an Arathi basin for example which is a raid, those partytarget frames are still displayed, i can't find out why.
    I've tried to add partytarget:Hide() and :Show() following the same rules as my current party:Hide() and :Show() to my partyToggle
    		if(GetNumRaidMembers() > 0) then
    			party:Hide()
    		else
    			party:Show()
    		end


    But that doesn't work.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Hmm why the ?
    x? -- matches 0 or 1 occurrence of x


    Where's it's placed it affect the .
    If there's no . there's nothing to hide, right or ?
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    So this will hide values like the .0 from 10.0m but not from 10.01m if i understand right, how about values like 2.00m is it possible to include it in the same ?
    Like hide any occurence of 0 after . only of there's nothing after. I'm staring at the "Constructing a pattern" on wowwi but.

    Edit: that would be
    ('%.0+([km])$', '%1')
    can anyone confirm ?
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    You mean
    ('%.0(k|m)$', '%1')


    But that doesn't work, 7047 is displayed as 7.0k, 10977 as 11.0k

    Even saw a 2.00m on Kalecgos a minute ago :(
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Though so, ah well, why not :)

    Reporting from above and edited.

    I'm using "for example" this, to format health values:
    return ('%.1fm'):format(value / 1e6):gsub('%.0', '')


    And the gsub part to ensure a value like 11.0k will be displayed as 11k instead.
    Is there a way to modify the gsub part to make sure it won't hide a value such as 10.01 ?, i'm not sure if this could happen so.
    Posted in: Unit Frames
  • To post a comment, please or register a new account.