diff --git a/Buttons_Vanilla.lua b/Buttons_Vanilla.lua index d8cbf4d..cf96d8d 100644 --- a/Buttons_Vanilla.lua +++ b/Buttons_Vanilla.lua @@ -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"], @@ -188,7 +188,7 @@ function mod:OnInitialize(profile) MiniMapBattlefieldFrame = "always", MiniMapLFGFrame = "always", GarrisonLandingPageMinimapButton = "always", - MiniMapTrackingFrame = "always", + MiniMapTracking = "always", }, allowDragging = true, lockDragging = false, @@ -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 @@ -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"]) @@ -559,7 +559,7 @@ end do local tbl = { - Minimap, MiniMapTrackingFrame, TimeManagerClockButton, GameTimeFrame, + Minimap, MiniMapTracking, TimeManagerClockButton, GameTimeFrame, MinimapZoomIn, MinimapZoomOut, MiniMapWorldMapButton, MiniMapMailFrame, MiniMapBattlefieldFrame, MiniMapLFGFrame } diff --git a/SexyMap.lua b/SexyMap.lua index 06064ec..5d151c9 100644 --- a/SexyMap.lua +++ b/SexyMap.lua @@ -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 @@ -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" diff --git a/SexyMap_Vanilla.lua b/SexyMap_Vanilla.lua index 61a4aef..7ca5142 100644 --- a/SexyMap_Vanilla.lua +++ b/SexyMap_Vanilla.lua @@ -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 = { @@ -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() @@ -132,6 +139,7 @@ mod.options = { end mod.db.northTag = v end, + hidden = not MinimapNorthTag, }, zoom = { order = 7, @@ -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" @@ -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()