View Single Post
  #14  
Unread 09-27-2010, 06:52 AM
Kragenwar Kragenwar is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 26
I don't know if you did as Digitial Utopia suggested and declared Data in your satchel class as self.Data (since you only posted your main and didnt repost your Satchel class). But if you did, then when saving your data variable from your main you may need to go
Code:
Turbine.PluginData.Save( Turbine.DataScope.Character, "Satchel", SatchelWindow.Data );
Alternatively you could also put the save line in the code where you write the position to data

Code:
----SAVE WINDOW POSITION----
	self.PositionChanged=function(sender,args)
		self.Data.x,self.Data.y=self:GetPosition()
		Turbine.PluginData.Save( Turbine.DataScope.Character, "Satchel", self.Data );
	end
I haven't played with the unload code Digital Utopia posted, but I am going to take a guess that maybe your call to save needs to come before UnloadPlugin(); Just a guess tho
Code:
Plugins[pluginName].Unload = function(self,sender,args)
       Turbine.PluginData.Save( Turbine.DataScope.Character, "Satchel", SatchelWindow.Data );			
       UnloadPlugin();
end
Also I noticed in your class code you posted earlier you also allow changing of size, which means you might want to save the size as well.

Last edited by Kragenwar : 09-27-2010 at 07:14 AM.
Reply With Quote