Thread Tools Display Modes
12-20-10, 04:15 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Bossframe spawn

You have probably recognized the Blizzard boss frames underneath the minimap.

Can anyone share a working bossframe spawn for oUF 1.5.x / WoW Patch 4.0.1?

In my old layout I did sth like this
Code:
  if showbossframes == 1 then
    oUF:SetActiveStyle("oUF_D3Orbs2_boss")
    local boss = {}
    for i = 1, MAX_BOSS_FRAMES do
      boss[i] = oUF:Spawn("boss"..i, "oUF_Boss"..i)        
      if i==1 then
        boss[i]:SetPoint("TOP", Minimap, "BOTTOM", 0, -150)
      else
        boss[i]:SetPoint("TOP", boss[i-1], "BOTTOM", 0, -60)
      end
    end
  end
Is sth like this still the way to go?
__________________
| 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 : 12-20-10 at 04:17 AM.
  Reply With Quote
12-20-10, 04:36 AM   #2
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
I'm using the same code and I get no errors but no boss frames too.
Also, if anyone has an easy way to test boss frames, please share. I'm thinking on asking my guildies to go with me to ICC 'till the gunship but this is a lot of trouble.
  Reply With Quote
12-20-10, 04:52 AM   #3
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
They doesnt spawn for me either.. no errors.
  Reply With Quote
12-20-10, 07:05 AM   #4
Monolit
A Black Drake
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 81
Hm, weird
I've been to Grim Batol yesterday and my boss frames seem to work just fine on every boss (yes you don't need to go to ICC to test it).
I'm using pretty much the same method, but I'm doing that via oUF:Factory() function.

Code:
    self:SetActiveStyle("monoBoss")
    local boss = {}
    for i = 1, MAX_BOSS_FRAMES do
      boss[i] = self:Spawn("boss"..i, "oUF_Boss"..i)
	  boss[i]:SetScale(cfg.PABscale)
      if i == 1 then
        boss[i]:SetPoint(unpack(cfg.BOpos))
      else
        boss[i]:SetPoint("BOTTOMRIGHT", boss[i-1], "BOTTOMRIGHT", 0, gap)
      end
    end
  Reply With Quote
12-20-10, 07:44 AM   #5
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
The only change I had to make on my boss frames was removing the 'initial-width' and 'initial-height' attributes and using SetSize() instead.
There was no change as to how the frames were spawned.

https://github.com/Evilpaul/oUF_EP/b...oUF_EPBoss.lua
  Reply With Quote
12-20-10, 08:29 PM   #6
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
I tried everything, just can't make the boss frame to show up.
My last resource was trying to copy EvilPaul's code but still "nada", no errors and no boss frames either.

The problem may be jumping and flapping his arms right in my face but i can't figure it out. I'm pasting the code for my frame creation so if you guys could please take a look at it I'll be eternally in your debt.

Code:
  local addon, ns = ...
  
  local cfg = ns.cfg
  local lib = ns.lib
  
  -----------------------------
  -- STYLE FUNCTIONS
  -----------------------------
  
-- Menus
local dropdown = CreateFrame("Frame", "MyAddOnUnitDropDownMenu", UIParent, "UIDropDownMenuTemplate")

UIDropDownMenu_Initialize(dropdown, function(self)
	local unit = self:GetParent().unit
	if not unit then return end

	local menu, name, id
	if UnitIsUnit(unit, "player") then
		menu = "SELF"
	elseif UnitIsUnit(unit, "vehicle") then
		menu = "VEHICLE"
	elseif UnitIsUnit(unit, "pet") then
		menu = "PET"
	elseif UnitIsPlayer(unit) then
		id = UnitInRaid(unit)
		if id then
			menu = "RAID_PLAYER"
			name = GetRaidRosterInfo(id)
		elseif UnitInParty(unit) then
			menu = "PARTY"
		else
			menu = "PLAYER"
		end
	else
		menu = "TARGET"
		name = RAID_TARGET_ICON
	end
	if menu then
		UnitPopup_ShowMenu(self, menu, unit, name, id)
	end
end, "MENU")

local menu = function(self)
	dropdown:SetParent(self)
	ToggleDropDownMenu(1, nil, dropdown, "cursor", 0, 0)
end

