Thread Tools Display Modes
11-14-10, 01:29 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Spawning party without visibility attribute

haste stated that spawning the party should be possible without using the visibility attribute which is the third attribute of the party header spawn.

Here is the code to spawn a party without the visibility attribute but with a seperate toggle. That will fix the party flickering for now.

Full code including toggle:
lua Code:
  1. [code]  
  2.   if cfg.units.party.show then
  3.     oUF:RegisterStyle("diablo:party", createStyle)
  4.     oUF:SetActiveStyle("diablo:party")
  5.    
  6.     local party = oUF:SpawnHeader(
  7.       "oUF_DiabloPartyHeader",
  8.       nil,
  9.       nil, --"solo,party", --visibility argument
  10.       "showSolo", cfg.units.party.showsolo, --debug
  11.       "showParty", true,
  12.       "showPlayer", true,
  13.       "point", "LEFT",
  14.       "oUF-initialConfigFunction", ([[
  15.         self:SetWidth(%d)
  16.         self:SetHeight(%d)
  17.         self:SetScale(%f)
  18.       ]]):format(128, 64, cfg.units.party.scale)
  19.     )
  20.     party:SetPoint(cfg.units.party.pos.a1,cfg.units.party.pos.af,cfg.units.party.pos.a2,cfg.units.party.pos.x,cfg.units.party.pos.y)    
  21.     party:Show()
  22.          
  23.     local toggle = CreateFrame("Frame")
  24.     toggle:RegisterEvent("PLAYER_LOGIN")
  25.     toggle:RegisterEvent("RAID_ROSTER_UPDATE")
  26.     toggle:RegisterEvent("PARTY_LEADER_CHANGED")
  27.     toggle:RegisterEvent("PARTY_MEMBER_CHANGED")
  28.     toggle:SetScript("OnEvent", function(self)
  29.       if(InCombatLockdown()) then
  30.         self:RegisterEvent("PLAYER_REGEN_ENABLED")
  31.       else
  32.         self:UnregisterEvent("PLAYER_REGEN_ENABLED")
  33.         if(GetNumRaidMembers() > 0) then
  34.           party:Hide()
  35.         else
  36.           party:Show()
  37.         end
  38.       end
  39.     end)
  40.    
  41.   end
  42. [/code]
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 11-15-10 at 05:14 AM.
  Reply With Quote
11-15-10, 03:48 AM   #2
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by zork View Post
haste stated that spawning the party should be possible without using the visibility attribute which is the third attribute of the party header spawn.

Here is the code to spawn a party without the visibility attribute but with a seperate toggle. That will fix the party flickering for now.

Full code including toggle:
lua Code:
  1. [code]  
  2.   if cfg.units.party.show then
  3.     oUF:RegisterStyle("diablo:party", createStyle)
  4.     oUF:SetActiveStyle("diablo:party")
  5.    
  6.     local party = oUF:SpawnHeader(
  7.       "oUF_DiabloPartyHeader",
  8.       nil,
  9.       nil, --"solo,party",
  10.       "showSolo", cfg.units.party.showsolo, --debug
  11.       "showParty", true,
  12.       "showPlayer", true,
  13.       "point", "LEFT",
  14.       "oUF-initialConfigFunction", ([[
  15.         self:SetWidth(%d)
  16.         self:SetHeight(%d)
  17.         self:SetScale(%f)
  18.       ]]):format(128, 64, cfg.units.party.scale)
  19.     )
  20.     party:SetPoint(cfg.units.party.pos.a1,cfg.units.party.pos.af,cfg.units.party.pos.a2,cfg.units.party.pos.x,cfg.units.party.pos.y)    
  21.     party:Show()
  22.          
  23.     local toggle = CreateFrame("Frame")
  24.     toggle:RegisterEvent("PLAYER_LOGIN")
  25.     toggle:RegisterEvent("RAID_ROSTER_UPDATE")
  26.     toggle:RegisterEvent("PARTY_LEADER_CHANGED")
  27.     toggle:RegisterEvent("PARTY_MEMBER_CHANGED")
  28.     toggle:SetScript("OnEvent", function(self)
  29.       if(InCombatLockdown()) then
  30.         self:RegisterEvent("PLAYER_REGEN_ENABLED")
  31.       else
  32.         self:UnregisterEvent("PLAYER_REGEN_ENABLED")
  33.         if(GetNumRaidMembers() > 0) then
  34.           party:Hide()
  35.         else
  36.           party:Show()
  37.         end
  38.       end
  39.     end)
  40.    
  41.   end
  42. [/code]
