More fixes

This commit is contained in:
Tercio Jose
2022-11-27 15:24:32 -03:00
parent 25cb9e8ffe
commit ebe8c496d1
22 changed files with 233 additions and 65 deletions
+49 -15
View File
@@ -241,6 +241,11 @@
--Seal of Command
[20424] = 69403, --53739 and 53733
--odyn's fury warrior
[385062] = 385059,
[385061] = 385059,
[385060] = 385059,
}
else --retail
@@ -5161,7 +5166,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not isWOTLK) then
C_Timer.After(1, function()
if (Details.show_warning_id1) then
if (Details.show_warning_id1_amount < 10) then
if (Details.show_warning_id1_amount < 2) then
Details.show_warning_id1_amount = Details.show_warning_id1_amount + 1
Details:Msg("|cFFFFFF00you might find differences on damage done, this is due to a bug in the game client, nothing related to Details! itself (" .. Details.show_warning_id1_amount .. " / 10).")
end
@@ -5276,7 +5281,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not isWOTLK) then
C_Timer.After(1, function()
if (Details.show_warning_id1) then
if (Details.show_warning_id1_amount < 10) then
if (Details.show_warning_id1_amount < 2) then
Details.show_warning_id1_amount = Details.show_warning_id1_amount + 1
Details:Msg("|cFFFFFF00you may find differences on damage done, this is due to a bug in the game client, nothing related to Details! itself (" .. Details.show_warning_id1_amount .. " / 10).")
end
@@ -6021,18 +6026,34 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
local saver = CreateFrame("frame", nil, UIParent)
saver:RegisterEvent("PLAYER_LOGOUT")
saver:SetScript("OnEvent", function(...)
__details_backup = __details_backup or {
_exit_error = {},
_instance_backup = {},
}
local exitErrors = __details_backup._exit_error
local addToExitErrors = function(text)
table.insert(exitErrors, 1, text)
table.remove(exitErrors, 10)
end
local currentStep = ""
--save the time played on this class, run protected
pcall(function()
local savePlayTimeClass, savePlayTimeError = pcall(function()
Details.SavePlayTimeOnClass()
end)
local currentStep = 0
if (not savePlayTimeClass) then
addToExitErrors("Saving Play Time:" .. savePlayTimeError)
end
--SAVINGDATA = true
_detalhes_global.exit_log = {}
_detalhes_global.exit_errors = _detalhes_global.exit_errors or {}
currentStep = "Checking the framework integrity"
if (not _detalhes.gump) then
--failed to load the framework
tinsert(_detalhes_global.exit_log, "The framework wasn't in Details member 'gump'.")
@@ -6041,9 +6062,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
local saver_error = function(errortext)
_detalhes_global = _detalhes_global or {}
tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack())
tremove(_detalhes_global.exit_errors, 6)
--if the error log cause an error?
local writeLog = function()
_detalhes_global = _detalhes_global or {}
tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack())
tremove(_detalhes_global.exit_errors, 6)
addToExitErrors(currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack())
end
xpcall(writeLog, addToExitErrors)
end
_detalhes.saver_error_func = saver_error
@@ -6058,17 +6084,24 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--do not save window pos
if (_detalhes.tabela_instancias) then
currentStep = "Dealing With Instances"
tinsert(_detalhes_global.exit_log, "2 - Clearing user place from instances.")
for id, instance in _detalhes:ListInstances() do
if (id) then
tinsert(_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".")
if (instance.baseframe) then
instance.baseframe:SetUserPlaced (false)
instance.baseframe:SetDontSavePosition (true)
local clearInstances = function()
currentStep = "Dealing With Instances"
tinsert(_detalhes_global.exit_log, "2 - Clearing user place from instances.")
for id, instance in _detalhes:ListInstances() do
if (id) then
tinsert(_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".")
if (instance.baseframe) then
instance.baseframe:SetUserPlaced (false)
instance.baseframe:SetDontSavePosition (true)
end
end
end
end
xpcall(clearInstances, saver_error)
else
tinsert(_detalhes_global.exit_errors, 1, "not _detalhes.tabela_instancias")
tremove(_detalhes_global.exit_errors, 6)
addToExitErrors("not _detalhes.tabela_instancias")
end
--leave combat start save tables
@@ -6087,6 +6120,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (_detalhes.wipe_full_config) then
tinsert(_detalhes_global.exit_log, "5 - Is a full config wipe.")
addToExitErrors("true: _detalhes.wipe_full_config")
_detalhes_global = nil
_detalhes_database = nil
return