Thread: SetScale
View Single Post
05-27-10, 03:04 PM   #29
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,953
Hmm well I can see that this is glaring at me

Code:
MidgetMap:SetScript("OnEvent", function(self, arg1)
	if arg1~=MidgetMap then return end
	Minimap:SetResizable(true)
	MidgetMapDB = Minimap.scale
	Minimap:SetScale(MidgetMapDB.scale)
end)
By setting MidgetMapDB to Minimap.scale you are overwriting the stored scale value.

Code:
MidgetMap:SetScript("OnEvent", function(self, arg1)
	if arg1~=MidgetMap then return end
	Minimap:SetResizable(true)
	Minimap:SetScale(MidgetMapDB.scale)
end)
That should work fine right there.

Also, at the top of the lua somewhere it might be a good idea to set a default value for the MidgetMapDB scale so that it will use that if nothing has been written to the saved variables file yet.

Code:
MidgetMapDB = {}
MidgetMapDB.scale = 0.9
This will create a default saved variables table that will then get replaced by the saved one once it is loaded. if one doesn't exist it will use these values.

Edit: And what Seerah said .. rofl
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote