Files
ShagaTweaks/mods/minimap-tweaks.lua
T
shagu 6c26bc6190 core: don't rely on sane global environment
some addons like to provide a broken _G variable to
the global environment breaking every other addon that
relies on it if existing. With this commit, make ShaguTweaks
no longer re-use the global _G, even if existing.
2022-11-19 16:59:12 +01:00

29 lines
842 B
Lua

local _G = ShaguTweaks.GetGlobalEnv()
local module = ShaguTweaks:register({
title = "MiniMap Tweaks",
description = "Hides unnecessary mini map buttons and allows to zoom using the mouse wheel.",
expansions = { ["vanilla"] = true, ["tbc"] = true },
category = "World & MiniMap",
enabled = nil,
})
module.enable = function(self)
-- hide daytime circle
GameTimeFrame:Hide()
GameTimeFrame:SetScript("OnShow", function() this:Hide() end)
-- hide minimap zone background
MinimapBorderTop:Hide()
MinimapToggleButton:Hide()
MinimapZoneTextButton:SetPoint("CENTER", 7, 85)
-- hide zoom buttons and enable mousewheel
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
Minimap:EnableMouseWheel(true)
Minimap:SetScript("OnMouseWheel", function()
if(arg1 > 0) then Minimap_ZoomIn() else Minimap_ZoomOut() end
end)
end