Skip to content

Commit

Permalink
event clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Vysci committed Sep 22, 2021
1 parent 713e014 commit 32ea24f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
21 changes: 16 additions & 5 deletions LFGBulletinBoard/Dungeons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ GBB.Raids = {
}

GBB.Seasonal = {
["BREW"] = { startDate = "09/20", endDate = "10/06"},
["HOLLOW"] = { startDate = "10/17", endDate = "10/31"}
["BREW"] = { startDate = "09/19", endDate = "10/07"},
["HOLLOW"] = { startDate = "10/16", endDate = "11/01"}
}

GBB.SeasonalActiveEvents = {}
Expand Down Expand Up @@ -559,11 +559,22 @@ local function ConcatenateLists(Names)
end

function GBB.GetDungeonSort()
local dungeonOrder = { GBB.VanillDungeonNames, GBB.Events, GBB.TbcDungeonNames, GBB.PvpNames, GBB.Misc, GBB.DebugNames}
for eventName, eventData in pairs(GBB.Seasonal) do
if GBB.Tool.InDateRange(eventData.startDate, eventData.endDate) then
table.insert(GBB.TbcDungeonNames, 1, eventName)
else
table.insert(GBB.DebugNames, 1, eventName)
end
end

local dungeonOrder = { GBB.VanillDungeonNames, GBB.TbcDungeonNames, GBB.PvpNames, GBB.Misc, GBB.DebugNames}

-- Why does Lua not having a fucking size function
local _, vanillaDungeonSize = ConcatenateLists({ GBB.VanillDungeonNames, GBB.Events})

local vanillaDungeonSize = 0
for _, _ in pairs(GBB.VanillDungeonNames) do
vanillaDungeonSize = vanillaDungeonSize + 1
end

local debugSize = 0
for _, _ in pairs(GBB.DebugNames) do
debugSize = debugSize+1
Expand Down
11 changes: 2 additions & 9 deletions LFGBulletinBoard/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,6 @@ function GBB.OptionsInit ()

TbcChkBox_FilterDungeon={}

local offSet = 0
for k, _ in pairs(GBB.SeasonalActiveEvents) do
offSet = offSet + 1
TbcChkBox_FilterDungeon[GBB.TBCDUNGEONSTART - offSet]= CheckBoxFilter(k, false)
end

for index=GBB.TBCDUNGEONSTART,GBB.TBCDUNGEONBREAK do
TbcChkBox_FilterDungeon[index]=CheckBoxFilter(GBB.dungeonSort[index],true)
end
Expand All @@ -255,13 +249,12 @@ function GBB.OptionsInit ()

--GBB.Options.AddSpace()

local startIndex = GBB.TBCDUNGEONSTART - offSet
GBB.Options.InLine()
GBB.Options.AddButton(GBB.L["BtnSelectAll"],function()
DoSelectFilter(true, TbcChkBox_FilterDungeon, startIndex, GBB.TBCMAXDUNGEON-2) -- Doing -2 to not select trade and misc
DoSelectFilter(true, TbcChkBox_FilterDungeon, GBB.TBCDUNGEONSTART, GBB.TBCMAXDUNGEON-2) -- Doing -2 to not select trade and misc
end)
GBB.Options.AddButton(GBB.L["BtnUnselectAll"],function()
DoSelectFilter(false, TbcChkBox_FilterDungeon, startIndex, GBB.TBCMAXDUNGEON)
DoSelectFilter(false, TbcChkBox_FilterDungeon, GBB.TBCDUNGEONSTART, GBB.TBCMAXDUNGEON)
end)
GBB.Options.EndInLine()

Expand Down

0 comments on commit 32ea24f

Please sign in to comment.