Added option to Enable/Disable augmentation extra bar; Disabled DataStorage for 11.0 revamp

This commit is contained in:
Tercio Jose
2024-02-28 19:18:30 -03:00
parent ac57a39c70
commit 19b2556106
7 changed files with 81 additions and 50 deletions
+34 -10
View File
@@ -3071,12 +3071,12 @@ function Details:ShowExtraStatusbar(thisLine, amount, extraAmount, totalAmount,
extraStatusbar.OnEnterCallback = onEnterFunc
extraStatusbar.OnLeaveCallback = onLeaveFunc
if (Details.combat_log.evoker_calc_damage) then
extraStatusbar:SetAlpha(0.8)
extraStatusbar.defaultAlpha = 0.8
if (Details.combat_log.calc_evoker_damage) then
extraStatusbar:SetAlpha(0.2)
extraStatusbar.defaultAlpha = 0.2
else
extraStatusbar:SetAlpha(0.1)
extraStatusbar.defaultAlpha = 0.1
extraStatusbar:SetAlpha(0.7)
extraStatusbar.defaultAlpha = 0.7
end
extraStatusbar:Show()
else
@@ -3134,7 +3134,13 @@ function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefre
Details.FadeHandler.Fader(thisLine, "out")
if (self.total_extra and self.total_extra > 0) then
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
if (self.spec == 1473) then
if (Details.combat_log.calc_evoker_damage) then
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
end
else
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
end
end
return self:RefreshBarra(thisLine, instance)
@@ -3151,12 +3157,18 @@ function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefre
thisLine.last_value = percent --reseta o ultimo valor da barra
if (self.total_extra and self.total_extra > 0) then
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
if (self.spec == 1473) then
if (Details.combat_log.calc_evoker_damage) then
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
end
else
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
end
end
return self:RefreshBarra(thisLine, instance)
elseif (percent ~= thisLine.last_value) then --continua mostrando a mesma tabela ento compara a porcentagem
elseif (percent ~= thisLine.last_value) then
--apenas atualizar
if (bUseAnimations and self.spec ~= 1473) then
thisLine.animacao_fim = percent
@@ -3166,13 +3178,25 @@ function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefre
thisLine.last_value = percent
if (self.total_extra and self.total_extra > 0) then
Details:ShowExtraStatusbar(thisLine, self.total, self.total_extra, totalValue, topValue, instance)
if (self.spec == 1473) then
if (Details.combat_log.calc_evoker_damage) then
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
end
else
Details:ShowExtraStatusbar(thisLine, self.total, self.total_extra, totalValue, topValue, instance)
end
end
return self:RefreshBarra(thisLine, instance)
else
if (self.total_extra and self.total_extra > 0) then
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
if (self.spec == 1473) then
if (Details.combat_log.calc_evoker_damage) then
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
end
else
handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue)
end
end
end
end
+24 -13
View File
@@ -714,22 +714,25 @@ end
_detalhes.background_tasks_loop = _detalhes:ScheduleRepeatingTimer ("DoBackgroundTasks", 120)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--storage stuff ~storage
local CONST_ADDONNAME_DATASTORAGE = "Details_DataStorage"
--global database
_detalhes.storage = {}
function _detalhes.storage:OpenRaidStorage()
--check if the storage is already loaded
if (not IsAddOnLoaded ("Details_DataStorage")) then
local loaded, reason = LoadAddOn ("Details_DataStorage")
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
return
end
end
do return end
--get the storage table
local db = DetailsDataStorage
@@ -745,7 +748,7 @@ function _detalhes.storage:OpenRaidStorage()
return db
end
function _detalhes.storage:HaveDataForEncounter (diff, encounter_id, guild_name)
function _detalhes.storage:HaveDataForEncounter(diff, encounter_id, guild_name)
local db = _detalhes.storage:OpenRaidStorage()
if (not db) then
@@ -753,7 +756,7 @@ function _detalhes.storage:HaveDataForEncounter (diff, encounter_id, guild_name)
end
if (guild_name and type(guild_name) == "boolean") then
guild_name = GetGuildInfo ("player")
guild_name = GetGuildInfo("player")
end
local table = db [diff]
@@ -1416,6 +1419,8 @@ local createStorageTables = function()
end
function _detalhes.ScheduleLoadStorage()
do return end
if (InCombatLockdown() or UnitAffectingCombat("player")) then
if (_detalhes.debug) then
print("|cFFFFFF00Details! storage scheduled to load (player in combat).")
@@ -1423,8 +1428,8 @@ function _detalhes.ScheduleLoadStorage()
_detalhes.schedule_storage_load = true
return
else
if (not IsAddOnLoaded("Details_DataStorage")) then
local loaded, reason = LoadAddOn("Details_DataStorage")
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
if (_detalhes.debug) then
print("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.")
@@ -1436,7 +1441,7 @@ function _detalhes.ScheduleLoadStorage()
end
end
if (IsAddOnLoaded("Details_DataStorage")) then
if (C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
_detalhes.schedule_storage_load = nil
_detalhes.StorageLoaded = true
if (_detalhes.debug) then
@@ -1454,11 +1459,14 @@ function _detalhes.GetStorage()
return DetailsDataStorage
end
--this function is used on the breakdown window to show ranking and on the main window when hovering over the spec icon
function _detalhes.OpenStorage()
--if the player is in combat, this function return false, if failed to load by other reason it returns nil
do return end
--check if the storage is already loaded
if (not IsAddOnLoaded("Details_DataStorage")) then
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
--can't open it during combat
if (InCombatLockdown() or UnitAffectingCombat("player")) then
if (_detalhes.debug) then
@@ -1467,7 +1475,7 @@ function _detalhes.OpenStorage()
return false
end
local loaded, reason = LoadAddOn("Details_DataStorage")
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
if (_detalhes.debug) then
print("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.")
@@ -1477,7 +1485,7 @@ function _detalhes.OpenStorage()
local db = createStorageTables()
if (db and IsAddOnLoaded("Details_DataStorage")) then
if (db and C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
_detalhes.StorageLoaded = true
end
@@ -1489,10 +1497,13 @@ end
Details.Database = {}
--this function is called on storewipe and storeencounter
function Details.Database.LoadDB()
do return end
--check if the storage is already loaded
if (not IsAddOnLoaded("Details_DataStorage")) then
local loaded, reason = LoadAddOn("Details_DataStorage")
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
if (_detalhes.debug) then
print("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.")
+3 -3
View File
@@ -5327,8 +5327,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--if the current raid is current tier raid, pre-load the storage database
if (zoneType == "raid") then
if (Details.InstancesToStoreData [zoneMapID]) then
Details.ScheduleLoadStorage()
if (Details.InstancesToStoreData[zoneMapID]) then
--Details.ScheduleLoadStorage()
end
end
@@ -5702,7 +5702,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--when the user requested data from the storage but is in combat lockdown
if (Details.schedule_storage_load) then
Details.schedule_storage_load = nil
Details.ScheduleLoadStorage()
--Details.ScheduleLoadStorage()
end
--store a boss encounter when out of combat since it might need to load the storage
+4 -3
View File
@@ -7111,13 +7111,14 @@ do
{--show evoker bar
type = "toggle",
get = function() return Details.combat_log.evoker_calc_damage end,
get = function() return Details.combat_log.calc_evoker_damage end,
set = function(self, fixedparam, value)
Details.combat_log.evoker_calc_damage = value
Details.combat_log.calc_evoker_damage = value
afterUpdate()
Details:ClearParserCache()
currentInstance:InstanceReset()
end,
name = DF:AddClassIconToText("Predict Augmentation Damage", false, "EVOKER"),
name = DF:AddClassIconToText("Show Augmentation Extra Bar", false, "EVOKER"),
desc = "Calculate how much the Augmentation Evoker are buffing other players",
boxfirst = true,
},
+1 -1
View File
@@ -1168,7 +1168,7 @@ local default_player_data = {
track_hunter_frenzy = false,
merge_gemstones_1007 = false,
merge_critical_heals = false,
evoker_calc_damage = false,
calc_evoker_damage = true,
evoker_show_realtimedps = false,
},
-8
View File
@@ -1500,14 +1500,6 @@ function SlashCmdList.DETAILS (msg, editbox)
print("profile name:", Details.always_use_profile_name)
print("version:", Details.build_counter >= Details.alpha_build_counter and Details.build_counter or Details.alpha_build_counter)
elseif (msg == "record") then
Details.ScheduleLoadStorage()
Details.TellDamageRecord = C_Timer.NewTimer(0.6, Details.PrintEncounterRecord)
Details.TellDamageRecord.Boss = 2032
Details.TellDamageRecord.Diff = 16
elseif (msg == "recordtest") then
local f = DetailsRecordFrameAnimation
@@ -1,7 +1,7 @@
DETAILS_STORAGE_VERSION = 5
DETAILS_STORAGE_VERSION = 6
function _detalhes:CreateStorageDB()
function Details:CreateStorageDB()
DetailsDataStorage = {
VERSION = DETAILS_STORAGE_VERSION,
[14] = {}, --normal mode (raid)
@@ -13,26 +13,29 @@ function _detalhes:CreateStorageDB()
return DetailsDataStorage
end
local f = CreateFrame ("frame", nil, UIParent)
local f = CreateFrame("frame", nil, UIParent)
f:Hide()
f:RegisterEvent ("ADDON_LOADED")
f:RegisterEvent("ADDON_LOADED")
f:SetScript ("OnEvent", function (self, event, addonName)
f:SetScript("OnEvent", function(self, event, addonName)
if (addonName == "Details_DataStorage") then
DetailsDataStorage = DetailsDataStorage or _detalhes:CreateStorageDB()
DetailsDataStorage = DetailsDataStorage or Details:CreateStorageDB()
DetailsDataStorage.Data = {}
print("loaded...")
if (DetailsDataStorage.VERSION < DETAILS_STORAGE_VERSION) then
print("is outdated")
--> do revisions
if (DetailsDataStorage.VERSION < 5) then
table.wipe (DetailsDataStorage)
DetailsDataStorage = _detalhes:CreateStorageDB()
if (DetailsDataStorage.VERSION < 6) then
print("outdated two, data wiped!")
table.wipe(DetailsDataStorage)
DetailsDataStorage = Details:CreateStorageDB()
end
end
if (_detalhes and _detalhes.debug) then
print ("|cFFFFFF00Details! Storage|r: loaded!")
if (Details and Details.debug) then
print("|cFFFFFF00Details! Storage|r: loaded!")
end
DETAILS_STORAGE_LOADED = true
end
end)