Thread Tools Display Modes
02-05-12, 09:30 AM   #1
frohanss
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 40
Grouping / Sorting Question

Hello,

Im trying to make a layout where it doesn't "merge all players".

If a player is missing in group 3 i whant it to leave a open spot in group 3 instead of just continue group 4 in that spot.

Code:
	local raid25 = oUF:SpawnHeader("oUF_Raid25", nil, "custom [@raid26,exists] hide; [@raid11,exists] show; hide",
		"showRaid", true,  
		"showPlayer", true,
		"showSolo", Viks["unitframes"].RaidShowSolo,
		"showParty", Viks["unitframes"].ShowParty,
		"xoffset", 5,
		"yOffset", 5,
		"groupFilter", "1,2,3,4,5,6,7,8",
		"groupBy", "GROUP",
		"groupingOrder", "1,2,3,4,5,6,7,8",
		"sortMethod", "GROUP",
		"maxColumns", 8,
		"unitsPerColumn", 5,
		"columnSpacing", 2,
		"point", "LEFT",
		"columnAnchorPoint", "Bottom",
		"oUF-initialConfigFunction", ([[
		self:SetWidth(%d)
		self:SetHeight(%d)
		]]):format(cfg.RH25width, cfg.RH25height))
		self:SetActiveStyle("Raid")
		raid25:SetPoint("CENTER", UIParent, 5, 205)
Tryed different settings but no luck so far.

Anyone?

Regards
  Reply With Quote
02-05-12, 11:42 AM   #2
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
I do this by spawning a separate header for each group:
https://github.com/Evilpaul/oUF_EP/b...PRaid.lua#L238
  Reply With Quote
02-11-12, 02:08 PM   #3
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by yj589794 View Post
I do this by spawning a separate header for each group:
https://github.com/Evilpaul/oUF_EP/b...PRaid.lua#L238
Doesn't work for me O.o Just getting 19 pages of errors.

LUA Code:
  1. oUF:RegisterStyle('Aftermathh_Raid', RaidFrames)
  2. oUF:Factory(function(self)
  3.     self:SetActiveStyle('Aftermathh_Raid')
  4.    
  5.     local toStr = tostring
  6.    
  7.     if AftermathhUI.ouf.showraid == true then
  8.         for group = 1, NUM_RAID_GROUPS do
  9.             local Raid = self:SpawnHeader("AftermathhRaidGrid", nil, 'solo,party,raid',
  10.                 'showPlayer', true,
  11.                 'showRaid', true,
  12.                 'showParty', true,
  13.                 'showSolo', true,
  14.                 'xoffset', 7,
  15.                 'yOffset', 0,
  16.                 'point', 'LEFT',
  17.                 'groupFilter', toStr(group),
  18.                 'groupingOrder', '1,2,3,4,5,6,7,8',
  19.                 'groupBy', 'GROUP',
  20.                 'sortMethod', 'GROUP',
  21.                 'maxColumns', 5,
  22.                 'unitsPerColumn', 5,
  23.                 'columnSpacing', 6,
  24.                 'columnAnchorPoint', 'TOP',
  25.                 'oUF-initialConfigFunction', [[
  26.                     self:SetWidth(59)
  27.                     self:SetHeight(38)
  28.                     self:SetScale(1)
  29.                 ]]
  30.             )  
  31.             Raid:SetPoint('LEFT', UIParent, 221, -54)
  32.         end    
  33.     end
  34. end)
  Reply With Quote
02-11-12, 03:20 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Game92 View Post
errors
What? Where?
  Reply With Quote
02-11-12, 08:26 PM   #5
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Phanx View Post
What? Where?
When i try the code yj589794 uses for this.
  Reply With Quote
02-11-12, 11:11 PM   #6
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
The spawning of the headers should be fairly generic as long as you make sure the config values are defined for your layout:
Code:
local toStr = tostring

local function spawnFunction(self)
	self:SetActiveStyle('oUF_EPRaid')

	-- define the raid groups
	local raid = {}
	for group = 1, NUM_RAID_GROUPS do
		local header = self:SpawnHeader(nil, nil, 'party,raid',
						'showPlayer', true,
						'showParty', true,
						'showRaid', true,
						'groupFilter', toStr(group),
						'yOffset', -config.SPACING,
						'oUF-initialConfigFunction', ([[
							local unit = ...
							self:SetWidth(%d)
							self:SetHeight(%d)
						]]):format(config.RAIDUNITWIDTH, config.UNITHEIGHT)
		)

		if group > 1 then
			header:SetPoint('TOPLEFT', raid[group - 1], 'TOPRIGHT', config.SPACING, 0)
		else
			header:SetPoint('TOPLEFT', UIParent, 'BOTTOMLEFT', 15, 350)
		end
		raid[group] = header
	end
end
  Reply With Quote
02-11-12, 11:45 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Game92 View Post
When i try the code yj589794 uses for this.
I meant, what are the errors? If you're going to post that you're getting errors, please post the actual errors. Usually only the first error from the same addon is relevant, as all the following errors are caused by the first, so you can just post the first error.
  Reply With Quote
