Skip to content

Commit

Permalink
ZoneText: Make left-clicking the zone text toggle the world map on Dr…
Browse files Browse the repository at this point in the history
…agonflight, closes #276
  • Loading branch information
funkydude committed Oct 30, 2022
1 parent bf306ec commit e002cc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ZoneText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,21 @@ function mod:OnEnable()
hooksecurefunc(MinimapZoneText, "SetParent", function()
sm.core.font.SetParent(MinimapZoneText, sm.core.button)
end)
zoneTextButton = CreateFrame("Button", "SexyMapZoneTextButton", Minimap, "BackdropTemplate") -- Create our own zone text
else
MinimapCluster.ZoneTextButton:SetParent(sm.core.button)
MinimapCluster.BorderTop:SetParent(sm.core.button)
zoneTextButton = CreateFrame("Button", "SexyMapZoneTextButton", Minimap, "BackdropTemplate,SecureActionButtonTemplate") -- Create our own zone text
zoneTextButton:RegisterForClicks("LeftButtonDown", "LeftButtonUp")
zoneTextButton:SetAttribute("type1", "click")
zoneTextButton:SetAttribute("clickbutton1", MinimapCluster.ZoneTextButton)
end

zoneTextButton = CreateFrame("Button", "SexyMapZoneTextButton", Minimap, "BackdropTemplate") -- Create our own zone text
zoneTextButton:SetPoint("BOTTOM", Minimap, "TOP", mod.db.xOffset, mod.db.yOffset)
zoneTextButton:SetClampedToScreen(true)
zoneTextButton:SetClampRectInsets(4,-4,-4,4) -- Allow kissing the edge of the screen when hiding the backdrop border (size 4)
zoneTextButton.oshow = function() end -- Silly workaround to prevent the MBB addon grabing this frame

zoneTextFont = zoneTextButton:CreateFontString()
zoneTextFont:SetPoint("CENTER", zoneTextButton, "CENTER")
zoneTextFont:SetJustifyH("CENTER")
Expand Down

0 comments on commit e002cc4

Please sign in to comment.