Skip to content

Commit

Permalink
Fix gap in micro menu in WoW Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
kerristrasz committed Dec 4, 2023
1 parent 63e678c commit dd28038
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions MicroMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,46 @@ local ButtonBar = Bartender4.ButtonBar.prototype
local pairs, setmetatable, table_insert = pairs, setmetatable, table.insert

local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)
local WoWClassicEra = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC)
local WoW10 = select(4, GetBuildInfo()) >= 100000

-- GLOBALS: CharacterMicroButton, SpellbookMicroButton, TalentMicroButton, AchievementMicroButton, QuestLogMicroButton, GuildMicroButton
-- GLOBALS: LFDMicroButton, CollectionsMicroButton, EJMicroButton, MainMenuMicroButton
-- GLOBALS: HasVehicleActionBar, UnitVehicleSkin, HasOverrideActionBar, GetOverrideBarSkin

local BT_MICRO_BUTTONS = WoWClassic and CopyTable(MICRO_BUTTONS) or
{
"CharacterMicroButton",
"SpellbookMicroButton",
"TalentMicroButton",
"AchievementMicroButton",
"QuestLogMicroButton",
"GuildMicroButton",
"LFDMicroButton",
"CollectionsMicroButton",
"EJMicroButton",
"StoreMicroButton",
"MainMenuMicroButton",
local BT_MICRO_BUTTONS
if WoWClassicEra then
BT_MICRO_BUTTONS = {
"CharacterMicroButton",
"SpellbookMicroButton",
"TalentMicroButton",
"QuestLogMicroButton",
"SocialsMicroButton",
"WorldMapMicroButton",
"MainMenuMicroButton",
"HelpMicroButton"
}
elseif WoWClassic then
BT_MICRO_BUTTONS = CopyTable(MICRO_BUTTONS)
else
BT_MICRO_BUTTONS = {
"CharacterMicroButton",
"SpellbookMicroButton",
"TalentMicroButton",
"AchievementMicroButton",
"QuestLogMicroButton",
"GuildMicroButton",
"LFDMicroButton",
"CollectionsMicroButton",
"EJMicroButton",
"StoreMicroButton",
"MainMenuMicroButton",
}
end

for index, value in ipairs(BT_MICRO_BUTTONS) do
print(index, value)
end

-- create prototype information
local MicroMenuBar = setmetatable({}, {__index = ButtonBar})
Expand Down Expand Up @@ -61,7 +81,7 @@ function MicroMenuMod:OnEnable()
local buttons = {}

-- handle lfg/worldmap button on classic
if WoWClassic and C_LFGList and C_LFGList.IsLookingForGroupEnabled then
if WoWClassic and not WoWClassicEra and C_LFGList and C_LFGList.IsLookingForGroupEnabled then
tDeleteItem(BT_MICRO_BUTTONS, C_LFGList.IsLookingForGroupEnabled() and "WorldMapMicroButton" or "LFGMicroButton")
end

Expand Down

0 comments on commit dd28038

Please sign in to comment.