comparison main.lua @ 4:e66407f67848

TOC bump for 4.1, grow to fit new flag columns.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Tue, 26 Apr 2011 23:08:53 +0000
parents 001b15e07b87
children 332550e56fd2
comparison
equal deleted inserted replaced
3:001b15e07b87 4:e66407f67848
72 ----------------------------------------------------------------------------- 72 -----------------------------------------------------------------------------
73 -- other locals 73 -- other locals
74 local AceGUI = LibStub("AceGUI-3.0") 74 local AceGUI = LibStub("AceGUI-3.0")
75 local st_rowheight = 25 75 local st_rowheight = 25
76 local st_displayed_rows = 15 --math.floor(366/st_rowheight) 76 local st_displayed_rows = 15 --math.floor(366/st_rowheight)
77 local st_colwidth = 65
77 local sidetabs 78 local sidetabs
78 local incomplete 79 local incomplete
79 80
80 -- Remove children widgets without explicitly Release()'ing them. 81 -- Remove children widgets without explicitly Release()'ing them.
81 local function DisownChildren (container) 82 local function DisownChildren (container)
132 133
133 if (not IsGuildLeader()) and self.db.profile.guildcontrol then 134 if (not IsGuildLeader()) and self.db.profile.guildcontrol then
134 local function onclick() addon:BuildWindow() end 135 local function onclick() addon:BuildWindow() end
135 local function onenter(this) GameTooltip_AddNewbieTip(this, GUILDCONTROL, 1.0, 1.0, 1.0, "/wrdw", 1) end 136 local function onenter(this) GameTooltip_AddNewbieTip(this, GUILDCONTROL, 1.0, 1.0, 1.0, "/wrdw", 1) end
136 GuildFrame_LoadUI() 137 GuildFrame_LoadUI()
138 if not NUM_RANK_FLAGS then
139 UIParentLoadAddOn("Blizzard_GuildControlUI")
140 end
137 hooksecurefunc("GuildFrame_CheckPermissions", function() 141 hooksecurefunc("GuildFrame_CheckPermissions", function()
138 GuildControlButton:Enable() 142 GuildControlButton:Enable()
139 GuildControlButton:SetScript("OnClick", onclick) 143 GuildControlButton:SetScript("OnClick", onclick)
140 GuildControlButton:SetScript("OnEnter", onenter) 144 GuildControlButton:SetScript("OnEnter", onenter)
141 end) 145 end)
317 width = 10 * #tmp, 321 width = 10 * #tmp,
318 }} 322 }}
319 for i = 1, NUM_RANK_FLAGS do if i ~= 14 then 323 for i = 1, NUM_RANK_FLAGS do if i ~= 14 then
320 table.insert(cols,{ 324 table.insert(cols,{
321 name = _G['GUILDCONTROL_OPTION'..i], 325 name = _G['GUILDCONTROL_OPTION'..i],
322 width = 62, 326 width = st_colwidth,
323 }) 327 })
324 end end 328 end end
325 329
326 local ST = LibStub("ScrollingTable"):CreateST (cols, st_displayed_rows, st_rowheight, nil, parent_frame) 330 local ST = LibStub("ScrollingTable"):CreateST (cols, st_displayed_rows, st_rowheight, nil, parent_frame)
327 ST:Hide() 331 ST:Hide()
369 else 373 else
370 self.display = AceGUI:Create("Frame") 374 self.display = AceGUI:Create("Frame")
371 self.display:SetTitle("Which Rank Does What") 375 self.display:SetTitle("Which Rank Does What")
372 self.display:SetLayout("Fill") 376 self.display:SetLayout("Fill")
373 self.display:SetStatusTable{ 377 self.display:SetStatusTable{
374 width = 1225, 378 width = (st_colwidth+4) * (NUM_RANK_FLAGS-1) -- flag columns
379 + 105, -- rank label column
375 height = 500, 380 height = 500,
376 } 381 }
377 self.display:ApplyStatus() 382 self.display:ApplyStatus()
378 self.display:SetCallback("OnClose", function(_d) 383 self.display:SetCallback("OnClose", function(_d)
379 if incomplete or (not self.perms) then 384 if incomplete or (not self.perms) then