From 717424bd83a939e3a51d1d14ac553f1103e5931b Mon Sep 17 00:00:00 2001 From: Flamanis Date: Sat, 23 Jul 2022 15:48:08 -0500 Subject: [PATCH 1/3] Add Reset on new PVP option --- classes/container_segments.lua | 6 +++++- core/parser.lua | 8 +++++++- frames/window_options2_sections.lua | 10 ++++++++++ functions/profiles.lua | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/classes/container_segments.lua b/classes/container_segments.lua index 42c1d58f..650bf2f0 100644 --- a/classes/container_segments.lua +++ b/classes/container_segments.lua @@ -398,7 +398,7 @@ function _detalhes:CheckFreeze (instancia, index_liberado, tabela) end end -function _detalhes:SetOverallResetOptions (reset_new_boss, reset_new_challenge, reset_on_logoff) +function _detalhes:SetOverallResetOptions (reset_new_boss, reset_new_challenge, reset_on_logoff, reset_new_pvp) if (reset_new_boss == nil) then reset_new_boss = _detalhes.overall_clear_newboss end @@ -408,10 +408,14 @@ function _detalhes:SetOverallResetOptions (reset_new_boss, reset_new_challenge, if (reset_on_logoff == nil) then reset_on_logoff = _detalhes.overall_clear_logout end + if (reset_new_pvp == nil) then + reset_new_pvp = _detalhes.overall_clear_pvp + end _detalhes.overall_clear_newboss = reset_new_boss _detalhes.overall_clear_newchallenge = reset_new_challenge _detalhes.overall_clear_logout = reset_on_logoff + _detalhes.overall_clear_pvp = reset_new_pvp end function historico:resetar_overall() diff --git a/core/parser.lua b/core/parser.lua index 905ad4eb..1465ee75 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -4891,6 +4891,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (_detalhes.debug) then _detalhes:Msg ("(debug) zone type is now 'pvp'.") end + if(not _detalhes.is_in_battleground and _detalhes.overall_clear_pvp) then + _detalhes.tabela_historico:resetar_overall() + end _detalhes.is_in_battleground = true @@ -4930,6 +4933,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end if (not _detalhes.is_in_arena) then + if (_detalhes.overall_clear_pvp) then + _detalhes.tabela_historico:resetar_overall() + end --> reset spec cache if broadcaster requested if (_detalhes.streamer_config.reset_spec_cache) then wipe (_detalhes.cached_specs) @@ -6335,4 +6341,4 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - end \ No newline at end of file + end diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index b5ea2d20..6d812c0c 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -485,6 +485,16 @@ do name = Loc ["STRING_OPTIONS_OVERALL_MYTHICPLUS"], desc = Loc ["STRING_OPTIONS_OVERALL_MYTHICPLUS_DESC"], }, + {--erase overall data on logout + type = "toggle", + get = function() return _detalhes.overall_clear_pvp end, + set = function (self, fixedparam, value) + _detalhes:SetOverallResetOptions(nil, nil, nil, value) + afterUpdate() + end, + name = "Clear On Start PVP", --localize-me + desc = "When enabled, overall data is automatically wiped when a new arena or battleground starts.", --localize-me + }, {--erase overall data on logout type = "toggle", get = function() return _detalhes.overall_clear_logout end, diff --git a/functions/profiles.lua b/functions/profiles.lua index aefc9ccd..74d373ab 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -987,6 +987,7 @@ local default_profile = { overall_clear_newchallenge = true, overall_clear_newtorghast = true, overall_clear_logout = false, + overall_clear_pvp = true, data_cleanup_logout = false, close_shields = false, pvp_as_group = true, From a623d63a1c634d81b41de3586219ef8edb3d35fd Mon Sep 17 00:00:00 2001 From: Flamanis Date: Tue, 9 Aug 2022 14:09:42 -0500 Subject: [PATCH 2/3] Provide Data1,2,3 to custom text funcs Allows users to write a custom text function that freely modifies data1, data2, and data3 on custom texts. --- core/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/util.lua b/core/util.lua index 9e9ac127..b6d8e4e7 100644 --- a/core/util.lua +++ b/core/util.lua @@ -743,7 +743,7 @@ function_cache [str] = func end - local okey, value = _pcall (func, parameters_cache [1], parameters_cache [2], parameters_cache [3], parameters_cache [4]) + local okey, value = _pcall (func, parameters_cache [1], parameters_cache [2], parameters_cache [3], parameters_cache [4], arguments_cache[1], arguments_cache[2], arguments_cache[3]) if (not okey) then _detalhes:Msg ("|cFFFF9900error on custom text|r:", value) return 0 From 31af0f616d5d5be838d969392555cba5e6e9916c Mon Sep 17 00:00:00 2001 From: Flamanis Date: Tue, 9 Aug 2022 14:54:28 -0500 Subject: [PATCH 3/3] Fix Dynamic Overall Damage Fix for dynamic overall damage tooltip erroring if the player is not part of the overall segment. --- classes/class_custom.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 8095db11..42e0edde 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -2290,7 +2290,7 @@ desc = "Show overall damage done on the fly.", source = false, target = false, - script_version = 7, + script_version = 8, script = [[ --init: local combat, instance_container, instance = ... @@ -2353,12 +2353,13 @@ --overall local player = OverallCombat [1]:GetActor (actor.nome) - playerTotal = playerTotal + player.total - local playerSpells = player:GetSpellList() - for spellID, spellTable in pairs (playerSpells) do - AllSpells [spellID] = spellTable.total + if (player) then + playerTotal = playerTotal + player.total + local playerSpells = player:GetSpellList() + for spellID, spellTable in pairs (playerSpells) do + AllSpells [spellID] = spellTable.total + end end - --current if (Details.in_combat) then local player = CurrentCombat [1]:GetActor (actor.nome)