UnitSpecific = {
	player = function(self)
		-- unit specifics
		self.mystyle = "player"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		lib.addPortrait(self)
		
		-- Set frame size
		self:SetScale(cfg.frameScale)
		self:SetWidth(250)
		self:SetHeight(53)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		if cfg.portrait then
			self.Health:SetSize(250, 33)
		else
			self.Health:SetSize(250, 43)
		end
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', 0, 0)
		if cfg.portrait then
			self.Power:SetSize(250, 15)
		else
			self.Power:SetSize(250, 8)
		end
		self.Power.colorTapping = true
		self.Power.colorDisconnected = true
		self.Power.colorClass = true
		self.Power.bg.multiplier = 0.3
		
		lib.addTextTags(self, 17)
		
		lib.addIcons(self)
		
		lib.addClassBar(self)
		
		-- Buffs and Debuffs
		if cfg.showPlayerAuras then
			--BuffFrame:Hide()
			lib.addBuffs(self, cfg.auras.BUFFPOSITIONS.player)
			lib.addDebuffs(self,cfg.auras.DEBUFFPOSITIONS.player)
		end
		
		lib.addCastBar(self, true)
		
		-- Plugins
		lib.addCombatFeedback(self)
		lib.addXPBar(self)
		lib.addRepBar(self)
	end,

	target = function(self)
		-- unit specifics
		self.mystyle = "target"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		lib.addPortrait(self)
		
		-- Set frame size
		self:SetScale(cfg.frameScale)
		self:SetWidth(250)
		self:SetHeight(53)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		if cfg.portrait then
			self.Health:SetSize(250, 33)
		else
			self.Health:SetSize(250, 43)
		end
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', 0, 0)
		if cfg.portrait then
			self.Power:SetSize(250, 15)
		else
			self.Power:SetSize(250, 8)
		end
		self.Power.colorTapping = true
		self.Power.colorDisconnected = true
		self.Power.colorHappiness = false
		self.Power.colorReaction = true
		self.Power.colorClass = true
		self.Power.bg.multiplier = 0.3
		
		lib.addTextTags(self, 17)
		
		lib.addIcons(self)
		
		lib.addBuffs(self, cfg.auras.BUFFPOSITIONS.target)
		lib.addDebuffs(self,cfg.auras.DEBUFFPOSITIONS.target)
		
		lib.addCastBar(self, true)

		-- Plugins
		lib.addCombatFeedback(self)
	end,
	
	pet = function(self)
		-- unit specifics
		self.mystyle = "pet"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		-- Set frame size
		self:SetScale(cfg.frameScale)
		self:SetWidth(120)
		self:SetHeight(20)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 3)
		self.Power:SetSize(self:GetWidth()-7, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)
		
		lib.addBuffs(self, cfg.auras.BUFFPOSITIONS.pet)
		
		lib.addCastBar(self, true)

	end,
	
	pettarget = function(self)
		-- unit specifics
		self.mystyle = "pettarget"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		-- Set frame size
		self:SetScale(cfg.frameScale)
		self:SetWidth(120)
		self:SetHeight(20)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 3)
		self.Power:SetSize(self:GetWidth()-7, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)
	end,

	targettarget = function(self)
		-- unit specifics
		self.mystyle = "targettarget"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		-- Set frame size
		self:SetScale(cfg.frameScale)
		self:SetWidth(120)
		self:SetHeight(20)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 3)
		self.Power:SetSize(self:GetWidth()-7, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)
	end,

	focus = function(self)
		-- unit specifics
		self.mystyle = "focus"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		-- Set frame size
		self:SetScale(cfg.frameScale)
		self:SetWidth(250)
		self:SetHeight(20)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 3)
		self.Power:SetSize(self:GetWidth()-7, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)
		
		lib.addBuffs(self, cfg.auras.BUFFPOSITIONS.focus)
		lib.addDebuffs(self,cfg.auras.DEBUFFPOSITIONS.focus)
		
		lib.addCastBar(self, true)
	end,
	
	focustarget = function(self)
		-- unit specifics
		self.mystyle = "focustarget"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		-- Set frame size
		self:SetScale(cfg.frameScale)
		self:SetWidth(120)
		self:SetHeight(20)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 3)
		self.Power:SetSize(self:GetWidth()-7, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)
	end,
	
	boss = function(self)
		-- unit specifics
		self.mystyle = "boss"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		self:SetSize(250, 20)
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 3)
		self.Power:SetSize(self:GetWidth()-7, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)
	end,
	
	raid = function(self)
		-- unit specifics
		self.mystyle = "raid"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		self.Range = {
			insideAlpha = 1,
			outsideAlpha = .3,
		}
		
		-- Set statusbars specifics
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))

		self.Health.frequentUpdates = true
		
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 2)
		self.Power:SetSize(self:GetWidth()-6, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)
		lib.addAuraWatch(self)
		lib.addDebuffHighlight(self)
		
		-- Event hooks
		self:RegisterEvent('PLAYER_TARGET_CHANGED', lib.changedTarget)
		self:RegisterEvent('RAID_ROSTER_UPDATE', lib.changedTarget)
		self:RegisterEvent("UNIT_THREAT_LIST_UPDATE", lib.updateAggro)
		self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", lib.updateAggro)
	end,
}