02-12-12, 10:01 AM   #8
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Phanx View Post
I meant, what are the errors? If you're going to post that you're getting errors, please post the actual errors. Usually only the first error from the same addon is relevant, as all the following errors are caused by the first, so you can just post the first error.
Code:
Message: ...terface\AddOns\oUF_Aftermathh\oUF_AftermathhRaid.lua:13: Wrong object type for member function
Time: 02/12/12 17:00:41
Count: 7
Stack: [C]: ?
[C]: ?
Interface\FrameXML\RestrictedFrames.lua:604: in function <Interface\FrameXML\RestrictedFrames.lua:603>
Interface\FrameXML\RestrictedFrames.lua:742: in function `CallMethod'
[string "		local header = self:GetParent()..."]:52: in function <[string "		local header = self:GetParent()..."]:1>
(tail call): ?
[C]: ?
Interface\FrameXML\RestrictedExecution.lua:441: in function <Interface\FrameXML\RestrictedExecution.lua:412>
Interface\FrameXML\SecureGroupHeaders.lua:108: in function <Interface\FrameXML\SecureGroupHeaders.lua:102>
Interface\FrameXML\SecureGroupHeaders.lua:158: in function <Interface\FrameXML\SecureGroupHeaders.lua:115>
Interface\FrameXML\SecureGroupHeaders.lua:457: in function <Interface\FrameXML\SecureGroupHeaders.lua:381>
[C]: in function `Show'
Interface\FrameXML\SecureStateDriver.lua:100: in function <Interface\FrameXML\SecureStateDriver.lua:95>
Interface\FrameXML\SecureStateDriver.lua:164: in function <Interface\FrameXML\SecureStateDriver.lua:146>
[C]: in function `SetAttribute'
Interface\FrameXML\SecureStateDriver.lua:11: in function `RegisterAttributeDriver'
Interface\AddOns\oUF\ouf.lua:540: in function `SpawnHeader'
...terface\AddOns\oUF_Aftermathh\oUF_AftermathhRaid.lua:199: in function `func'
Interface\AddOns\oUF\factory.lua:17: in function <Interface\AddOns\oUF\factory.lua:13>
(tail call): ?

Locals: <none>
  Reply With Quote
02-12-12, 07:05 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
And what is line 13 in oUF_AftermathhRaid.lua?
  Reply With Quote
02-13-12, 06:27 AM   #10
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Phanx View Post
And what is line 13 in oUF_AftermathhRaid.lua?
LUA Code:
  1. self:SetScript('OnLeave', UnitFrame_OnLeave)
  Reply With Quote
02-13-12, 07:09 PM   #11
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You're going to have to post the whole file... unless your code is overwriting the :SetScript method somewhere else, I can't see how that line of code could produce that error.
  Reply With Quote
02-14-12, 03:00 AM   #12
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Phanx View Post
You're going to have to post the whole file... unless your code is overwriting the :SetScript method somewhere else, I can't see how that line of code could produce that error.
Indeed, don't see how the error is made really.

