You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

4 years ago
DETAILS_STORAGE_VERSION = 5
function _detalhes:CreateStorageDB()
DetailsDataStorage = {
VERSION = DETAILS_STORAGE_VERSION,
[14] = {}, --normal mode (raid)
[15] = {}, --heroic mode (raid)
[16] = {}, --mythic mode (raid)
["mythic_plus"] = {}, --(dungeons)
["saved_encounters"] = {}, --(a segment)
}
return DetailsDataStorage
end
3 years ago
local f = CreateFrame("frame", nil, UIParent)
4 years ago
f:Hide()
f:RegisterEvent("ADDON_LOADED")
4 years ago
3 years ago
f:SetScript("OnEvent", function(self, event, addonName)
4 years ago
if (addonName == "Details_DataStorage") then
DetailsDataStorage = DetailsDataStorage or _detalhes:CreateStorageDB()
if (DetailsDataStorage.VERSION < DETAILS_STORAGE_VERSION) then
3 years ago
--do revisions
4 years ago
if (DetailsDataStorage.VERSION < 5) then
3 years ago
table.wipe(DetailsDataStorage)
4 years ago
DetailsDataStorage = _detalhes:CreateStorageDB()
end
end
if (_detalhes and _detalhes.debug) then
3 years ago
print("|cFFFFFF00Details! Storage|r: loaded!")
4 years ago
end
DETAILS_STORAGE_LOADED = true
end
end)