diff RatPageModel.lua @ 34:6ce173840e68

Reworked the whole "wow object" system: - Only save what is strictly necessary. - Save appropriate persistent information for all objects (like spellIDs instead of spellBook+spellIndex). - Fixed Battle Pets objects (non-combat pets in pre-MoP). - Fixed item objects. - Cleaned and simplified most objects implementation. - Moved the settings and button profile to the root of the saved data, rather than in a per-character sub-table (that data is already tagged as saved per character). This should fix most issues with objects changing without user interaction on diverse occasions. Old profiles are not converted to the new system. This will come soon. Some issues persist due to the asynchronous loading of some informations: - Pet icons are never properly loaded from saved data. - Items are not properly loaded the first time the UI is started (a "/reload ui" or disconnect/connect cycle fixes this problem).
author madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09
date Thu, 25 Apr 2013 01:31:31 +0000
parents e8a004a4177b
children ce4ddefb68c2
line wrap: on
line diff
--- a/RatPageModel.lua	Thu Apr 25 01:31:26 2013 +0000
+++ b/RatPageModel.lua	Thu Apr 25 01:31:31 2013 +0000
@@ -77,10 +77,10 @@
 		for mode=1,RAT7.MODES do
 			for button=1,RAT7.BUTTONS do
 				if self.data[mode][button] then
-					local object = CyborgMMO_CreateWowObject(self.data[mode][button].Type, self.data[mode][button].Detail, self.data[mode][button].Subdetail)
+					local object = CyborgMMO_CreateWowObject(self.data[mode][button].type, self.data[mode][button].detail, self.data[mode][button].subdetail)
 					self:SetObjectOnButtonNoUpdate(button, mode, object)
 				else
-					local object = CyborgMMO_CreateWowObject("", "", "")
+					local object = CyborgMMO_CreateWowObject()
 					self:SetObjectOnButtonNoUpdate(button, mode, object)
 					self.data[mode][button] = object
 				end
@@ -92,7 +92,7 @@
 
 function RatPageModel_methods:SaveData()
 	CyborgMMO_DPrint("Saving...")
-	CyborgMMO_SetSaveData(self.data, "Rat")
+	CyborgMMO_SetRatSaveData(self.data)
 end
 
 function RatPageModel_methods:SetMode(mode)
@@ -122,10 +122,10 @@
 
 	if object then
 		object:SetBinding(CyborgMMO_ProfileKeyBindings[((mode-1)*RAT7.BUTTONS)+button])
-		if("callback" == object.Type) then
+		if "callback" == object.type then
 			CyborgMMO_DPrint("trying to set texture")
 			local slot = getglobal("CyborgMMO_MainPageSlotListSlot"..button)
-			slot:SetNormalTexture(object.Texture)
+			slot:SetNormalTexture(object.texture)
 		end
 	else
 		CyborgMMO_DPrint("clearing "..button)