Code changes, see commit description

Combat Objects which has been discarded due to any reason will have the boolean member:  __destroyed set to true. With this change, 3rd party code can see if the data cached is up to date or obsolete.

- Removed several deprecated code from March 2023 and earlier.
- Large amount of code cleanup and refactoring, some functions got renamed, they are listed below:
* TravarTempos renamed to LockActivityTime.
* ClearTempTables renamed to ClearCacheTables.
* SpellIsDot renamed to SetAsDotSpell.
* FlagCurrentCombat remamed to FlagNewCombat_PVPState.
* UpdateContainerCombatentes renamed to UpdatePetCache.
* segmentClass:AddCombat(combatObject) renamed to Details222.Combat.AddCombat(combatToBeAdded)

- CurrentCombat.verifica_combate timer is now obsolete.
- Details.last_closed_combat is now obsolete.
- Details.EstaEmCombate is now obsolete.
- Details.options is now obsolete.

- Added: Details:RemoveSegmentByCombatObject(combatObject)

- Spec Guess Timers are now stored within Details222.GuessSpecSchedules.Schedules, all timers are killed at the end of the combat or at a data reset.

- Initial time to send startup signal reduced from 5 to 4 seconds.

- Fixed some division by zero on ptr 10.1.5.
- Fixed DETAILS_STARTED event not triggering in some cases due to 'event not registered'.
This commit is contained in:
Tercio Jose
2023-06-27 19:01:44 -03:00
parent d3d5154c67
commit 6ccb64863e
23 changed files with 971 additions and 808 deletions
+15 -10
View File
@@ -373,18 +373,18 @@ function Details:GetSpellLink(spellid) --[[exported]]
end
end
function Details:GameTooltipSetSpellByID(spellid) --[[exported]]
if (spellid == 1) then
function Details:GameTooltipSetSpellByID(spellId) --[[exported]]
if (spellId == 1) then
GameTooltip:SetSpellByID(6603)
elseif (spellid == 2) then
elseif (spellId == 2) then
GameTooltip:SetSpellByID(75)
elseif (spellid > 10) then
GameTooltip:SetSpellByID(spellid)
elseif (spellId > 10) then
GameTooltip:SetSpellByID(spellId)
else
GameTooltip:SetSpellByID(spellid)
GameTooltip:SetSpellByID(spellId)
end
end
@@ -6201,10 +6201,11 @@ function damageClass:MontaTooltipAlvos (thisLine, index, instancia) --~deprecate
return true
end
--controla se o dps do jogador esta travado ou destravado
--controls the activity time of the actor
function damageClass:GetOrChangeActivityStatus(activityStatus)
if (activityStatus == nil) then
return self.dps_started --retorna se o dps esta aberto ou fechado para este jogador
--if no value passed, return the current activity status
return self.dps_started
elseif (activityStatus) then
self.dps_started = true
@@ -6219,14 +6220,16 @@ end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--core functions
--limpa as tabelas temporrias ao ResetAllCombatData
function damageClass:ClearTempTables()
--clear cache tables when resetting data
function damageClass:ClearCacheTables()
for i = #ntable, 1, -1 do
ntable [i] = nil
end
for i = #vtable, 1, -1 do
vtable [i] = nil
end
for i = #bs_table, 1, -1 do
bs_table [i] = nil
end
@@ -6234,9 +6237,11 @@ end
if (bs_tooltip_table) then
Details:Destroy(bs_tooltip_table)
end
if (frags_tooltip_table) then
Details:Destroy(frags_tooltip_table)
end
Details:Destroy(bs_index_table)
Details:Destroy(tooltip_temp_table)
Details:Destroy(tooltip_void_zone_temp)