barbol12 |
02-17-11 06:44 PM |
configuring to switch between 2 layouts
hello, i got a raid frame layout, 5 columns at 5 per column.. other words a 25man raid.. can also make it a 40man....
now what i am trying to do, is be able to type in a ingame config... to bring up a static popup that loads the 40man layout, and another static popup to load 25man...... basically to have two different layouts(positions and ofcourse 2 different # of columns) heres the configurations that i have so far.
this is the config file(seperate from lua, but enable to load with my ouf addon) it works fine upthrough showing the staticpopups. but doesnt change the raid layouts.
lua Code:
local addon, ns = ... local cfg = CreateFrame("Frame") ....... BLAH BLAH...... BLAH BLAH.... NOT IMPORTANT TO RAID STUFF..... local function raidsmall() if (cfg.raidbig == nil) then cfg.raidbig = {} end cfg.raidbig = {} cfg.raidsmall = true end local function raidbig() if (cfg.raidsmall == nil) then cfg.raidsmall = {} end cfg.raidsmall = {} cfg.raidbig = true end StaticPopupDialogs["BARBOLUI_RAIDSMALL"] = { text = "Do you wish to set the raid layout to 25-man?", button1 = YES, button2 = NO, OnAccept = function(self) raidsmall(); ReloadUI(); end, timeout = 0, whileDead = 1, hideOnEscape = 1 } StaticPopupDialogs["BARBOLUI_RAIDBIG"] = { text = "Do you wish to set the raid layout to 40-man?", button1 = YES, button2 = NO, OnAccept = function(self) raidbig(); ReloadUI(); end, timeout = 0, whileDead = 1, hideOnEscape = 1 } SLASH_RAIDSMALL1 = "/Barbol25" SlashCmdList["RAIDSMALL"] = function() StaticPopup_Show("BARBOLUI_RAIDSMALL") end SLASH_RAIDBIG1 = "/Barbol40" SlashCmdList["RAIDBIG"] = function() StaticPopup_Show("BARBOLUI_RAIDBIG") end ns.cfg = cfg
here is the ouf portion needed... for raid frame to make the layout positions work.
lua Code:
if cfg.raidsmall then local raid = oUF:SpawnHeader("oUF_Raid", nil, 'solo,party,raid10,raid25,raid40', 'showRaid', true, 'showPlayer', true, 'showSolo', true, 'showParty', false, 'xoffset', 0, 'yOffset', -3, 'groupFilter', "1,2,3,4,5,6,7,8", 'groupingOrder', "1,2,3,4,5,6,7,8", 'groupBy', "GROUP", 'maxColumns', 5, 'unitsPerColumn', 5, 'columnSpacing', 3, 'point', "TOP", 'columnAnchorPoint', "LEFT" ) raid:SetPoint("CENTER", 0, 0) elseif cfg.raidbig then local raid = oUF:SpawnHeader("oUF_Raid", nil, 'solo,party,raid10,raid25,raid40', 'showRaid', true, 'showPlayer', true, 'showSolo', true, 'showParty', false, 'xoffset', 0, 'yOffset', -3, 'groupFilter', "1,2,3,4,5,6,7,8", 'groupingOrder', "1,2,3,4,5,6,7,8", 'groupBy', "GROUP", 'maxColumns', 8, 'unitsPerColumn', 5, 'columnSpacing', 3, 'point', "TOP", 'columnAnchorPoint', "LEFT" ) raid:SetPoint("LEFT", 0, 0) end
anyone know how to make this work/ fix my stuff???
|