Skip to content

Commit

Permalink
Compat code for WoW 11, closes #368
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Jul 10, 2024
1 parent a14e576 commit e8a2ec1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
5 changes: 5 additions & 0 deletions Borders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ sm.borders = {}
local mod = sm.borders
local L = sm.L

local EnableAddOn = C_AddOns.EnableAddOn or EnableAddOn
local GetAddOnInfo = C_AddOns.GetAddOnInfo or GetAddOnInfo
local LoadAddOn = C_AddOns.LoadAddOn or LoadAddOn
local IsAddOnLoaded = C_AddOns.IsAddOnLoaded or IsAddOnLoaded

local textures = {}
local texturePool = {}
local rotateTextures = {}
Expand Down
5 changes: 5 additions & 0 deletions Borders_Classic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ sm.borders = {}
local mod = sm.borders
local L = sm.L

local EnableAddOn = C_AddOns.EnableAddOn or EnableAddOn
local GetAddOnInfo = C_AddOns.GetAddOnInfo or GetAddOnInfo
local LoadAddOn = C_AddOns.LoadAddOn or LoadAddOn
local IsAddOnLoaded = C_AddOns.IsAddOnLoaded or IsAddOnLoaded

local textures = {}
local texturePool = {}
local rotateTextures = {}
Expand Down
2 changes: 1 addition & 1 deletion Buttons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ do

function mod:HideAllButtons()
if not mod.db.controlVisibility or moving then return end
local focus = GetMouseFocus() -- Minimap or Minimap icons including nil checks to compensate for other addons
local focus = GetMouseFocus and GetMouseFocus() or GetMouseFoci and GetMouseFoci()[1] -- Minimap or Minimap icons including nil checks to compensate for other addons
if focus and not focus:IsForbidden() and ((focus:GetName() == "Minimap") or (focus:GetParent() and focus:GetParent():GetName() and focus:GetParent():GetName():find("Mini[Mm]ap"))) then
fadeStop = true
return
Expand Down
2 changes: 1 addition & 1 deletion Buttons_TBC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ do
end
local OnLeave = function()
if not mod.db.controlVisibility or moving then return end
local focus = GetMouseFocus() -- Minimap or Minimap icons including nil checks to compensate for other addons
local focus = GetMouseFocus and GetMouseFocus() or GetMouseFoci and GetMouseFoci()[1] -- Minimap or Minimap icons including nil checks to compensate for other addons
if focus and not focus:IsForbidden() and ((focus:GetName() == "Minimap") or (focus:GetParent() and focus:GetParent():GetName() and focus:GetParent():GetName():find("Mini[Mm]ap"))) then
fadeStop = true
return
Expand Down
2 changes: 1 addition & 1 deletion Buttons_Vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ do
end
local OnLeave = function()
if not mod.db.controlVisibility or moving then return end
local focus = GetMouseFocus() -- Minimap or Minimap icons including nil checks to compensate for other addons
local focus = GetMouseFocus and GetMouseFocus() or GetMouseFoci and GetMouseFoci()[1] -- Minimap or Minimap icons including nil checks to compensate for other addons
if focus and not focus:IsForbidden() and ((focus:GetName() == "Minimap") or (focus:GetParent() and focus:GetParent():GetName() and focus:GetParent():GetName():find("Mini[Mm]ap"))) then
fadeStop = true
return
Expand Down
2 changes: 1 addition & 1 deletion Buttons_Wrath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ do
end
local OnLeave = function()
if not mod.db.controlVisibility or moving then return end
local focus = GetMouseFocus() -- Minimap or Minimap icons including nil checks to compensate for other addons
local focus = GetMouseFocus and GetMouseFocus() or GetMouseFoci and GetMouseFoci()[1] -- Minimap or Minimap icons including nil checks to compensate for other addons
if focus and not focus:IsForbidden() and ((focus:GetName() == "Minimap") or (focus:GetParent() and focus:GetParent():GetName() and focus:GetParent():GetName():find("Mini[Mm]ap"))) then
fadeStop = true
return
Expand Down
11 changes: 7 additions & 4 deletions SexyMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,16 @@ function mod:PLAYER_LOGIN()

-- Setup config
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable(name, mod.options, true)
LibStub("AceConfigDialog-3.0"):AddToBlizOptions(name)
local _, categoryID = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(name)

-- Configure slash handler
SlashCmdList.SexyMap = function()
-- Twice to work around a Blizz bug, opens to wrong panel on first try
InterfaceOptionsFrame_OpenToCategory(name)
InterfaceOptionsFrame_OpenToCategory(name)
if InterfaceOptionsFrame_OpenToCategory then -- XXX compat
InterfaceOptionsFrame_OpenToCategory(name) -- Twice to work around a Blizz bug, opens to wrong panel on first try
InterfaceOptionsFrame_OpenToCategory(name)
else
Settings.OpenToCategory(categoryID)
end
end
SLASH_SexyMap1 = "/minimap"
SLASH_SexyMap2 = "/sexymap"
Expand Down
4 changes: 2 additions & 2 deletions ZoneText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function mod:OnEnable()

do
local tt = CreateFrame("GameTooltip", "SexyMapZoneTextTooltip", zoneTextButton, "GameTooltipTemplate")
local GetZonePVPInfo, GetZoneText, GetSubZoneText = GetZonePVPInfo, GetZoneText, GetSubZoneText
local GetZonePVPInfo, GetZoneText, GetSubZoneText = C_PvP and C_PvP.GetZonePVPInfo or GetZonePVPInfo, GetZoneText, GetSubZoneText
zoneTextButton:SetScript("OnEnter", function(self) -- Minimap.lua line 68 function "Minimap_SetTooltip" as of wow 9.0.1
tt:SetOwner(self, "ANCHOR_LEFT")
local pvpType, _, factionName = GetZonePVPInfo()
Expand Down Expand Up @@ -380,7 +380,7 @@ function mod:UpdateLayout()
end

do
local GetMinimapZoneText, GetZonePVPInfo = GetMinimapZoneText, GetZonePVPInfo
local GetMinimapZoneText, GetZonePVPInfo = GetMinimapZoneText, C_PvP and C_PvP.GetZonePVPInfo or GetZonePVPInfo
function mod:ZoneChanged()
local text = GetMinimapZoneText()
zoneTextFont:SetText(text)
Expand Down

0 comments on commit e8a2ec1

Please sign in to comment.