Thread: SetScale
View Single Post
05-27-10, 02:18 PM   #20
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
Originally Posted by Xrystal View Post
Just change MidgetMapDB to whatever name you want to save it with .. just change it to the same in the TOC as well as your LUA file
yeah I did that:P here is what I got...

Code:
local defaults = { 
align = "TOPRIGHT", 
x = -25, 
y = -25, 
scale = 0.9
 }

local addon = ...

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

local MidgetMap = CreateFrame("Frame")
MidgetMap:RegisterEvent("ADDON_LOADED")
MidgetMap:SetScript("OnEvent", function(self, arg1)
	if arg1~=addon then return end
	Minimap:SetResizable(true)
	MidgetMap = Minimap.SetScale
	Minimap:SetScale(MidgetMapDB.scale)
end)
Now, I know I'm doing something wrong, or something here ain't adding up.

it's saving in the saved variables as... (Yes, it is saving when I change scale ingame, but to this)

MidgetMapDB = {
["scale"] = 0.7,
}
I'm trying to figure out why the scale is quoted and bracketed.. I know its something in the code that I messed up or is messing up. This was NightCrackers code that I used as well, and for some reason.. It aint saving without quotes and brackets :P

I'm getting there, I'm getting there.

edit - I also figure, with all my noobish mistakes, this might help someone in the future, so I figured I'd keep going :P lol

Last edited by Ferous : 05-27-10 at 02:20 PM.
  Reply With Quote