map: add some functions and theming to the worldmap

This commit is contained in:
shagu
2017-01-01 22:04:24 +01:00
parent ed3d6b087e
commit 1bbf47ad2b
2 changed files with 63 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
pfUI:RegisterModule("map", function ()
local pfMapLoader = CreateFrame("Frame", nil, UIParent)
pfMapLoader:RegisterEvent("PLAYER_ENTERING_WORLD")
pfMapLoader:SetScript("OnEvent", function()
-- do not load if other map addon is loaded
if Cartographer then return end
if METAMAP_TITLE then return end
UIPanelWindows["WorldMapFrame"] = { area = "center" }
WorldMapFrame:SetScript('OnShow', function()
-- default events
UpdateMicroButtons();
PlaySound("igQuestLogOpen");
CloseDropDownMenus();
-- customize
WorldMapFrame:SetMovable(true)
WorldMapFrame:EnableMouse(true)
WorldMapFrame:EnableKeyboard(false)
WorldMapFrame:EnableMouseWheel(1)
WorldMapFrame:SetScript("OnMouseWheel", function()
if IsShiftKeyDown() then
WorldMapFrame:SetAlpha(WorldMapFrame:GetAlpha() + arg1/10)
end
if IsControlKeyDown() then
WorldMapFrame:SetScale(WorldMapFrame:GetScale() + arg1/10)
end
end)
WorldMapFrame:SetScript("OnMouseDown",function()
WorldMapFrame:StartMoving()
end)
WorldMapFrame:SetScript("OnMouseUp",function()
WorldMapFrame:StopMovingOrSizing()
end)
WorldMapFrame:ClearAllPoints()
WorldMapFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
WorldMapFrame:SetWidth(WorldMapButton:GetWidth() + 15)
WorldMapFrame:SetHeight(WorldMapButton:GetHeight() + 55)
WorldMapFrameCloseButton:SetPoint("TOPRIGHT", WorldMapFrame, "TOPRIGHT", 0, 0)
pfUI.api:CreateBackdrop(WorldMapFrame)
WorldMapFrame:SetScale(.7)
BlackoutWorld:Hide()
for i,v in ipairs({WorldMapFrame:GetRegions()}) do
if v.SetTexture then
v:SetTexture("")
end
if v.SetText then
v:SetText("")
end
end
end)
end)
end)
+1
View File
@@ -58,3 +58,4 @@ modules\roll.lua
modules\infight.lua
modules\sellvalue.lua
modules\eqcompare.lua
modules\map.lua