Thread: SetScale
View Single Post
05-27-10, 09:41 AM   #14
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Simple.

Add this to the .toc file:
Code:
##SavedVariables: FerousMinimapScale
And this to the top of the .lua file:
Code:
local addon = ...

SLASH_MYSCRIPT1 = "/scale";
SlashCmdList["MYSCRIPT"] = function(cmd)
	if not tonumber(cmd) then return end
	Minimap:SetScale(tonumber(cmd))
	FerousMinimapScale = tonumber(cmd)
end

local holder = CreateFrame("Frame")
holder:RegisterEvent("ADDON_LOADED")
holder:SetScript("OnEvent", function(self, arg1)
	if arg1~=addon then return end
	FerousMinimapScale = FerousMinimapScale or Minimap:GetScale()
	Minimap:SetResizable(true)
	Minimap:SetScale(FerousMinimapScale)
end)
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote