mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 01:46:03 +00:00
minimap: add support for minimap toggle keybind
This commit is contained in:
@@ -85,6 +85,7 @@ pfUI:RegisterModule("farmmode", function ()
|
||||
if pfUI.minimap then
|
||||
this.mmoldsize = pfUI.minimap:GetHeight()
|
||||
pfUI.minimap:SetHeight(16)
|
||||
pfUI.minimap:SetAlpha(1)
|
||||
pfUI.farmmap.button:Show()
|
||||
end
|
||||
|
||||
@@ -93,7 +94,7 @@ pfUI:RegisterModule("farmmode", function ()
|
||||
end)
|
||||
|
||||
pfUI.farmmap:SetScript("OnHide", function()
|
||||
Minimap:Show()
|
||||
ShowUIPanel(Minimap)
|
||||
|
||||
-- move existing nodes to new minimap
|
||||
MoveNodes(Minimap)
|
||||
@@ -113,7 +114,8 @@ pfUI:RegisterModule("farmmode", function ()
|
||||
|
||||
-- save old minimap height
|
||||
if pfUI.minimap then
|
||||
pfUI.minimap:SetHeight(this.mmoldsize)
|
||||
pfUI.minimap:SetHeight(140)
|
||||
pfUI.minimap:SetAlpha(1)
|
||||
pfUI.farmmap.button:Hide()
|
||||
end
|
||||
|
||||
|
||||
+22
-2
@@ -1,4 +1,5 @@
|
||||
pfUI:RegisterModule("minimap", function ()
|
||||
local border = tonumber(pfUI_config.appearance.border.default)
|
||||
MinimapToggleButton:Hide()
|
||||
MinimapBorderTop:Hide()
|
||||
MinimapZoneTextButton:Hide()
|
||||
@@ -15,6 +16,9 @@ pfUI:RegisterModule("minimap", function ()
|
||||
pfUI.minimap:SetWidth(140)
|
||||
pfUI.minimap:SetHeight(140)
|
||||
pfUI.minimap:SetFrameStrata("BACKGROUND")
|
||||
pfUI.minimap:SetScript("OnShow", function()
|
||||
QueueFunction(ShowUIPanel, Minimap)
|
||||
end)
|
||||
|
||||
Minimap:SetParent(pfUI.minimap)
|
||||
Minimap:SetPoint("CENTER", pfUI.minimap, "CENTER", 0.5, -.5)
|
||||
@@ -22,8 +26,24 @@ pfUI:RegisterModule("minimap", function ()
|
||||
Minimap:SetMaskTexture("Interface\\AddOns\\pfUI\\img\\minimap")
|
||||
Minimap:EnableMouseWheel(true)
|
||||
Minimap:SetScript("OnMouseWheel", function()
|
||||
if(arg1 > 0) then Minimap_ZoomIn() else Minimap_ZoomOut() end
|
||||
end)
|
||||
if(arg1 > 0) then Minimap_ZoomIn() else Minimap_ZoomOut() end
|
||||
end)
|
||||
|
||||
hooksecurefunc("ToggleMinimap", function()
|
||||
if pfUI.farmmap and pfUI.farmmap:IsShown() then
|
||||
Minimap:Hide()
|
||||
return
|
||||
end
|
||||
|
||||
if Minimap:IsVisible() then
|
||||
pfUI.minimap:SetHeight(140)
|
||||
pfUI.minimap:SetAlpha(1)
|
||||
else
|
||||
pfUI.minimap:SetHeight(-border-5)
|
||||
pfUI.minimap:SetAlpha(0)
|
||||
Minimap:Hide()
|
||||
end
|
||||
end, true)
|
||||
|
||||
-- battleground icon
|
||||
MiniMapBattlefieldFrame:ClearAllPoints()
|
||||
|
||||
Reference in New Issue
Block a user