local Style = function(self, unit, isSingle)
	self:RegisterForClicks('AnyUp')
	self.menu = menu
	self:SetAttribute("*type2", "menu")

	if UnitSpecific[unit] then
		return UnitSpecific[unit](self)
	end
end

  -----------------------------
  -- SPAWN UNITS
  -----------------------------

oUF:RegisterStyle('drk', Style)
oUF:RegisterStyle('drkBoss', Style)

oUF:Factory(function(self)
	-- Single Frames
	self:SetActiveStyle('drk')
	
	self:Spawn('player'):SetPoint("BOTTOMRIGHT", UIParent, cfg.playerRelativePoint, cfg.playerX, cfg.playerY)
	self:Spawn('target'):SetPoint("BOTTOMLEFT", UIParent, cfg.targetRelativePoint, cfg.targetX, cfg.targetY)
	if cfg.showTot then self:Spawn('targettarget'):SetPoint("BOTTOMRIGHT",oUF_drkTarget,"TOPRIGHT", 0, 8) end
	if cfg.showPet then self:Spawn('pet'):SetPoint("BOTTOMLEFT",oUF_drkPlayer,"TOPLEFT", 0, 8) end
	if cfg.showPetTarget then self:Spawn('pettarget'):SetPoint("BOTTOMRIGHT",oUF_drkPlayer,"TOPRIGHT", 0, 8) end
	if cfg.showFocus then self:Spawn('focus'):SetPoint("BOTTOMLEFT",oUF_drkTarget,"TOPLEFT", 0, 36) end
	if cfg.showFocusTarget then self:Spawn('focustarget'):SetPoint("BOTTOMLEFT",oUF_drkTarget,"TOPLEFT", 0, 8) end
	
	-- Raid/Party Frames
	if cfg.showRaid then
		CompactRaidFrameContainer:Hide()
		local maxGroups = 5
		if cfg.raidShowAllGroups then maxGroups = 8 end
		self:SetActiveStyle('drk')
		local raid = oUF:SpawnHeader("oUF_Raid", nil, "solo,party,raid", 
		"showRaid", cfg.showRaid,  
		"showPlayer", true,
		"showSolo", cfg.raidShowSolo,
		"showParty", cfg.showParty,
		"xoffset", 9,
		"yOffset", 5,
		"groupFilter", "1,2,3,4,5,6,7,8",
		"groupBy", "GROUP",
		"groupingOrder", "1,2,3,4,5,6,7,8",
		"sortMethod", "INDEX",
		"maxColumns", maxGroups,
		"unitsPerColumn", 5,
		"columnSpacing", 7,
		"point", "LEFT",
		"columnAnchorPoint", cfg.raidAnchorPoint,
		"oUF-initialConfigFunction", ([[
		self:SetWidth(%d)
		self:SetHeight(%d)
		]]):format(72, 28))
		raid:SetScale(cfg.raidScale)
		raid:SetPoint("BOTTOMLEFT", UIParent, cfg.raidRelativePoint, cfg.raidX, cfg.raidY)
	end

	-- Boss frames
	if cfg.showBossFrames then
		self:SetActiveStyle('drkBoss')
		local bossFrames = {}
		for i = 1, MAX_BOSS_FRAMES do
			local unit = self:Spawn('boss' .. i)
			if i > 1 then
				unit:SetPoint('BOTTOMLEFT', bossFrames[i - 1], 'TOPLEFT', 0, 8)
			else
				unit:SetPoint('BOTTOMLEFT', oUF_drkTarget, 'TOPLEFT', 0, 60) 
			end
			bossFrames[i] = unit
		end
	end
end)
edit: Yes, cfg.showBossFrames is set to true.

Last edited by drakull : 12-20-10 at 08:32 PM.
  Reply With Quote
12-21-10, 12:35 AM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
The unitid for the boss units will be bossN, where N is a number, not boss. They're single-spawns, not header.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
12-21-10, 07:50 AM   #8
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Hmmm... so i think it's best to use a dedicated style funcion for boss frames.

Thanks a lot, ill give it a try.

Update: worked like a charm. YAY!

Last edited by drakull : 12-21-10 at 09:54 AM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Bossframe spawn


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