comparison CyborgMMO7.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 fc5f52d60d16
children 16b2ff47b6db
comparison
equal deleted inserted replaced
33:1c0af1810e06 34:6ce173840e68
82 82
83 function CyborgMMO_GetSaveData() 83 function CyborgMMO_GetSaveData()
84 assert(VarsLoaded) 84 assert(VarsLoaded)
85 if not CyborgMMO7SaveData then 85 if not CyborgMMO7SaveData then
86 CyborgMMO7SaveData = {} 86 CyborgMMO7SaveData = {}
87 CyborgMMO7SaveData[SaveName] = {} 87 end
88 end 88 return CyborgMMO7SaveData
89 return CyborgMMO7SaveData[SaveName] 89 end
90 end 90
91 91 function CyborgMMO_SetRatSaveData(data)
92 function CyborgMMO_SetSaveData(data, index)
93 assert(VarsLoaded) 92 assert(VarsLoaded)
94 CyborgMMO_GetSaveData()[index] = data 93 local saveData = {}
94 for mode=1,#data do
95 saveData[mode] = {}
96 for button=1,#data[mode] do
97 if data[mode][button] then
98 saveData[mode][button] = data[mode][button]:SaveData()
99 end
100 end
101 end
102 CyborgMMO_GetSaveData().Rat = saveData
95 end 103 end
96 104
97 function CyborgMMO_Event(self, event, ...) 105 function CyborgMMO_Event(self, event, ...)
98 if event == "VARIABLES_LOADED" then 106 if event == "VARIABLES_LOADED" then
99 VarsLoaded = true 107 VarsLoaded = true