Im gonna try this when i come home, i wanted to get this damn flickering away but, i've tryed the previous once that where posted, but didnt work really.

hmm it doesnt seem to work for me.

here is my party code

Code:
oUF:RegisterStyle('Aftermathh', func)

oUF:Factory(function(self)
  oUF:SetActiveStyle'Aftermathh'
  
    self:Spawn'player':SetPoint('BOTTOMLEFT', UIParent, 196, 182)
    self:Spawn'target':SetPoint('BOTTOMRIGHT', UIParent, -237, 184)
    self:Spawn'targettarget':SetPoint('RIGHT', UIParent, -75, -189) 
    self:Spawn'focus':SetPoint('LEFT', UIParent, 108, -45)
    self:Spawn'focustarget':SetPoint('LEFT', UIParent, 17, -3)
    self:Spawn'pet':SetPoint('LEFT', UIParent, 105, -156)
	
	local party = self:SpawnHeader('AftermathhParty', nil, 'party,solo',
		'showParty', true,
		'showPlayer', false,
		'showSolo', false,
		'xoffset', 12,
		'yOffset', -52,
		'oUF-initialConfigFunction', [[
			self:SetHeight(27)
			self:SetWidth(150)
			self:SetScale(0.95)
		]]
	)
	party:SetPoint('TOPLEFT', UIParent, 10, -20)
	party:Show()
   
    local toggle = CreateFrame("Frame")
    toggle:RegisterEvent("PLAYER_LOGIN")
    toggle:RegisterEvent("RAID_ROSTER_UPDATE")
    toggle:RegisterEvent("PARTY_LEADER_CHANGED")
    toggle:RegisterEvent("PARTY_MEMBER_CHANGED")
    toggle:SetScript("OnEvent", function(self)
      if(InCombatLockdown()) then
        self:RegisterEvent("PLAYER_REGEN_ENABLED")
      else
        self:UnregisterEvent("PLAYER_REGEN_ENABLED")
        if(GetNumRaidMembers() > 0) then
          party:Hide()
        else
          party:Show()
        end
      end
    end)
	
    if bossframes then
        local boss = {}
        for i = 1, MAX_BOSS_FRAMES do
            local unit = self:Spawn("boss"..i, "oUF_AftermathhBoss"..i)

            if i==1 then
                unit:SetPoint("CENTER", 500, 200)
            else
                unit:SetPoint("TOPLEFT", boss[i-1], "BOTTOMLEFT", 0, -10)
            end
            boss[i] = unit
        end
    end
end)

Last edited by Aftermathhqt : 11-15-10 at 05:24 AM.
  Reply With Quote
11-15-10, 05:40 AM   #3
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
mmo-champion have just posted that patch 4.0.3 should hit live servers this week. If this is true then it should include the Blizzard-side fix to stop the flickering on header units.
  Reply With Quote
11-15-10, 06:31 AM   #4
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
i hope so.
  Reply With Quote
11-15-10, 08:14 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Game the third argument has to be nil.
You don't do that, you still use visibility by using 'party,solo'
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
11-18-10, 02:38 AM   #6
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by zork View Post
Game the third argument has to be nil.
You don't do that, you still use visibility by using 'party,solo'
Aha, okey, but anyways patch fixed it. thanks anyways
  Reply With Quote
11-18-10, 02:46 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Indeed. Removed my workaround aswell.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Spawning party without visibility attribute


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