View Single Post
Old 12-12-12, 03:48 AM   #6
Clamsoda
A Cobalt Mageweaver
Join Date: Nov 2011
Posts: 234
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:
  1. /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:
  1. -- Local definitions
  2. local mapScale = 0.60 -- Map scale for easy modification
  3.  
  4. -- Thanks Nevcariel for the function, and Phanx for the modifiaction!
  5. local function dropdownScaleFix(self)
  6.     if DropDownList1:IsVisible() then
  7.         DropDownList1:SetScale(mapScale)
  8.     end
  9. end
  10.  
  11. do
  12.     local mini = GetCVarBool("miniWorldMap")
  13.     SetCVar("miniWorldMap", nil)
  14.     if mini then
  15.         WorldMap_ToggleSizeUp()
  16.     end
  17.  
  18.     WorldMapFrame:SetAttribute("UIPanelLayout-defined", true)
  19.     -- WorldMapFrame:SetAttribute("UIPanelLayout-enabled", true)
  20.     WorldMapFrame:SetAttribute("UIPanelLayout-area", "center")
  21.     WorldMapFrame:EnableKeyboard(false)
  22.     WorldMapFrame:EnableMouse(false)
  23.     WorldMapFrameSizeDownButton:Disable()
  24.     WorldMapContinentDropDownButton:HookScript("OnClick", dropdownScaleFix)   -----------------------------------------
  25.     WorldMapZoneDropDownButton:HookScript("OnClick", dropdownScaleFix)        -- Thanks for the modification, Phanx! --
  26.     WorldMapZoneMinimapDropDownButton:HookScript("OnClick", dropdownScaleFix) -----------------------------------------
  27.     BlackoutWorld:Hide()
  28.    
  29.     hooksecurefunc(WorldMapFrame, "Show", function(self)
  30.         if not InCombatLockdown() then
  31.             self:SetScale(mapScale)
  32.         end
  33.     end)
  34.    
  35.     hooksecurefunc(BlackoutWorld, "Show", function(self) self:Hide() end)
  36.    
  37.     -- This may not be neccesary because the map is forced to size up, then the frame attributes are set.
  38.     -- hooksecurefunc("WorldMap_ToggleSizeUp", function() WorldMapFrame:SetAttribute("UIPanelLayout-area", "center") end)
  39.  
  40.     -- Thanks very much Leatrix!
  41.     WorldMapButton:SetScript("OnMouseWheel", function(self, delta)
  42.         local newLevel = GetCurrentMapDungeonLevel() - delta
  43.         if newLevel >= 1 and newLevel <= GetNumDungeonMapLevels() then
  44.             SetDungeonMapLevel(newLevel)
  45.         end
  46.     end)
  47.    
  48.     -- Thanks very much Leatrix!
  49.     WorldMapShowDigSites:HookScript("OnClick", function(self)
  50.         local filename, texheight, void, void, sub = GetMapInfo()
  51.         if sub or not filename then
  52.             MiniMapWorldMapButton:Click(); MiniMapWorldMapButton:Click();
  53.         end
  54.     end)
  55. end
Clamsoda is offline   Reply With Quote