Skip to content

Commit

Permalink
Updates for WoW classic era 1.15.4
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Sep 25, 2024
1 parent d413ac5 commit 0dfeeca
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
12 changes: 6 additions & 6 deletions Buttons_Vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local moving, ButtonFadeOut
local animFrames = {}
local blizzButtons = {
GameTimeFrame = L.dayNightButton,
MiniMapTrackingFrame = L["Tracking Button"],
MiniMapTracking = L["Tracking Button"],
SexyMapZoneTextButton = L["Zone Text"],
MinimapZoomIn = L["Zoom In Button"],
MinimapZoomOut = L["Zoom Out Button"],
Expand Down Expand Up @@ -188,7 +188,7 @@ function mod:OnInitialize(profile)
MiniMapBattlefieldFrame = "always",
MiniMapLFGFrame = "always",
GarrisonLandingPageMinimapButton = "always",
MiniMapTrackingFrame = "always",
MiniMapTracking = "always",
},
allowDragging = true,
lockDragging = false,
Expand All @@ -213,8 +213,8 @@ function mod:OnInitialize(profile)
if not self.db.visibilitySettings.GameTimeFrame then
self.db.visibilitySettings.GameTimeFrame = "never"
end
if not self.db.visibilitySettings.MiniMapTrackingFrame then
self.db.visibilitySettings.MiniMapTrackingFrame = "always"
if not self.db.visibilitySettings.MiniMapTracking then
self.db.visibilitySettings.MiniMapTracking = "always"
end
end

Expand Down Expand Up @@ -261,7 +261,7 @@ function mod:OnEnable()
local icon = GetTrackingTexture()
if icon then
MiniMapTrackingIcon:SetTexture(icon)
MiniMapTrackingFrame:Show()
MiniMapTracking:Show()
end

sm.core:RegisterModuleOptions("Buttons", options, L["Buttons"])
Expand Down Expand Up @@ -559,7 +559,7 @@ end

do
local tbl = {
Minimap, MiniMapTrackingFrame, TimeManagerClockButton, GameTimeFrame,
Minimap, MiniMapTracking, TimeManagerClockButton, GameTimeFrame,
MinimapZoomIn, MinimapZoomOut, MiniMapWorldMapButton,
MiniMapMailFrame, MiniMapBattlefieldFrame, MiniMapLFGFrame
}
Expand Down
17 changes: 6 additions & 11 deletions SexyMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ mod.options = {
MinimapNorthTag.oldShow = nil
MinimapCompassTexture.Show = MinimapCompassTexture.oldShow
MinimapCompassTexture.oldShow = nil
--if InterfaceOptionsDisplayPanelRotateMinimap:GetValue() == "1" then
-- MinimapCompassTexture:Show()
--else
-- MinimapNorthTag:Show()
--end
if C_CVar.GetCVarBool("rotateMinimap") then
MinimapCompassTexture:Show()
else
MinimapNorthTag:Show()
end
else
MinimapNorthTag:Hide()
MinimapNorthTag.oldShow = MinimapNorthTag.Show
Expand Down Expand Up @@ -401,12 +401,7 @@ function mod:PLAYER_LOGIN()

-- Configure slash handler
SlashCmdList.SexyMap = function()
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
Settings.OpenToCategory(categoryID)
end
SLASH_SexyMap1 = "/minimap"
SLASH_SexyMap2 = "/sexymap"
Expand Down
31 changes: 23 additions & 8 deletions SexyMap_Vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,16 @@ mod.options = {
name = ROTATE_MINIMAP,
desc = OPTION_TOOLTIP_ROTATE_MINIMAP,
get = function()
return InterfaceOptionsDisplayPanelRotateMinimap:GetValue() == "1" and true
return mod.db.rotate
end,
set = function()
InterfaceOptionsDisplayPanelRotateMinimap:Click()
set = function(_, value)
if value then
mod.db.rotate = true
C_CVar.SetCVar("rotateMinimap", 1)
else
mod.db.rotate = nil
C_CVar.SetCVar("rotateMinimap", 0)
end
end,
},
rightClickToConfig = {
Expand Down Expand Up @@ -112,12 +118,13 @@ mod.options = {
return mod.db.northTag
end,
set = function(info, v)
if not MinimapNorthTag then return end
if v then
MinimapNorthTag.Show = MinimapNorthTag.oldShow
MinimapNorthTag.oldShow = nil
MinimapCompassTexture.Show = MinimapCompassTexture.oldShow
MinimapCompassTexture.oldShow = nil
if InterfaceOptionsDisplayPanelRotateMinimap:GetValue() == "1" then
if C_CVar.GetCVarBool("rotateMinimap") then
MinimapCompassTexture:Show()
else
MinimapNorthTag:Show()
Expand All @@ -132,6 +139,7 @@ mod.options = {
end
mod.db.northTag = v
end,
hidden = not MinimapNorthTag,
},
zoom = {
order = 7,
Expand Down Expand Up @@ -402,13 +410,11 @@ 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)
Settings.OpenToCategory(categoryID)
end
SLASH_SexyMap1 = "/minimap"
SLASH_SexyMap2 = "/sexymap"
Expand Down Expand Up @@ -567,6 +573,15 @@ function mod:SetupMap()
Minimap:SetScale(mod.db.scale or 1)
Minimap:SetMovable(not mod.db.lock)

if mod.db.rotate then
C_CVar.SetCVar("rotateMinimap", 1)
end
--hooksecurefunc(MinimapCluster, "SetRotateMinimap", function()
-- if mod.db.rotate then
-- C_CVar.SetCVar("rotateMinimap", 1)
-- end
--end)

Minimap:SetScript("OnDragStart", function(self) if self:IsMovable() then self:StartMoving() end end)
Minimap:SetScript("OnDragStop", function(self)
self:StopMovingOrSizing()
Expand Down

0 comments on commit 0dfeeca

Please sign in to comment.