Sorry for the double post!
So I have done some work on my map mod, and I've got it producing no taint at all. The only issue I am running into is that to set the scale for the WorldMapFrame, it has to be done OnShow, and to avoid taint, I have to use a combat lockdown function to handle scaling the map OnShow, so if the map is opened in combat, it doesn't taint, but the scale is wrong.
Is there any way to set the scale of the map permanently? Even doing:
Lua Code:
/run WorldMapFrame:SetScale(0.60)
doesn't affect the scale of the world map, unless run when the frame is opened.
Code for refrence:
Lua Code:
-- Local definitions
local mapScale = 0.60 -- Map scale for easy modification
-- Thanks Nevcariel for the function, and Phanx for the modifiaction!
local function dropdownScaleFix(self)
if DropDownList1:IsVisible() then
DropDownList1:SetScale(mapScale)
end
end
do
local mini = GetCVarBool("miniWorldMap")
SetCVar("miniWorldMap", nil)
if mini then
WorldMap_ToggleSizeUp()
end
WorldMapFrame:SetAttribute("UIPanelLayout-defined", true)
-- WorldMapFrame:SetAttribute("UIPanelLayout-enabled", true)
WorldMapFrame:SetAttribute("UIPanelLayout-area", "center")
WorldMapFrame:EnableKeyboard(false)
WorldMapFrame:EnableMouse(false)
WorldMapFrameSizeDownButton:Disable()
WorldMapContinentDropDownButton:HookScript("OnClick", dropdownScaleFix) -----------------------------------------
WorldMapZoneDropDownButton:HookScript("OnClick", dropdownScaleFix) -- Thanks for the modification, Phanx! --
WorldMapZoneMinimapDropDownButton:HookScript("OnClick", dropdownScaleFix) -----------------------------------------
BlackoutWorld:Hide()
hooksecurefunc(WorldMapFrame, "Show", function(self)
if not InCombatLockdown() then
self:SetScale(mapScale)
end
end)
hooksecurefunc(BlackoutWorld, "Show", function(self) self:Hide() end)
-- This may not be neccesary because the map is forced to size up, then the frame attributes are set.
-- hooksecurefunc("WorldMap_ToggleSizeUp", function() WorldMapFrame:SetAttribute("UIPanelLayout-area", "center") end)
-- Thanks very much Leatrix!
WorldMapButton:SetScript("OnMouseWheel", function(self, delta)
local newLevel = GetCurrentMapDungeonLevel() - delta
if newLevel >= 1 and newLevel <= GetNumDungeonMapLevels() then
SetDungeonMapLevel(newLevel)
end
end)
-- Thanks very much Leatrix!
WorldMapShowDigSites:HookScript("OnClick", function(self)
local filename, texheight, void, void, sub = GetMapInfo()
if sub or not filename then
MiniMapWorldMapButton:Click(); MiniMapWorldMapButton:Click();
end
end)
end