diff --git a/Buttons.lua b/Buttons.lua index ab18f5e..0f301a5 100644 --- a/Buttons.lua +++ b/Buttons.lua @@ -17,26 +17,28 @@ local blizzButtons = { MinimapZoomOut = L["Zoom Out Button"], MiniMapWorldMapButton = L["Map Button"], TimeManagerClockButton = L["Clock"], + AddonCompartmentFrame = L.addonCompartment, } local dynamicButtons = { GuildInstanceDifficulty = L["Guild Dungeon Difficulty Indicator (When Available)"], MiniMapChallengeMode = L["Challenge Mode Button (When Available)"], MiniMapInstanceDifficulty = L["Dungeon Difficulty Indicator (When Available)"], MiniMapMailFrame = L["New Mail Indicator (When Available)"], - QueueStatusMinimapButton = L["Queue Status (PvP/LFG) Button (When Available)"], + CraftingOrder = L.craftingOrder, GarrisonLandingPageMinimapButton = L["Garrison Button (When Available)"], } -local namesCompatForDF = ExpansionLandingPageMinimapButton and { +local buttonNicknames = { [ExpansionLandingPageMinimapButton] = "GarrisonLandingPageMinimapButton", [Minimap.ZoomIn] = "MinimapZoomIn", [Minimap.ZoomOut] = "MinimapZoomOut", [MinimapCluster.Tracking] = "MiniMapTracking", [MinimapCluster.InstanceDifficulty] = "MiniMapInstanceDifficulty", [MinimapCluster.IndicatorFrame.MailFrame] = "MiniMapMailFrame", + [MinimapCluster.IndicatorFrame.CraftingOrderFrame] = "CraftingOrder", [GameTimeFrame] = "GameTimeFrame", -- Just here to change parent to Minimap in :NewFrame [MinimapCluster.Tracking.Button] = "none", -- Prevent error when being passed to :NewFrame -} or {} +} local options = { type = "group", @@ -155,7 +157,7 @@ local options = { if not v then mod:ChangeFrameVisibility(f, "always") else - local name = namesCompatForDF[f] or f:GetName() + local name = buttonNicknames[f] or f:GetName() mod:ChangeFrameVisibility(f, mod.db.visibilitySettings[name] or "hover") end end @@ -178,7 +180,7 @@ do local function hideSet(info, value) local name = info[#info] mod.db.visibilitySettings[name] = value - for k,v in next, namesCompatForDF do + for k,v in next, buttonNicknames do if v == name then mod:ChangeFrameVisibility(k, value) return @@ -219,8 +221,9 @@ function mod:OnInitialize(profile) SexyMapZoneTextButton = "always", TimeManagerClockButton = "always", MiniMapMailFrame = "always", - QueueStatusMinimapButton = "always", + CraftingOrder = "always", GarrisonLandingPageMinimapButton = "always", + AddonCompartmentFrame = "never", }, allowDragging = true, lockDragging = false, @@ -237,6 +240,15 @@ function mod:OnInitialize(profile) if not profile.buttons.scale then profile.buttons.scale = 1 end + if not profile.buttons.visibilitySettings.CraftingOrder then + profile.buttons.visibilitySettings.CraftingOrder = "always" + end + if not profile.buttons.visibilitySettings.AddonCompartmentFrame then + profile.buttons.visibilitySettings.AddonCompartmentFrame = "never" + end + if not profile.buttons.visibilitySettings.QueueStatusMinimapButton then + profile.buttons.visibilitySettings.QueueStatusMinimapButton = nil + end self.db = profile.buttons end @@ -291,6 +303,16 @@ function mod:OnEnable() background:SetTexture(136467) -- 136467 = Interface\\Minimap\\UI-Minimap-Background background:SetPoint("CENTER", MinimapCluster.Tracking.Button, "CENTER") + -- Crafting Order Button + overlay = MinimapCluster.IndicatorFrame.CraftingOrderFrame:CreateTexture(nil, "OVERLAY") + overlay:SetSize(53,53) + overlay:SetTexture(136430) -- 136430 = Interface\\Minimap\\MiniMap-TrackingBorder + overlay:SetPoint("CENTER", MiniMapCraftingOrderIcon, "CENTER", 10, -10) + background = MinimapCluster.IndicatorFrame.CraftingOrderFrame:CreateTexture(nil, "BACKGROUND") + background:SetSize(25,25) + background:SetTexture(136467) -- 136467 = Interface\\Minimap\\UI-Minimap-Background + background:SetPoint("CENTER", MiniMapCraftingOrderIcon, "CENTER") + -- Calendar Button overlay = GameTimeFrame:CreateTexture(nil, "OVERLAY") overlay:SetSize(53,53) @@ -301,6 +323,16 @@ function mod:OnEnable() background:SetTexture(136467) -- 136467 = Interface\\Minimap\\UI-Minimap-Background background:SetPoint("CENTER", GameTimeFrame, "CENTER") + -- Addon compartment Button + overlay = AddonCompartmentFrame:CreateTexture(nil, "OVERLAY") + overlay:SetSize(53,53) + overlay:SetTexture(136430) -- 136430 = Interface\\Minimap\\MiniMap-TrackingBorder + overlay:SetPoint("CENTER", AddonCompartmentFrame, "CENTER", 10, -10) + background = AddonCompartmentFrame:CreateTexture(nil, "BACKGROUND") + background:SetSize(25,25) + background:SetTexture(136467) -- 136467 = Interface\\Minimap\\UI-Minimap-Background + background:SetPoint("CENTER", AddonCompartmentFrame, "CENTER") + -- Zoom in Button overlay = Minimap.ZoomIn:CreateTexture(nil, "OVERLAY") overlay:SetSize(53,53) @@ -322,28 +354,16 @@ function mod:OnEnable() background:SetPoint("CENTER", Minimap.ZoomOut, "CENTER") end - if GarrisonLandingPageMinimapButton then - GarrisonLandingPageMinimapButton:SetSize(36, 36) -- Shrink the missions button - -- Stop Blizz changing the icon size || GarrisonLandingPageMinimapButton_UpdateIcon() >> SetLandingPageIconFromAtlases() >> self:SetSize() - hooksecurefunc(GarrisonLandingPageMinimapButton, "SetSize", function() - sm.core.button.SetSize(GarrisonLandingPageMinimapButton, 36, 36) - end) - -- Stop Blizz moving the icon || GarrisonLandingPageMinimapButton_UpdateIcon() >> ApplyGarrisonTypeAnchor() >> anchor:SetPoint() - hooksecurefunc("GarrisonLandingPageMinimapButton_UpdateIcon", function() - mod:UpdateDraggables(GarrisonLandingPageMinimapButton) - end) - else - sm.core.button.SetParent(ExpansionLandingPageMinimapButton, Minimap) - sm.core.button.SetSize(ExpansionLandingPageMinimapButton, 36, 36) -- Shrink the missions button - -- Stop Blizz changing the icon size || Minimap.lua ExpansionLandingPageMinimapButtonMixin:UpdateIcon() >> SetLandingPageIconFromAtlases() >> self:SetSize() - hooksecurefunc(ExpansionLandingPageMinimapButton, "SetSize", function() - sm.core.button.SetSize(ExpansionLandingPageMinimapButton, 36, 36) - end) - -- Stop Blizz moving the icon || Minimap.lua ExpansionLandingPageMinimapButtonMixin:UpdateIcon()>> self:UpdateIconForGarrison() >> ApplyGarrisonTypeAnchor() >> anchor:SetPoint() - hooksecurefunc(ExpansionLandingPageMinimapButton, "UpdateIconForGarrison", function() - mod:UpdateDraggables(ExpansionLandingPageMinimapButton) - end) - end + sm.core.button.SetParent(ExpansionLandingPageMinimapButton, Minimap) + sm.core.button.SetSize(ExpansionLandingPageMinimapButton, 36, 36) -- Shrink the missions button + -- Stop Blizz changing the icon size || Minimap.lua ExpansionLandingPageMinimapButtonMixin:UpdateIcon() >> SetLandingPageIconFromAtlases() >> self:SetSize() + hooksecurefunc(ExpansionLandingPageMinimapButton, "SetSize", function() + sm.core.button.SetSize(ExpansionLandingPageMinimapButton, 36, 36) + end) + -- Stop Blizz moving the icon || Minimap.lua ExpansionLandingPageMinimapButtonMixin:UpdateIcon()>> self:UpdateIconForGarrison() >> ApplyGarrisonTypeAnchor() >> anchor:SetPoint() + hooksecurefunc(ExpansionLandingPageMinimapButton, "UpdateIconForGarrison", function() + mod:UpdateDraggables(ExpansionLandingPageMinimapButton) + end) sm.core:RegisterModuleOptions("Buttons", options, L["Buttons"]) C_Timer.After(1, mod.StartFrameGrab) @@ -357,32 +377,22 @@ local OnFinished, KillAnimation do local fadeStop = false -- Use a variable to prevent fadeout/in when moving the mouse around minimap/icons local restoreGarrisonButtonAnimation = false - local restoreLFGButtonAnimation = false OnFinished = function(anim) -- Work around issues with buttons that have a pulse/fade ring animation. - if restoreGarrisonButtonAnimation and anim:GetParent():GetName() == "GarrisonLandingPageMinimapButton" then + if restoreGarrisonButtonAnimation and anim:GetParent():GetName() == "ExpansionLandingPageMinimapButton" then anim:GetParent().MinimapLoopPulseAnim:Play() restoreGarrisonButtonAnimation = false end - if restoreLFGButtonAnimation and anim:GetParent():GetName() == "QueueStatusMinimapButton" then - anim:GetParent().EyeHighlightAnim:Play() - restoreLFGButtonAnimation = false - end end KillAnimation = function(n, f) -- Work around issues with buttons that have a pulse/fade ring animation. - if n == "GarrisonLandingPageMinimapButton" and (f.MinimapLoopPulseAnim:IsPlaying() or restoreGarrisonButtonAnimation) then + if n == "ExpansionLandingPageMinimapButton" and (f.MinimapLoopPulseAnim:IsPlaying() or restoreGarrisonButtonAnimation) then restoreGarrisonButtonAnimation = true f.MinimapLoopPulseAnim:Stop() return f.MinimapLoopPulseAnim end - if n == "QueueStatusMinimapButton" and (f.EyeHighlightAnim:IsPlaying() or restoreLFGButtonAnimation) then - restoreLFGButtonAnimation = true - f.EyeHighlightAnim:Stop() - return f.EyeHighlightAnim - end end function mod:ShowAllButtons() @@ -390,7 +400,7 @@ do for i = 1, #animFrames do local f = animFrames[i] - local n = namesCompatForDF[f] or f:GetName() + local n = buttonNicknames[f] or f:GetName() if not mod.db.visibilitySettings[n] or mod.db.visibilitySettings[n] == "hover" then f.sexyMapFadeOut:Stop() @@ -415,7 +425,7 @@ do for i = 1, #animFrames do local f = animFrames[i] - local n = namesCompatForDF[f] or f:GetName() + local n = buttonNicknames[f] or f:GetName() if not mod.db.visibilitySettings[n] or mod.db.visibilitySettings[n] == "hover" then if n ~= "GameTimeFrame" or (n == "GameTimeFrame" and C_Calendar.GetNumPendingInvites() < 1) then @@ -441,7 +451,7 @@ do hideFrame.Layout = function() end Minimap.Layout = hideFrame.Layout function mod:NewFrame(f) - local n = namesCompatForDF[f] or f:GetName() + local n = buttonNicknames[f] or f:GetName() -- Only add Blizz buttons & LibDBIcon buttons if blizzButtons[n] or dynamicButtons[n] or n:find("LibDBIcon") then -- Create the animation @@ -455,7 +465,7 @@ do f.sexyMapFadeOut:SetToFinalAlpha(true) -- Work around issues with buttons that have a pulse/fade ring animation. - if n == "GarrisonLandingPageMinimapButton" or n == "QueueStatusMinimapButton" then + if n == "ExpansionLandingPageMinimapButton" then f.sexyMapFadeOut:SetScript("OnFinished", OnFinished) end -- These frames are parented to MinimapCluster, if the map scale is changed they won't drag properly, so we parent to Minimap @@ -463,7 +473,7 @@ do f:ClearAllPoints() f:SetParent(Minimap) f:SetPoint("CENTER", Minimap, "CENTER", -60, 55) - elseif namesCompatForDF[f] then + elseif buttonNicknames[f] or n == "AddonCompartmentFrame" then f:SetParent(Minimap) end @@ -577,7 +587,7 @@ do local x, y = GetCursorPosition() x, y = x / Minimap:GetEffectiveScale(), y / Minimap:GetEffectiveScale() local angle = getCurrentAngle(Minimap, x, y) - local name = namesCompatForDF[moving] or moving:GetName() + local name = buttonNicknames[moving] or moving:GetName() mod.db.dragPositions[name] = angle setPosition(moving, angle) end @@ -589,7 +599,7 @@ do fadeStop = true for i = 1, #animFrames do local f = animFrames[i] - local n = namesCompatForDF[f] or f:GetName() + local n = buttonNicknames[f] or f:GetName() if not mod.db.visibilitySettings[n] or mod.db.visibilitySettings[n] == "hover" then f.sexyMapFadeOut:Stop() @@ -634,7 +644,7 @@ do if frame then local x, y = frame:GetCenter() - local name = namesCompatForDF[frame] or frame:GetName() + local name = buttonNicknames[frame] or frame:GetName() local angle = mod.db.dragPositions[name] or getCurrentAngle(frame:GetParent(), x, y) if angle then setPosition(frame, angle) @@ -642,7 +652,7 @@ do else for i = 1, #animFrames do local f = animFrames[i] - local n = namesCompatForDF[f] or f:GetName() + local n = buttonNicknames[f] or f:GetName() -- Don't move the Clock or Zone Text when changing shape/preset if n ~= "SexyMapZoneTextButton" and n ~= "TimeManagerClockButton" then local x, y = f:GetCenter() @@ -664,15 +674,10 @@ end -- do - local tbl = { - Minimap, MiniMapTrackingButton, MiniMapTracking, TimeManagerClockButton, GameTimeFrame, - MinimapZoomIn, MinimapZoomOut, MiniMapWorldMapButton, GuildInstanceDifficulty, MiniMapChallengeMode, MiniMapInstanceDifficulty, - MiniMapMailFrame, QueueStatusMinimapButton, GarrisonLandingPageMinimapButton - } - local tblDF = { + local buttonTable = { Minimap, MinimapCluster.Tracking, MinimapCluster.Tracking.Button, TimeManagerClockButton, GameTimeFrame, - Minimap.ZoomIn, Minimap.ZoomOut, MinimapCluster.InstanceDifficulty, - MinimapCluster.IndicatorFrame.MailFrame, ExpansionLandingPageMinimapButton + Minimap.ZoomIn, Minimap.ZoomOut, MinimapCluster.InstanceDifficulty, AddonCompartmentFrame, + MinimapCluster.IndicatorFrame.MailFrame, MinimapCluster.IndicatorFrame.CraftingOrderFrame, ExpansionLandingPageMinimapButton } function mod:AddButton(_, button) self:NewFrame(button) @@ -691,14 +696,8 @@ do end function mod:StartFrameGrab() - if MiniMapMailFrame then - for i = 1, #tbl do - mod:NewFrame(tbl[i]) - end - else - for i = 1, #tblDF do - mod:NewFrame(tblDF[i]) - end + for i = 1, #buttonTable do + mod:NewFrame(buttonTable[i]) end local ldbiTbl = ldbi:GetButtonList() diff --git a/SexyMap.lua b/SexyMap.lua index a153486..47a0c6c 100644 --- a/SexyMap.lua +++ b/SexyMap.lua @@ -469,12 +469,6 @@ end) MinimapBackdrop:ClearAllPoints() MinimapBackdrop:SetPoint("CENTER", Minimap, "CENTER", -8, -23) --- Remove this fugly attempt by Blizz -mod.frame.SetParent(AddonCompartmentFrame, mod.frame) -hooksecurefunc(AddonCompartmentFrame, "SetParent", function() - mod.frame.SetParent(AddonCompartmentFrame, mod.frame) -end) - -- To turn off Blizz auto hiding the zoom buttons, we pretend the mouse is always over it. -- The alternative is killing the Minimap OnEnter/OnLeave script which could screw over other addons. -- See MinimapMixin:OnLeave() on line 185 of FrameXML/Minimap.lua diff --git a/localization/deDE.lua b/localization/deDE.lua index 3842738..190499a 100644 --- a/localization/deDE.lua +++ b/localization/deDE.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "Zonentext" L["Zoom In Button"] = "Heranzoom-Knopf" L["Zoom Out Button"] = "Herauszoom-Knopf" +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data." diff --git a/localization/enUS.lua b/localization/enUS.lua index 08ae3f3..b32ad35 100644 --- a/localization/enUS.lua +++ b/localization/enUS.lua @@ -86,6 +86,8 @@ L["Zoom In Button"] = "Zoom In Button" L["Zoom Out Button"] = "Zoom Out Button" L["Map Button"] = "Map Button" L["Clock"] = "Clock" +L.addonCompartment = "Addon Compartment" +L.craftingOrder = "Crafting Order (When Available)" L["Guild Dungeon Difficulty Indicator (When Available)"] = "Guild Dungeon Difficulty Indicator (When Available)" L["Challenge Mode Button (When Available)"] = "Challenge Mode Button (When Available)" diff --git a/localization/esES.lua b/localization/esES.lua index 888061e..9ca102a 100644 --- a/localization/esES.lua +++ b/localization/esES.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "Texto de zona" L["Zoom In Button"] = "Botón de Acercar Zoom" L["Zoom Out Button"] = "Botón de Alejar Zoom" +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua L.updateRate = "Frecuencia de actualización (segundos)" L.updateRateDesc = "Cuanto más bajo sea el valor, más rápido se actualizarán las coordenadas, pero más memoria y CPU se consumirán debido a que se le pedirá al juego datos de coordenadas nuevos." diff --git a/localization/frFR.lua b/localization/frFR.lua index 288a8df..143e1d3 100644 --- a/localization/frFR.lua +++ b/localization/frFR.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "Zone de Texte" L["Zoom In Button"] = "Boutton Zoom Interieur" L["Zoom Out Button"] = "Boutton Zoom Exterieur" +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data." diff --git a/localization/itIT.lua b/localization/itIT.lua index 515994b..0c75d40 100644 --- a/localization/itIT.lua +++ b/localization/itIT.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "Testo Zona" L["Zoom In Button"] = "Zoom d'Ingrandimento" L["Zoom Out Button"] = "Pulsante Zoom d'Ingrandimento" +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data." diff --git a/localization/koKR.lua b/localization/koKR.lua index cce8727..d6dae39 100644 --- a/localization/koKR.lua +++ b/localization/koKR.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "지역 글자" -- Needs review L["Zoom In Button"] = "축소 버튼" -- Needs review L["Zoom Out Button"] = "확대 버튼" -- Needs review +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data." diff --git a/localization/ptBR.lua b/localization/ptBR.lua index 623add8..512191d 100644 --- a/localization/ptBR.lua +++ b/localization/ptBR.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "Texto da Zona" -- Needs review L["Zoom In Button"] = "Botão aumentar o Zoom" L["Zoom Out Button"] = "Botão diminuir o Zoom" +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data." diff --git a/localization/ruRU.lua b/localization/ruRU.lua index 23efbfb..4789df4 100644 --- a/localization/ruRU.lua +++ b/localization/ruRU.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "Текст игровой зоны" -- Needs review L["Zoom In Button"] = "кнопку приближения" -- Needs review L["Zoom Out Button"] = "кнопку отдаления" -- Needs review +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data." diff --git a/localization/zhCN.lua b/localization/zhCN.lua index 811dcc1..7b9fc85 100644 --- a/localization/zhCN.lua +++ b/localization/zhCN.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "地区文本" L["Zoom In Button"] = "放大按钮" L["Zoom Out Button"] = "缩小按钮" +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data." diff --git a/localization/zhTW.lua b/localization/zhTW.lua index 5795355..1b729c6 100644 --- a/localization/zhTW.lua +++ b/localization/zhTW.lua @@ -171,6 +171,10 @@ L["Zone Text"] = "地區文字" L["Zoom In Button"] = "放大按鈕" L["Zoom Out Button"] = "縮小按鈕" +-- Buttons.lua +--L.addonCompartment = "Addon Compartment" +--L.craftingOrder = "Crafting Order (When Available)" + -- Coordinates.lua --L.updateRate = "Update Rate (seconds)" --L.updateRateDesc = "The lower the value, the faster the coordinates will update, but the more memory and CPU will be consumed due to asking the game for fresh coordinate data."