10-11-10, 05:32 PM | #1 |
Customizing Spawn Header
Hi all I have a very small issue I was hoping you could help me with, currently i have three different groups (party[raid 1-5 as well], raid 6-25, raid 26-40). I want to try to customize my spawn header so that if I am inside a raid that is not a 40 man, the raid 6-25 layout will always be shown.
Any help is appreciated, yes this is done with the oUF 1.5, which isn't complete yet. Party [Raid 1-5] Spawnheader: Code:
local party = self:SpawnHeader("oUF_TukuiDPSParty", nil, "custom [@raid6,exists] hide;show", 'oUF-initialConfigFunction', [[ local header = self:GetParent() self:SetWidth(header:GetAttribute('initial-width')) self:SetHeight(header:GetAttribute('initial-height')) RegisterUnitWatch(self) ]], 'initial-width', party_width, 'initial-height', party_height, "showParty", true, "showPlayer", TukuiCF["raidframes"].showplayerinparty, "showRaid", true, "showSolo", false, "yOffset", TukuiDB.Scale(-8) ) Code:
local raid = self:SpawnHeader("oUF_TukuiDPSR6R25", nil, "custom [@raid6,noexists][@raid26,exists] hide;show", 'oUF-initialConfigFunction', [[ local header = self:GetParent() self:SetWidth(header:GetAttribute('initial-width')) self:SetHeight(header:GetAttribute('initial-height')) RegisterUnitWatch(self) ]], 'initial-width', raidframe_width, 'initial-height', raidframe_height, "showRaid", true, "showParty", true, "showSolo", false, "point", "BOTTOM", "showPlayer", TukuiCF["raidframes"].showplayerinparty, "groupFilter", "1,2,3,4,5", "groupingOrder", "1,2,3,4,5", "groupBy", "GROUP", "yOffset", TukuiDB.Scale(6) ) Code:
local raid = self:SpawnHeader("oUF_TukuiDPSR26R40", nil, "custom [@raid26,exists] show;hide", 'oUF-initialConfigFunction', [[ local header = self:GetParent() self:SetWidth(header:GetAttribute('initial-width')) self:SetHeight(header:GetAttribute('initial-height')) RegisterUnitWatch(self) ]], 'initial-width', raid_width, 'initial-height', raid_height, "showSolo", false, "showRaid", true, "showParty", true, "showPlayer", TukuiCF["raidframes"].showplayerinparty, "xoffset", TukuiDB.Scale(6), "groupFilter", "1,2,3,4,5,6,7,8", "groupingOrder", "1,2,3,4,5,6,7,8", "groupBy", "GROUP", "yOffset", TukuiDB.Scale(-6) ) Also here is an example of the function I would run to check if the raid is proper: Code:
function TukuiDB.Show25RaidLayout() local inInstance, instanceType = IsInInstance() local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() if inInstance and instanceType == "raid" and maxPlayers ~= 40 then return true else return false end end Last edited by Elv22 : 10-12-10 at 11:12 AM. |
|
10-12-10, 11:30 AM | #2 |
What exactly is the issue?
|
|
10-12-10, 01:58 PM | #3 |
10-12-10, 03:36 PM | #4 | |
That being said you can always create a custom function that based on current information will show / hide different already created UnitFrames ... like so: Code:
function ShowHideUnitFrames() if no party hide all but player (& pet) frames if party show party frames if raid but less or equal to 5 players show party frames if raid with less than 11 and more than 5 players show raid10 frames if raid with less than 26 and more then 10 player show raid25 frames if raid and more then 10 player show raid40 frames end |
||
10-12-10, 04:02 PM | #5 |
It is possible to write your own custom SecureStateDriver, but it is not an easy thing to implement.
For my own raid frames I just show all raid units and move the pet frames on any raid/party roster update. |
|
10-12-10, 04:13 PM | #6 |
if you or anyone could post an example on how to do this it would be appreciated.
|
|
10-12-10, 04:31 PM | #7 |
10-14-10, 04:15 PM | #8 |
Figured it out, was kinda tricky but hey it works..
Party: Code:
oUF:RegisterStyle('TukuiDPSParty', Shared) oUF:Factory(function(self) oUF:SetActiveStyle("TukuiDPSParty") local party = self:SpawnHeader("oUF_TukuiDPSParty", nil, "custom [@raid6,exists] hide;show", 'oUF-initialConfigFunction', [[ local header = self:GetParent() self:SetWidth(header:GetAttribute('initial-width')) self:SetHeight(header:GetAttribute('initial-height')) RegisterUnitWatch(self) ]], 'initial-width', party_width, 'initial-height', party_height, "showParty", true, "showPlayer", TukuiCF["raidframes"].showplayerinparty, "showRaid", true, "showSolo", false, "yOffset", TukuiDB.Scale(-8) ) party:SetPoint("BOTTOMLEFT", ChatLBackground, "TOPLEFT", TukuiDB.Scale(2), TukuiDB.Scale(40)) local partyToggle = CreateFrame("Frame") partyToggle:RegisterEvent("PLAYER_ENTERING_WORLD") partyToggle:RegisterEvent("ZONE_CHANGED_NEW_AREA") partyToggle:SetScript("OnEvent", function(self) local inInstance, instanceType = IsInInstance() local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() if inInstance and instanceType == "raid" and maxPlayers ~= 40 then oUF_TukuiDPSParty:SetAttribute("showRaid", false) oUF_TukuiDPSParty:SetAttribute("showParty", false) else oUF_TukuiDPSParty:SetAttribute("showParty", true) oUF_TukuiDPSParty:SetAttribute("showRaid", true) end end) end) Code:
oUF:RegisterStyle('TukuiDPSR6R25', Shared) oUF:Factory(function(self) oUF:SetActiveStyle("TukuiDPSR6R25") local raid = self:SpawnHeader("oUF_TukuiDPSR6R25", nil, "custom [@raid6,noexists][@raid26,exists] hide;show", 'oUF-initialConfigFunction', [[ local header = self:GetParent() self:SetWidth(header:GetAttribute('initial-width')) self:SetHeight(header:GetAttribute('initial-height')) RegisterUnitWatch(self) ]], 'initial-width', raidframe_width, 'initial-height', raidframe_height, "showRaid", true, "showParty", true, "showSolo", false, "point", "BOTTOM", "showPlayer", TukuiCF["raidframes"].showplayerinparty, "groupFilter", "1,2,3,4,5", "groupingOrder", "1,2,3,4,5", "groupBy", "GROUP", "yOffset", TukuiDB.Scale(6) ) raid:SetPoint("BOTTOMLEFT", ChatLBackground, "TOPLEFT", TukuiDB.Scale(2), TukuiDB.Scale(40)) local function ChangeVisibility(visibility) if(visibility) then local type, list = string.split(' ', visibility, 2) if(list and type == 'custom') then RegisterAttributeDriver(oUF_TukuiDPSR6R25, 'state-visibility', list) end end end local raidToggle = CreateFrame("Frame") raidToggle:RegisterEvent("PLAYER_ENTERING_WORLD") raidToggle:RegisterEvent("ZONE_CHANGED_NEW_AREA") raidToggle:SetScript("OnEvent", function(self) local inInstance, instanceType = IsInInstance() local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() if inInstance and instanceType == "raid" and maxPlayers ~= 40 then ChangeVisibility("custom [group:party,nogroup:raid][group:raid] show;hide") else ChangeVisibility("custom [@raid6,noexists][@raid26,exists] hide;show") end end) end) Code:
oUF:RegisterStyle('TukuiDPSR26R40', Shared) oUF:Factory(function(self) oUF:SetActiveStyle("TukuiDPSR26R40") local raid = self:SpawnHeader("oUF_TukuiDPSR26R40", nil, "custom [@raid26,exists] show;hide", 'oUF-initialConfigFunction', [[ local header = self:GetParent() self:SetWidth(header:GetAttribute('initial-width')) self:SetHeight(header:GetAttribute('initial-height')) RegisterUnitWatch(self) ]], 'initial-width', raid_width, 'initial-height', raid_height, "showSolo", false, "showRaid", true, "showParty", true, "showPlayer", TukuiCF["raidframes"].showplayerinparty, "xoffset", TukuiDB.Scale(6), "groupFilter", "1,2,3,4,5,6,7,8", "groupingOrder", "1,2,3,4,5,6,7,8", "groupBy", "GROUP", "yOffset", TukuiDB.Scale(-6) ) raid:SetPoint("BOTTOMLEFT", ChatLBackground, "TOPLEFT", TukuiDB.Scale(2), TukuiDB.Scale(40)) local partyToggle = CreateFrame("Frame") partyToggle:RegisterEvent("PLAYER_ENTERING_WORLD") partyToggle:RegisterEvent("ZONE_CHANGED_NEW_AREA") partyToggle:SetScript("OnEvent", function(self) local inInstance, instanceType = IsInInstance() local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() if inInstance and instanceType == "raid" and maxPlayers ~= 40 then oUF_TukuiDPSR26R40:SetAttribute("showRaid", false) oUF_TukuiDPSR26R40:SetAttribute("showParty", false) else oUF_TukuiDPSR26R40:SetAttribute("showParty", true) oUF_TukuiDPSR26R40:SetAttribute("showRaid", true) end end) end) |
|
WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Customizing Spawn Header |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|