diff --git a/LFGBulletinBoard/Dungeons.lua b/LFGBulletinBoard/Dungeons.lua index a657b6c..64302e0 100644 --- a/LFGBulletinBoard/Dungeons.lua +++ b/LFGBulletinBoard/Dungeons.lua @@ -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 = {} @@ -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 diff --git a/LFGBulletinBoard/Options.lua b/LFGBulletinBoard/Options.lua index 732295f..7741834 100644 --- a/LFGBulletinBoard/Options.lua +++ b/LFGBulletinBoard/Options.lua @@ -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 @@ -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()