Merge pull request #322 from Flamanis/Reset-on-new-BG

Add Reset on new PVP option
This commit is contained in:
Tercio Jose
2022-07-23 17:53:14 -03:00
committed by GitHub
4 changed files with 23 additions and 2 deletions
+5 -1
View File
@@ -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()
+7 -1
View File
@@ -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
end
+10
View File
@@ -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,
+1
View File
@@ -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,