LUA Code:
  1. if AftermathhUI.ouf.showraid == false then return end
  2.  
  3. local parent, ns = ...
  4. local oUF = ns.oUF or oUF
  5.  
  6. local function RaidFrames(self, unit)
  7.     if AftermathhUI.ouf.dropdownmenu == true then
  8.         self.menu = CreateDropDown
  9.     end
  10.     self:RegisterForClicks('AnyDown')
  11.     if AftermathhUI.ouf.tooltiponraid == true then
  12.         self:SetScript('OnEnter', UnitFrame_OnEnter)
  13.         self:SetScript('OnLeave', UnitFrame_OnLeave)
  14.     end
  15.     self:SetAttribute('*type2', 'menu')
  16.    
  17.     self:SetBackdrop({
  18.         bgFile = AftermathhUI.media.blank,
  19.         insets = {top = -1, left = -1, bottom = -1, right = -1},
  20.     })
  21.     self:SetBackdropColor(0, 0, 0, 0.4)
  22.  
  23.     self.Health = CreateFrame('StatusBar', nil, self)
  24.     self.Health:SetStatusBarTexture(AftermathhUI.media.texture)
  25.     if AftermathhUI.ouf.custombarcoloronraid == true then
  26.         self.Health:SetStatusBarColor(unpack(AftermathhUI.ouf.healthbarcolorraid))
  27.     end
  28.     self.Health:SetParent(self)
  29.     self.Health:SetAllPoints(self)
  30.     self.Health.Smooth = true
  31.     self.Health.frequentUpdates = true
  32.     if AftermathhUI.ouf.custombarcoloronraid == false then
  33.         self.Health.colorClass = true
  34.     end
  35.     --CreateBorderLight(self.Health, AftermathhUI.media.bordersize-1, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 2)
  36.    
  37.     if AftermathhUI.ouf.raidframesvertical == true then
  38.         self.Health:SetOrientation('VERTICAL')
  39.     end
  40.  
  41.     self.Health.bg = self.Health:CreateTexture(nil, 'BORDER')
  42.     self.Health.bg:SetAllPoints(self.Health)
  43.     self.Health.bg:SetTexture(AftermathhUI.media.texture)
  44.     self.Health.bg:SetVertexColor(0,0,0,0.6)
  45.    
  46.     local HealthText = self.Health:CreateFontString(nil, 'OVERLAY')
  47.     HealthText:SetFont(AftermathhUI.media.font3, 11, AftermathhUI.media.fontflag)
  48.     HealthText:SetPoint('TOP', 1, -20)
  49.     if AftermathhUI.media.shadowoffset == true then
  50.         HealthText:SetShadowOffset(1, -1)
  51.         HealthText:SetShadowColor(0,0,0)
  52.     end
  53.     self:Tag(HealthText, '[Aftermathh:Deficit]')
  54.  
  55.     self.Name = self.Health:CreateFontString(nil, 'OVERLAY')
  56.     self.Name:SetPoint('TOP', 0, -6)
  57.     self.Name:SetFont(AftermathhUI.media.font, 11, AftermathhUI.media.fontflag)
  58.     if AftermathhUI.media.shadowoffset == true then
  59.         self.Name:SetShadowOffset(1, -1)
  60.         self.Name:SetShadowColor(0, 0, 0)
  61.     end
  62.     if AftermathhUI.ouf.custombarcoloronraid == true then
  63.         self:Tag(self.Name, '[raidcolor][Aftermathh:RaidName]')
  64.     end
  65.     if AftermathhUI.ouf.custombarcoloronraid == false then
  66.         self:Tag(self.Name, '|cffffffff[Aftermathh:RaidName]|r')
  67.     end
  68.  
  69.     local InvisFrame = CreateFrame("Frame", nil, self)
  70.     InvisFrame:SetFrameStrata("MEDIUM")
  71.     InvisFrame:SetFrameLevel(5)
  72.     InvisFrame:SetAllPoints()
  73.    
  74.     self.MasterLooter = InvisFrame:CreateTexture('$parentMasterLooterIcon', 'OVERLAY', self)
  75.     self.MasterLooter:SetSize(11, 11)
  76.     self.MasterLooter:SetPoint('RIGHT', self.Health, 'TOPRIGHT', 2, 2)
  77.    
  78.     self.Assistant = InvisFrame:CreateTexture(nil, 'OVERLAY', self)
  79.     self.Assistant:SetSize(12, 12)
  80.     self.Assistant:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
  81.    
  82.     self.Leader = InvisFrame:CreateTexture('$parentLeaderIcon', 'OVERLAY', self)
  83.     self.Leader:SetSize(12, 12)
  84.     self.Leader:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
  85.    
  86.     self.RaidIcon = InvisFrame:CreateTexture(nil, 'OVERLAY')
  87.     self.RaidIcon:SetSize(17, 17)
  88.     self.RaidIcon:SetPoint('CENTER', self, 'TOP')
  89.  
  90.     self.ReadyCheck = InvisFrame:CreateTexture(nil, 'OVERLAY')
  91.     self.ReadyCheck:SetSize(31, 25)
  92.     self.ReadyCheck:SetPoint('CENTER')  
  93.     self.ReadyCheck.delayTime = 4
  94.     self.ReadyCheck.fadeTime = 1
  95.    
  96.     if AftermathhUI.ouf.showroleicon == true then
  97.         self.LFDRole = InvisFrame:CreateTexture(nil, 'OVERLAY')
  98.         self.LFDRole:SetPoint('CENTER', self, 'BOTTOM', -1, 1)
  99.         self.LFDRole:SetSize(14, 14)
  100.         self.LFDRole:SetTexture(AftermathhUI.media.lfd)
  101.         self.LFDRole:SetDesaturated(1)
  102.     end
  103.  
  104.     if AftermathhUI.ouf.showaggroonraidframes == true then
  105.         table.insert(self.__elements, UpdateThreatRaid)
  106.         self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateThreatRaid)
  107.         self:RegisterEvent('UNIT_THREAT_LIST_UPDATE', UpdateThreatRaid)
  108.         self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE', UpdateThreatRaid)
  109.     end
  110.  
  111.     if AftermathhUI.ouf.aurawatch == true and AftermathhUI.ouf.gridlayout == true and AftermathhUI.ouf.dpslayout == false then
  112.         CreateAuraWatch(self,unit)
  113.     end
  114.    
  115.     if AftermathhUI.ouf.raiddebuffs == true then
  116.         self.RaidDebuffs = CreateFrame('Frame', nil, self)
  117.         self.RaidDebuffs:SetSize(20, 20)
  118.         self.RaidDebuffs:SetPoint('CENTER', self)
  119.         self.RaidDebuffs:SetFrameStrata('HIGH')
  120.        
  121.         local PerfectBorders = 768/string.match(GetCVar("gxResolution"), "%d+x(%d+)")/0.89999997615814
  122.         self.RaidDebuffs:SetBackdrop({
  123.             bgFile = AftermathhUI.media.borderlight,
  124.             insets = {top = -4+PerfectBorders, left = -4+PerfectBorders, bottom = -4+PerfectBorders, right = -4+PerfectBorders},
  125.         })
  126.  
  127.         self.RaidDebuffs.icon = self.RaidDebuffs:CreateTexture(nil, 'ARTWORK')
  128.         self.RaidDebuffs.icon:SetTexCoord(.07,.93,.07,.93)
  129.         self.RaidDebuffs.icon:SetAllPoints(self.RaidDebuffs)
  130.        
  131.         self.RaidDebuffs.cd = CreateFrame('Cooldown', nil, self.RaidDebuffs)
  132.         self.RaidDebuffs.cd:SetAllPoints(self.RaidDebuffs)
  133.        
  134.         local overlayFrame = CreateFrame("frame", nil, self.RaidDebuffs, nil)
  135.         overlayFrame:SetFrameStrata("HIGH")
  136.         overlayFrame:SetFrameLevel(5)
  137.    
  138.         self.RaidDebuffs.count = self.RaidDebuffs:CreateFontString(nil, 'OVERLAY')
  139.         self.RaidDebuffs.count:SetParent(overlayFrame)
  140.         self.RaidDebuffs.count:SetFont(AftermathhUI.media.font, 12, AftermathhUI.media.fontflag)
  141.         if AftermathhUI.media.shadowoffset == true then
  142.             self.RaidDebuffs.count:SetShadowOffset(1, -1)
  143.             self.RaidDebuffs.count:SetShadowColor(0, 0, 0)
  144.         end
  145.         self.RaidDebuffs.count:ClearAllPoints()
  146.         self.RaidDebuffs.count:SetPoint('TOPRIGHT', self.RaidDebuffs, 2, 3)
  147.     end
  148.    
  149.     if AftermathhUI.ouf.healprediction == true then
  150.         local myBars = CreateFrame('StatusBar', nil, self.Health)
  151.         myBars:SetStatusBarTexture(AftermathhUI.media.texture)
  152.         myBars:SetStatusBarColor(0, 1, 0.5, 0.45)
  153.         myBars:SetSize(55, 38)
  154.         if AftermathhUI.ouf.raidframesvertical == true then
  155.             myBars:SetOrientation("VERTICAL")
  156.             myBars:SetPoint('BOTTOM', self.Health:GetStatusBarTexture(), 'TOP', 0, 0)
  157.             myBars:SetSize(59, 39)
  158.         else
  159.             myBars:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  160.             myBars:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  161.         end
  162.  
  163.         local otherBars = CreateFrame('StatusBar', nil, myBars)
  164.         otherBars:SetStatusBarTexture(AftermathhUI.media.texture)
  165.         otherBars:SetStatusBarColor(0, 0.5, 1, 0.45)
  166.         otherBars:SetSize(55, 38)
  167.         if AftermathhUI.ouf.raidframesvertical == true then
  168.             otherBars:SetOrientation("VERTICAL")
  169.             otherBars:SetPoint('BOTTOM', myBars:GetStatusBarTexture(), 'TOP', 0, 0)
  170.             otherBars:SetSize(59, 39)
  171.         else
  172.             otherBars:SetPoint('TOPLEFT', myBars:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  173.             otherBars:SetPoint('BOTTOMLEFT', myBars:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  174.         end
  175.        
  176.         self.HealPrediction = {
  177.             myBar = myBars,
  178.             otherBar = otherBars,
  179.             maxOverflow = 1,
  180.         }
  181.     end
  182.  
  183.     self.SpellRange = {
  184.         insideAlpha = 1,
  185.         outsideAlpha = 0.3,
  186.     }
  187.  
  188.     return self
  189. end
  190.  
  191. oUF:RegisterStyle('Aftermathh_Raid', RaidFrames)
  192. oUF:Factory(function(self)
  193.     self:SetActiveStyle('Aftermathh_Raid')
  194.    
  195.     if AftermathhUI.ouf.showraid == true then
  196.         if AftermathhUI.ouf.gridlayout == true and AftermathhUI.ouf.dpslayout == false then
  197.             local Raid = self:SpawnHeader("AftermathhRaidGrid", nil, 'solo,party,raid',
  198.                 'showPlayer', true,
  199.                 'showRaid', true,
  200.                 'showParty', true,
  201.                 'showSolo', true,
  202.                 'xoffset', 7,
  203.                 'yOffset', 0,
  204.                 'point', 'LEFT',
  205.                 'groupFilter', '1,2,3,4,5,6,7,8',
  206.                 'groupingOrder', '1,2,3,4,5,6,7,8',
  207.                 'groupBy', 'GROUP',
  208.                 'maxColumns', 5,
  209.                 'unitsPerColumn', 5,
  210.                 'columnSpacing', 6,
  211.                 'columnAnchorPoint', 'TOP',
  212.                 'oUF-initialConfigFunction', [[
  213.                     self:SetWidth(59)
  214.                     self:SetHeight(38)
  215.                     self:SetScale(1)
  216.                 ]]
  217.             )  
  218.             Raid:SetPoint('LEFT', UIParent, 221, -54)
  219.         end
  220.         if AftermathhUI.ouf.gridlayout == false and AftermathhUI.ouf.dpslayout == true then
  221.             local Raid = self:SpawnHeader("AftermathhRaid", nil, 'solo,party,raid',
  222.                 'showPlayer', true,
  223.                 'showRaid', true,
  224.                 'showParty', false,
  225.                 'showSolo', false,
  226.                 'xoffset', 12,
  227.                 'yOffset', -5,
  228.                 'point', 'LEFT',
  229.                 'groupFilter', '1,2,3,4,5,6,7,8',
  230.                 'groupingOrder', '1,2,3,4,5,6,7,8',
  231.                 'groupBy', 'GROUP',
  232.                 'maxColumns', 12,
  233.                 'unitsPerColumn', 5,
  234.                 'columnSpacing', 12,
  235.                 'columnAnchorPoint', 'TOP',
  236.                 'oUF-initialConfigFunction', [[
  237.                     self:SetWidth(45)
  238.                     self:SetHeight(38)
  239.                     self:SetScale(1)
  240.                 ]]
  241.             )  
  242.             Raid:SetPoint('TOPLEFT', UIParent, 10, -9)
  243.         end
  244.     end
  245. end)
  Reply With Quote
02-14-12, 08:21 AM   #13
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Are you sure that the file you posted is the one that caused the error you posted previously?

I can't see any way that the 2 match up
  Reply With Quote
02-14-12, 09:20 AM   #14
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by yj589794 View Post
Are you sure that the file you posted is the one that caused the error you posted previously?

I can't see any way that the 2 match up
Yes it is. This give me errors.

LUA Code:
  1. if AftermathhUI.ouf.showraid == false then return end
  2.  
  3. local parent, ns = ...
  4. local oUF = ns.oUF or oUF
  5.  
  6. local function RaidFrames(self, unit)
  7.     if AftermathhUI.ouf.dropdownmenu == true then
  8.         self.menu = CreateDropDown
  9.     end
  10.     self:RegisterForClicks('AnyDown')
  11.     if AftermathhUI.ouf.tooltiponraid == true then
  12.         self:SetScript('OnEnter', UnitFrame_OnEnter)
  13.         self:SetScript('OnLeave', UnitFrame_OnLeave)
  14.     end
  15.     self:SetAttribute('*type2', 'menu')
  16.    
  17.     self:SetBackdrop({
  18.         bgFile = AftermathhUI.media.blank,
  19.         insets = {top = -1, left = -1, bottom = -1, right = -1},
  20.     })
  21.     self:SetBackdropColor(0, 0, 0, 0.4)
  22.  
  23.     self.Health = CreateFrame('StatusBar', nil, self)
  24.     self.Health:SetStatusBarTexture(AftermathhUI.media.texture)
  25.     if AftermathhUI.ouf.custombarcoloronraid == true then
  26.         self.Health:SetStatusBarColor(unpack(AftermathhUI.ouf.healthbarcolorraid))
  27.     end
  28.     self.Health:SetParent(self)
  29.     self.Health:SetAllPoints(self)
  30.     self.Health.Smooth = true
  31.     self.Health.frequentUpdates = true
  32.     if AftermathhUI.ouf.custombarcoloronraid == false then
  33.         self.Health.colorClass = true
  34.     end
  35.     CreateBorderLight(self.Health, AftermathhUI.media.bordersize-1, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 2)
  36.    
  37.     if AftermathhUI.ouf.raidframesvertical == true then
  38.         self.Health:SetOrientation('VERTICAL')
  39.     end
  40.  
  41.     self.Health.bg = self.Health:CreateTexture(nil, 'BORDER')
  42.     self.Health.bg:SetAllPoints(self.Health)
  43.     self.Health.bg:SetTexture(AftermathhUI.media.texture)
  44.     self.Health.bg:SetVertexColor(0,0,0,0.6)
  45.    
  46.     local HealthText = self.Health:CreateFontString(nil, 'OVERLAY')
  47.     HealthText:SetFont(AftermathhUI.media.font3, 11, AftermathhUI.media.fontflag)
  48.     HealthText:SetPoint('TOP', 1, -20)
  49.     if AftermathhUI.media.shadowoffset == true then
  50.         HealthText:SetShadowOffset(1, -1)
  51.         HealthText:SetShadowColor(0,0,0)
  52.     end
  53.     self:Tag(HealthText, '[Aftermathh:Deficit]')
  54.  
  55.     self.Name = self.Health:CreateFontString(nil, 'OVERLAY')
  56.     self.Name:SetPoint('TOP', 0, -6)
  57.     self.Name:SetFont(AftermathhUI.media.font, 11, AftermathhUI.media.fontflag)
  58.     if AftermathhUI.media.shadowoffset == true then
  59.         self.Name:SetShadowOffset(1, -1)
  60.         self.Name:SetShadowColor(0, 0, 0)
  61.     end
  62.     if AftermathhUI.ouf.custombarcoloronraid == true then
  63.         self:Tag(self.Name, '[raidcolor][Aftermathh:RaidName]')
  64.     end
  65.     if AftermathhUI.ouf.custombarcoloronraid == false then
  66.         self:Tag(self.Name, '|cffffffff[Aftermathh:RaidName]|r')
  67.     end
  68.  
  69.     local InvisFrame = CreateFrame("Frame", nil, self)
  70.     InvisFrame:SetFrameStrata("MEDIUM")
  71.     InvisFrame:SetFrameLevel(5)
  72.     InvisFrame:SetAllPoints()
  73.  
  74.     local Background = InvisFrame:CreateTexture(nil, 'BORDER')
  75.     Background:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
  76.     Background:SetAllPoints()
  77.     Background:SetAlpha(0)
  78.    
  79.     self:HookScript("OnEnter", function(self)
  80.         Background:SetVertexColor(1, 1, 1, 0.5)
  81.     end)
  82.  
  83.     self:HookScript("OnLeave", function(self)
  84.         Background:SetVertexColor(0, 0, 0, 0)
  85.     end)
  86.  
  87.     self.MasterLooter = InvisFrame:CreateTexture(nil, 'OVERLAY', self)
  88.     self.MasterLooter:SetSize(11, 11)
  89.     self.MasterLooter:SetPoint('RIGHT', self.Health, 'TOPRIGHT', 2, 2)
  90.    
  91.     self.Assistant = InvisFrame:CreateTexture(nil, 'OVERLAY', self)
  92.     self.Assistant:SetSize(12, 12)
  93.     self.Assistant:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
  94.    
  95.     self.Leader = InvisFrame:CreateTexture(nil, 'OVERLAY', self)
  96.     self.Leader:SetSize(12, 12)
  97.     self.Leader:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
  98.    
  99.     self.RaidIcon = InvisFrame:CreateTexture(nil, 'OVERLAY')
  100.     self.RaidIcon:SetSize(17, 17)
  101.     self.RaidIcon:SetPoint('CENTER', self, 'TOP')
  102.  
  103.     self.ReadyCheck = InvisFrame:CreateTexture(nil, 'OVERLAY')
  104.     self.ReadyCheck:SetSize(31, 25)
  105.     self.ReadyCheck:SetPoint('CENTER')  
  106.     self.ReadyCheck.delayTime = 4
  107.     self.ReadyCheck.fadeTime = 1
  108.    
  109.     if AftermathhUI.ouf.showroleicon == true then
  110.         self.LFDRole = InvisFrame:CreateTexture(nil, 'OVERLAY')
  111.         self.LFDRole:SetPoint('CENTER', self, 'BOTTOM', -1, 1)
  112.         self.LFDRole:SetSize(14, 14)
  113.         self.LFDRole:SetTexture(AftermathhUI.media.lfd)
  114.         self.LFDRole:SetDesaturated(1)
  115.     end
  116.  
  117.     if AftermathhUI.ouf.showaggroonraidframes == true then
  118.         table.insert(self.__elements, UpdateThreatRaid)
  119.         self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateThreatRaid)
  120.         self:RegisterEvent('UNIT_THREAT_LIST_UPDATE', UpdateThreatRaid)
  121.         self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE', UpdateThreatRaid)
  122.     end
  123.  
  124.     if AftermathhUI.ouf.aurawatch == true and AftermathhUI.ouf.gridlayout == true and AftermathhUI.ouf.dpslayout == false then
  125.         CreateAuraWatch(self,unit)
  126.     end
  127.    
  128.     if AftermathhUI.ouf.raiddebuffs == true then
  129.         self.RaidDebuffs = CreateFrame('Frame', nil, self)
  130.         self.RaidDebuffs:SetSize(20, 20)
  131.         self.RaidDebuffs:SetPoint('CENTER', self)
  132.         self.RaidDebuffs:SetFrameStrata('HIGH')
  133.        
  134.         local PerfectBorders = 768/string.match(GetCVar("gxResolution"), "%d+x(%d+)")/0.89999997615814
  135.         self.RaidDebuffs:SetBackdrop({
  136.             bgFile = AftermathhUI.media.borderlight,
  137.             insets = {top = -4+PerfectBorders, left = -4+PerfectBorders, bottom = -4+PerfectBorders, right = -4+PerfectBorders},
  138.         })
  139.  
  140.         self.RaidDebuffs.icon = self.RaidDebuffs:CreateTexture(nil, 'ARTWORK')
  141.         self.RaidDebuffs.icon:SetTexCoord(.07,.93,.07,.93)
  142.         self.RaidDebuffs.icon:SetAllPoints(self.RaidDebuffs)
  143.        
  144.         self.RaidDebuffs.cd = CreateFrame('Cooldown', nil, self.RaidDebuffs)
  145.         self.RaidDebuffs.cd:SetAllPoints(self.RaidDebuffs)
  146.        
  147.         local overlayFrame = CreateFrame("frame", nil, self.RaidDebuffs, nil)
  148.         overlayFrame:SetFrameStrata("HIGH")
  149.         overlayFrame:SetFrameLevel(5)
  150.    
  151.         self.RaidDebuffs.count = self.RaidDebuffs:CreateFontString(nil, 'OVERLAY')
  152.         self.RaidDebuffs.count:SetParent(overlayFrame)
  153.         self.RaidDebuffs.count:SetFont(AftermathhUI.media.font, 12, AftermathhUI.media.fontflag)
  154.         if AftermathhUI.media.shadowoffset == true then
  155.             self.RaidDebuffs.count:SetShadowOffset(1, -1)
  156.             self.RaidDebuffs.count:SetShadowColor(0, 0, 0)
  157.         end
  158.         self.RaidDebuffs.count:ClearAllPoints()
  159.         self.RaidDebuffs.count:SetPoint('TOPRIGHT', self.RaidDebuffs, 2, 3)
  160.     end
  161.    
  162.     if AftermathhUI.ouf.healprediction == true then
  163.         local myBars = CreateFrame('StatusBar', nil, self.Health)
  164.         myBars:SetStatusBarTexture(AftermathhUI.media.texture)
  165.         myBars:SetStatusBarColor(0, 1, 0.5, 0.45)
  166.         myBars:SetSize(55, 38)
  167.         if AftermathhUI.ouf.raidframesvertical == true then
  168.             myBars:SetOrientation("VERTICAL")
  169.             myBars:SetPoint('BOTTOM', self.Health:GetStatusBarTexture(), 'TOP', 0, 0)
  170.             myBars:SetSize(59, 39)
  171.         else
  172.             myBars:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  173.             myBars:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  174.         end
  175.  
  176.         local otherBars = CreateFrame('StatusBar', nil, myBars)
  177.         otherBars:SetStatusBarTexture(AftermathhUI.media.texture)
  178.         otherBars:SetStatusBarColor(0, 0.5, 1, 0.45)
  179.         otherBars:SetSize(55, 38)
  180.         if AftermathhUI.ouf.raidframesvertical == true then
  181.             otherBars:SetOrientation("VERTICAL")
  182.             otherBars:SetPoint('BOTTOM', myBars:GetStatusBarTexture(), 'TOP', 0, 0)
  183.             otherBars:SetSize(59, 39)
  184.         else
  185.             otherBars:SetPoint('TOPLEFT', myBars:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
  186.             otherBars:SetPoint('BOTTOMLEFT', myBars:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
  187.         end
  188.        
  189.         self.HealPrediction = {
  190.             myBar = myBars,
  191.             otherBar = otherBars,
  192.             maxOverflow = 1,
  193.         }
  194.     end
  195.  
  196.     self.SpellRange = {
  197.         insideAlpha = 1,
  198.         outsideAlpha = 0.3,
  199.     }
  200.  
  201.     return self
  202. end
  203.  
  204. oUF:RegisterStyle('Aftermathh_Raid', RaidFrames)
  205. oUF:Factory(function(self)
  206.     self:SetActiveStyle('Aftermathh_Raid')
  207.    
  208.     local toStr = tostring
  209.    
  210.     if AftermathhUI.ouf.showraid == true then
  211.         for group = 1, NUM_RAID_GROUPS do
  212.             local Raid = self:SpawnHeader("AftermathhRaidGrid", nil, 'solo,party,raid',
  213.                 'showPlayer', true,
  214.                 'showRaid', true,
  215.                 'showParty', true,
  216.                 'showSolo', true,
  217.                 'xoffset', 7,
  218.                 'yOffset', 0,
  219.                 'point', 'LEFT',
  220.                 'groupFilter', toStr(group),
  221.                 'groupingOrder', '1,2,3,4,5,6,7,8',
  222.                 'groupBy', 'GROUP',
  223.                 'sortMethod', 'GROUP',
  224.                 'maxColumns', 5,
  225.                 'unitsPerColumn', 5,
  226.                 'columnSpacing', 6,
  227.                 'columnAnchorPoint', 'TOP',
  228.                 'oUF-initialConfigFunction', [[
  229.                     self:SetWidth(59)
  230.                     self:SetHeight(38)
  231.                     self:SetScale(1)
  232.                 ]]
  233.             )  
  234.             Raid:SetPoint('LEFT', UIParent, 221, -54)
  235.         end
  236.         if AftermathhUI.ouf.gridlayout == false and AftermathhUI.ouf.dpslayout == true then
  237.             local Raid = self:SpawnHeader("AftermathhRaid", nil, 'solo,party,raid',
  238.                 'showPlayer', true,
  239.                 'showRaid', true,
  240.                 'showParty', false,
  241.                 'showSolo', false,
  242.                 'xoffset', 12,
  243.                 'yOffset', -5,
  244.                 'point', 'LEFT',
  245.                 'groupFilter', '1,2,3,4,5,6,7,8',
  246.                 'groupingOrder', '1,2,3,4,5,6,7,8',
  247.                 'groupBy', 'GROUP',
  248.                 'maxColumns', 12,
  249.                 'unitsPerColumn', 5,
  250.                 'columnSpacing', 12,
  251.                 'columnAnchorPoint', 'TOP',
  252.                 'oUF-initialConfigFunction', [[
  253.                     self:SetWidth(45)
  254.                     self:SetHeight(38)
  255.                     self:SetScale(1)
  256.                 ]]
  257.             )  
  258.             Raid:SetPoint('TOPLEFT', UIParent, 10, -9)
  259.         end
  260.     end
  261. end)

Last edited by Aftermathhqt : 02-14-12 at 09:22 AM.
  Reply With Quote
02-16-12, 10:05 AM   #15
Xpload
A Defias Bandit
 
Xpload's Avatar
Join Date: Jan 2011
Posts: 3
yj589794's code is good and works but I can't figure a way to make it dependent on raid size (one layout for <25 and another for 25+)
  Reply With Quote
02-16-12, 11:10 AM   #16
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
For that I think you'd have to generate headers for the <25 raid and >25 raid separately:

Code:
local toStr = tostring

local function spawnFunction(self)
	self:SetActiveStyle('oUF_EPRaid')

	-- define the raid groups
	local raid25 = {}
	for group = 1, NUM_RAID_GROUPS do
		local header = self:SpawnHeader(nil, nil, 'custom [@raid26,exists] hide;show',
						'showPlayer', true,
						'showParty', true,
						'showRaid', true,
						'groupFilter', toStr(group),
						'yOffset', -config.SPACING,
						'oUF-initialConfigFunction', ([[
							local unit = ...
							self:SetWidth(%d)
							self:SetHeight(%d)
						]]):format(config.RAIDUNITWIDTH, config.UNITHEIGHT)
		)

		if group > 1 then
			header:SetPoint('TOPLEFT', raid25[group - 1], 'TOPRIGHT', config.SPACING, 0)
		else
			header:SetPoint('TOPLEFT', UIParent, 'BOTTOMLEFT', 15, 350)
		end
		raid25[group] = header
	end

	local raid40 = {}
	for group = 1, NUM_RAID_GROUPS do
		local header = self:SpawnHeader(nil, nil, 'custom [@raid26,exists] show;hide',
						'showPlayer', true,
						'showParty', true,
						'showRaid', true,
						'groupFilter', toStr(group),
						'yOffset', -config.SPACING,
						'oUF-initialConfigFunction', ([[
							local unit = ...
							self:SetWidth(%d)
							self:SetHeight(%d)
						]]):format(config.RAIDUNITWIDTH, config.UNITHEIGHT)
		)

		if group > 1 then
			header:SetPoint('TOPLEFT', raid40[group - 1], 'TOPRIGHT', config.SPACING, 0)
		else
			header:SetPoint('TOPLEFT', UIParent, 'BOTTOMLEFT', 15, 350)
		end
		raid40[group] = header
	end
end
I don't use the visibility settings much, but the above *might* work
  Reply With Quote
02-16-12, 12:00 PM   #17
Xpload
A Defias Bandit
 
Xpload's Avatar
Join Date: Jan 2011
Posts: 3
Works like a charm but more issues appeared like not being able to do 8x4 raid, centering it in the middle of the screen etc. I will stick to the old model until I figure a smart way to do it ;p Thanks for the help
  Reply With Quote
02-22-12, 06:24 AM   #18
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Did some deep dig in. I fixed it!

What i did wrong:

LUA Code:
  1. local Aftermathh_Raid25 = oUF:SpawnHeader("Aftermathh_Raid25", nil, "solo,party,raid, custom [@raid26,exists] hide; [@raid1,exists] show; hide",

instead of

LUA Code:
  1. local Aftermathh_Raid25 = oUF:SpawnHeader(nil, nil, "solo,party,raid, custom [@raid26,exists] hide; [@raid1,exists] show; hide",

Thanks for this great feature :-)

Doh only one little problem this:



LUA Code:
  1. local raid = {}
  2. for group = 1, NUM_RAID_GROUPS do
  3.     local Aftermathh_Raid25 = oUF:SpawnHeader(nil, nil, "solo,party,raid, custom [@raid26,exists] hide; [@raid1,exists] show; hide",
  4.     'showPlayer', true,
  5.     'showRaid', true,
  6.     'showParty', true,
  7.     'showSolo', true,
  8.     'xoffset', 7,
  9.     'yOffset', -7,
  10.     --'point', 'LEFT',
  11.     --'columnAnchorPoint', 'LEFT',
  12.     'groupFilter', tostring(group),
  13.     'groupingOrder', '1,2,3,4,5',
  14.     --'groupBy', 'GROUP',
  15.     --'sortMethod', 'GROUP',   
  16.     --'maxColumns', 5,
  17.     --'unitsPerColumn', 5,
  18.     --'columnSpacing', 6,
  19.     'oUF-initialConfigFunction', [[
  20.         self:SetWidth(59)
  21.         self:SetHeight(38)
  22.         self:SetScale(1)
  23.     ]]
  24.     )
  25.  
  26.     if group > 1 then
  27.         Aftermathh_Raid25:SetPoint('TOPLEFT', raid[group - 1], 'TOPRIGHT', 7, 0)
  28.     else
  29.         Aftermathh_Raid25:SetPoint('LEFT', UIParent, 221, -54)
  30.     end
  31.     raid[group] = Aftermathh_Raid25
  32. end

Last edited by Aftermathhqt : 02-22-12 at 07:28 AM.
  Reply With Quote
02-22-12, 07:28 AM   #19
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Nvm, fixed !
  Reply With Quote
02-22-12, 10:27 AM   #20
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Game92 View Post
Did some deep dig in. I fixed it!

What i did wrong:

LUA Code:
  1. local Aftermathh_Raid25 = oUF:SpawnHeader("Aftermathh_Raid25", nil, "solo,party,raid, custom [@raid26,exists] hide; [@raid1,exists] show; hide",

instead of

LUA Code:
  1. local Aftermathh_Raid25 = oUF:SpawnHeader(nil, nil, "solo,party,raid, custom [@raid26,exists] hide; [@raid1,exists] show; hide",
The only difference between those two is: One is named by you, while the other is named by oUF, so they should be equal unless you override _G['Aftermathh_Raid25'] with something later on.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Grouping / Sorting Question


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