Skip to content

Commit

Permalink
Added checkboxes for TBC raids
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudbells committed Apr 13, 2021
1 parent b37f044 commit f0abea4
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions AutoLoggerClassic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ local BUTTONS_PER_ROW = 3
-- Variables.
local minimapIcon = LibStub("LibDBIcon-1.0")
local buttons = {}
local raids = {
-- Classic raids:
local classicRaids = {
[249] = "Onyxia's Lair",
[409] = "Molten Core",
[309] = "Zul'Gurub",
[469] = "Blackwing Lair",
[509] = "AQ20",
[531] = "AQ40",
[533] = "Naxxramas",
-- The Burning Crusade raids:
}
local tbcRaids = {
[532] = "Karazhan",
[544] = "Magtheridon's Lair",
[565] = "Gruul's Lair",
Expand Down Expand Up @@ -94,13 +94,13 @@ local function initSlash()
end

-- Initializes all checkboxes.
local function initCheckButtons()
local function initCheckButtons(yStart, raidTable)
local index = 1
for k, v in pairs(raids) do
for k, v in pairs(raidTable) do
-- Checkbuttons.
local checkButton = CreateFrame("CheckButton", nil, AutoLoggerClassicFrame, "UICheckButtonTemplate")
local x = X_START + X_SPACING * ((index - 1) % BUTTONS_PER_ROW)
local y = Y_SPACING * math.ceil(index / BUTTONS_PER_ROW) - 10
local y = yStart + Y_SPACING * math.ceil(index / BUTTONS_PER_ROW) - 10
checkButton:SetPoint("TOPLEFT", x, y)
checkButton:SetScript("OnClick", AutoLoggerClassicCheckButton_OnClick)
checkButton.instance = k
Expand All @@ -118,7 +118,8 @@ end
local function init()
initMinimapButton()
initSlash()
initCheckButtons()
initCheckButtons(0, tbcRaids)
initCheckButtons(-106, classicRaids)
tinsert(UISpecialFrames, AutoLoggerClassicFrame:GetName())
end

Expand All @@ -137,6 +138,9 @@ end
-- Called when player clicks a checkbutton.
function AutoLoggerClassicCheckButton_OnClick(self)
ALCOptions.instances[self.instance] = not ALCOptions.instances[self.instance]
for k, v in pairs(ALCOptions.instances) do
print(k, v)
end
toggleLogging()
end

Expand Down Expand Up @@ -175,7 +179,7 @@ function AutoLoggerClassic_OnEvent(self, event, ...)
[580] = true, -- Sunwell Plateau
}
end
print("|cFFFFFF00AutoLoggerClassic|r loaded! Type /alc to toggle options. Remember to enable advanced combat logging in System > Network and clear your combat log often.")
print("|cFFFFFF00AutoLoggerClassic|r loaded! Type /alc to toggle options. Remember to enable advanced combat logging in Interface > Network and clear your combat log often.")
elseif event == "RAID_INSTANCE_WELCOME" then
toggleLogging()
elseif event == "PLAYER_ENTERING_WORLD" then
Expand Down

0 comments on commit f0abea4

Please sign in to comment.