Pre-Update for new features
This commit is contained in:
+21
-4
@@ -15,7 +15,7 @@ local max = math.max
|
|||||||
|
|
||||||
--api locals
|
--api locals
|
||||||
local PixelUtil = PixelUtil or DFPixelUtil
|
local PixelUtil = PixelUtil or DFPixelUtil
|
||||||
local version = 13
|
local version = 14
|
||||||
|
|
||||||
local CONST_MENU_TYPE_MAINMENU = "main"
|
local CONST_MENU_TYPE_MAINMENU = "main"
|
||||||
local CONST_MENU_TYPE_SUBMENU = "sub"
|
local CONST_MENU_TYPE_SUBMENU = "sub"
|
||||||
@@ -1649,8 +1649,8 @@ function DF:CreateCoolTip()
|
|||||||
frame2:EnableMouse(false)
|
frame2:EnableMouse(false)
|
||||||
|
|
||||||
--width
|
--width
|
||||||
if (gameCooltip.OptionsTable.FixedWidth) then
|
if (gameCooltip.OptionsTable.FixedWidthSub) then
|
||||||
frame2:SetWidth(gameCooltip.OptionsTable.FixedWidth)
|
frame2:SetWidth(gameCooltip.OptionsTable.FixedWidthSub)
|
||||||
end
|
end
|
||||||
|
|
||||||
frame2.w = gameCooltip.OptionsTable.FixedWidth or 0
|
frame2.w = gameCooltip.OptionsTable.FixedWidth or 0
|
||||||
@@ -1731,7 +1731,7 @@ function DF:CreateCoolTip()
|
|||||||
menuButton:EnableMouse(false)
|
menuButton:EnableMouse(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (not gameCooltip.OptionsTable.FixedWidth) then
|
if (not gameCooltip.OptionsTable.FixedWidthSub) then
|
||||||
if (gameCooltip.Type == 2) then --with bars
|
if (gameCooltip.Type == 2) then --with bars
|
||||||
if (gameCooltip.OptionsTable.MinWidth) then
|
if (gameCooltip.OptionsTable.MinWidth) then
|
||||||
local width = frame2.w + 34
|
local width = frame2.w + 34
|
||||||
@@ -1787,6 +1787,23 @@ function DF:CreateCoolTip()
|
|||||||
gameCooltip:RefreshSpark(menuButton)
|
gameCooltip:RefreshSpark(menuButton)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--hole in the code: the sub-tooltip point should be handled by the sabe function that handle the sub-menu point
|
||||||
|
local frame2CenterX = frame2:GetCenter()
|
||||||
|
if (frame2CenterX) then
|
||||||
|
local frame2HalfWidth = frame2:GetWidth() / 2
|
||||||
|
local frame1CenterX = frame1:GetCenter()
|
||||||
|
if (frame1CenterX) then
|
||||||
|
local frame1HalfWidth = frame1:GetWidth() / 2
|
||||||
|
local frame1EndPoint = frame1CenterX + frame1HalfWidth - 3
|
||||||
|
local frame2StartPoint = frame2CenterX - frame2HalfWidth
|
||||||
|
|
||||||
|
if (frame2StartPoint < frame1EndPoint) then
|
||||||
|
frame2:ClearAllPoints()
|
||||||
|
frame2:SetPoint("bottomright", frame1, "bottomleft", -4, 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--~inicio ~start ~tooltip
|
--~inicio ~start ~tooltip
|
||||||
|
|||||||
@@ -7316,7 +7316,6 @@ detailsFramework.StatusBarFunctions = {
|
|||||||
self:UpdateHealPrediction()
|
self:UpdateHealPrediction()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- ~healthbar
|
-- ~healthbar
|
||||||
function detailsFramework:CreateHealthBar (parent, name, settingsOverride)
|
function detailsFramework:CreateHealthBar (parent, name, settingsOverride)
|
||||||
|
|
||||||
|
|||||||
@@ -301,20 +301,29 @@ end
|
|||||||
--return an integer between zero and one hundret indicating the player gear durability
|
--return an integer between zero and one hundret indicating the player gear durability
|
||||||
function openRaidLib.GearManager.GetPlayerGearDurability()
|
function openRaidLib.GearManager.GetPlayerGearDurability()
|
||||||
local durabilityTotalPercent, totalItems = 0, 0
|
local durabilityTotalPercent, totalItems = 0, 0
|
||||||
|
--hold the lowest item durability of all the player gear
|
||||||
|
--this prevent the case where the player has an average of 80% durability but an item with 15% durability
|
||||||
|
local lowestGearDurability = 100
|
||||||
|
|
||||||
for i = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED do
|
for i = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED do
|
||||||
local durability, maxDurability = GetInventoryItemDurability(i)
|
local durability, maxDurability = GetInventoryItemDurability(i)
|
||||||
if (durability and maxDurability) then
|
if (durability and maxDurability) then
|
||||||
local itemDurability = durability / maxDurability * 100
|
local itemDurability = durability / maxDurability * 100
|
||||||
|
|
||||||
|
if (itemDurability < lowestGearDurability) then
|
||||||
|
lowestGearDurability = itemDurability
|
||||||
|
end
|
||||||
|
|
||||||
durabilityTotalPercent = durabilityTotalPercent + itemDurability
|
durabilityTotalPercent = durabilityTotalPercent + itemDurability
|
||||||
totalItems = totalItems + 1
|
totalItems = totalItems + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if (totalItems == 0) then
|
if (totalItems == 0) then
|
||||||
return 100
|
return 100, lowestGearDurability
|
||||||
end
|
end
|
||||||
|
|
||||||
return floor(durabilityTotalPercent / totalItems)
|
return floor(durabilityTotalPercent / totalItems), lowestGearDurability
|
||||||
end
|
end
|
||||||
|
|
||||||
function openRaidLib.GearManager.GetPlayerWeaponEnchant()
|
function openRaidLib.GearManager.GetPlayerWeaponEnchant()
|
||||||
|
|||||||
@@ -1555,9 +1555,9 @@ openRaidLib.internalCallback.RegisterCallback("onLeaveCombat", openRaidLib.UnitI
|
|||||||
--send only the gear durability
|
--send only the gear durability
|
||||||
function openRaidLib.GearManager.SendDurability()
|
function openRaidLib.GearManager.SendDurability()
|
||||||
local dataToSend = "" .. CONST_COMM_GEARINFO_DURABILITY_PREFIX .. ","
|
local dataToSend = "" .. CONST_COMM_GEARINFO_DURABILITY_PREFIX .. ","
|
||||||
local playerGearDurability = openRaidLib.GearManager.GetPlayerGearDurability()
|
local averageGearDurability, lowestDurability = openRaidLib.GearManager.GetPlayerGearDurability()
|
||||||
|
|
||||||
dataToSend = dataToSend .. playerGearDurability
|
dataToSend = dataToSend .. averageGearDurability
|
||||||
|
|
||||||
--send the data
|
--send the data
|
||||||
openRaidLib.commHandler.SendCommData(dataToSend)
|
openRaidLib.commHandler.SendCommData(dataToSend)
|
||||||
@@ -1937,13 +1937,22 @@ end
|
|||||||
return calculatePercent(timeOffset, duration, updateTime, charges)
|
return calculatePercent(timeOffset, duration, updateTime, charges)
|
||||||
end
|
end
|
||||||
|
|
||||||
--return the values to be use on a progress bar or cooldown frame
|
---return the values to be use on a progress bar or cooldown frame
|
||||||
--require the cooldownInfo table
|
---values returned: bIsReady, percent, timeLeft, charges, minValue, maxValue, currentValue, duration
|
||||||
--values returned: isReady, timeLeft, charges, normalized percent, minValue, maxValue, currentValue
|
---@param cooldownInfo table
|
||||||
--values are in the GetTime() format
|
---@return boolean bIsReady
|
||||||
--GetPercentFromCooldownInfo
|
---@return number percent
|
||||||
|
---@return number timeLeft
|
||||||
|
---@return number charges
|
||||||
|
---@return number minValue
|
||||||
|
---@return number maxValue
|
||||||
|
---@return number currentValue
|
||||||
|
---@return number duration
|
||||||
function openRaidLib.GetCooldownStatusFromCooldownInfo(cooldownInfo)
|
function openRaidLib.GetCooldownStatusFromCooldownInfo(cooldownInfo)
|
||||||
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
|
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
|
||||||
|
if (not timeOffset) then
|
||||||
|
return false, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
end
|
||||||
return calculatePercent(timeOffset, duration, updateTime, charges)
|
return calculatePercent(timeOffset, duration, updateTime, charges)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
Details222.Mixins = {}
|
Details222.Mixins = {}
|
||||||
Details222.Cache = {}
|
Details222.Cache = {}
|
||||||
Details222.Perf = {}
|
Details222.Perf = {}
|
||||||
|
Details222.Cooldowns = {}
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
--initialization stuff
|
--initialization stuff
|
||||||
|
|||||||
@@ -378,11 +378,6 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable)
|
|||||||
--progress bar texture
|
--progress bar texture
|
||||||
gameCooltip:SetOption("StatusBarTexture", statusbarTexture)
|
gameCooltip:SetOption("StatusBarTexture", statusbarTexture)
|
||||||
|
|
||||||
--for i = 1, 20 do
|
|
||||||
-- gameCooltip:AddLine("What Info Could Go Here?", "Oh!", 2, "white")
|
|
||||||
-- gameCooltip:AddIcon("Interface\\Glues\\CharacterSelect\\Glues-AddOn-Icons", 2, 1, 16, 16, .75, 1, 0, 1)
|
|
||||||
--end
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+87
-84
@@ -3403,8 +3403,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
--MISC search key: ~cooldown |
|
--MISC search key: ~cooldown |
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function parser:add_defensive_cooldown (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname)
|
function parser:add_defensive_cooldown(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName)
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
||||||
--early checks and fixes
|
--early checks and fixes
|
||||||
|
|
||||||
@@ -3414,60 +3413,64 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
--get actors
|
--get actors
|
||||||
|
|
||||||
--main actor
|
--main actor
|
||||||
local este_jogador, meu_dono = misc_cache [who_name]
|
local sourceActor, ownerActor = misc_cache[sourceName], nil
|
||||||
if (not este_jogador) then --pode ser um desconhecido ou um pet
|
if (not sourceActor) then
|
||||||
este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true)
|
sourceActor, ownerActor, sourceName = _current_misc_container:PegarCombatente(sourceSerial, sourceName, sourceFlags, true)
|
||||||
if (not meu_dono) then --se n�o for um pet, adicionar no cache
|
if (not ownerActor) then
|
||||||
misc_cache [who_name] = este_jogador
|
misc_cache[sourceName] = sourceActor
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
||||||
--build containers on the fly
|
--build containers on the fly
|
||||||
if (not este_jogador.cooldowns_defensive) then
|
if (not sourceActor.cooldowns_defensive) then
|
||||||
este_jogador.cooldowns_defensive = _detalhes:GetOrderNumber(who_name)
|
sourceActor.cooldowns_defensive = _detalhes:GetOrderNumber(sourceName)
|
||||||
este_jogador.cooldowns_defensive_targets = {}
|
sourceActor.cooldowns_defensive_targets = {}
|
||||||
este_jogador.cooldowns_defensive_spells = container_habilidades:NovoContainer (container_misc) --cria o container das habilidades
|
sourceActor.cooldowns_defensive_spells = container_habilidades:NovoContainer(container_misc)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--local targetActor, targetOwner = damage_cache[targetSerial] or damage_cache_pets[targetSerial] or damage_cache[targetName], damage_cache_petsOwners[targetSerial]
|
||||||
|
--sourceActor, ownerActor, sourceName
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
||||||
--add amount
|
--add amount
|
||||||
|
|
||||||
--actor cooldowns used
|
--actor cooldowns used
|
||||||
este_jogador.cooldowns_defensive = este_jogador.cooldowns_defensive + 1
|
sourceActor.cooldowns_defensive = sourceActor.cooldowns_defensive + 1
|
||||||
|
|
||||||
--combat totals
|
--combat totals
|
||||||
_current_total [4].cooldowns_defensive = _current_total [4].cooldowns_defensive + 1
|
_current_total[4].cooldowns_defensive = _current_total[4].cooldowns_defensive + 1
|
||||||
|
|
||||||
if (este_jogador.grupo) then
|
if (sourceActor.grupo) then
|
||||||
_current_gtotal [4].cooldowns_defensive = _current_gtotal [4].cooldowns_defensive + 1
|
_current_gtotal[4].cooldowns_defensive = _current_gtotal[4].cooldowns_defensive + 1
|
||||||
|
|
||||||
if (who_name == alvo_name) then
|
if (sourceName == targetName) then
|
||||||
|
--[=[
|
||||||
local damage_actor = damage_cache [who_serial]
|
local damage_actor = damage_cache[sourceSerial]
|
||||||
if (not damage_actor) then --pode ser um desconhecido ou um pet
|
if (not damage_actor) then
|
||||||
damage_actor = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true)
|
damage_actor = _current_damage_container:PegarCombatente(sourceSerial, sourceName, sourceFlags, true)
|
||||||
if (who_flags) then --se n�o for um pet, adicionar no cache
|
if (sourceFlags) then
|
||||||
damage_cache [who_serial] = damage_actor
|
damage_cache[sourceSerial] = damage_actor
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--]=]
|
||||||
|
|
||||||
--last events
|
--last events
|
||||||
local t = last_events_cache [who_name]
|
local t = last_events_cache[sourceName]
|
||||||
|
|
||||||
if (not t) then
|
if (not t) then
|
||||||
t = _current_combat:CreateLastEventsTable (who_name)
|
t = _current_combat:CreateLastEventsTable(sourceName)
|
||||||
end
|
end
|
||||||
|
|
||||||
local i = t.n
|
local i = t.n
|
||||||
local this_event = t [i]
|
local thisEvent = t [i]
|
||||||
|
|
||||||
this_event [1] = 1 --true if this is a damage || false for healing || 1 for cooldown
|
thisEvent[1] = 1 --true if this is a damage || false for healing || 1 for cooldown
|
||||||
this_event [2] = spellid --spellid || false if this is a battle ress line
|
thisEvent[2] = spellId --spellid || false if this is a battle ress line
|
||||||
this_event [3] = 1 --amount of damage or healing
|
thisEvent[3] = 1 --amount of damage or healing
|
||||||
this_event [4] = time --parser time
|
thisEvent[4] = time
|
||||||
this_event [5] = UnitHealth (who_name) --current unit heal
|
thisEvent[5] = UnitHealth(sourceName)
|
||||||
this_event [6] = who_name --source name
|
thisEvent[6] = sourceName
|
||||||
|
|
||||||
i = i + 1
|
i = i + 1
|
||||||
if (i == _amount_of_last_events+1) then
|
if (i == _amount_of_last_events+1) then
|
||||||
@@ -3476,32 +3479,33 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
t.n = i
|
t.n = i
|
||||||
end
|
end
|
||||||
|
|
||||||
este_jogador.last_cooldown = {time, spellid}
|
sourceActor.last_cooldown = {time, spellId}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--update last event
|
--update last event
|
||||||
este_jogador.last_event = _tempo
|
sourceActor.last_event = _tempo
|
||||||
|
|
||||||
--actor targets
|
--actor targets
|
||||||
este_jogador.cooldowns_defensive_targets [alvo_name] = (este_jogador.cooldowns_defensive_targets [alvo_name] or 0) + 1
|
sourceActor.cooldowns_defensive_targets[targetName] = (sourceActor.cooldowns_defensive_targets [targetName] or 0) + 1
|
||||||
|
|
||||||
--actor spells table
|
--actor spells table
|
||||||
local spell = este_jogador.cooldowns_defensive_spells._ActorTable [spellid]
|
local spellTable = sourceActor.cooldowns_defensive_spells._ActorTable[spellId]
|
||||||
if (not spell) then
|
if (not spellTable) then
|
||||||
spell = este_jogador.cooldowns_defensive_spells:PegaHabilidade (spellid, true, token)
|
spellTable = sourceActor.cooldowns_defensive_spells:PegaHabilidade(spellId, true, token)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (_hook_cooldowns) then
|
if (_hook_cooldowns) then
|
||||||
--send event to registred functions
|
--send event to registred functions
|
||||||
for _, func in ipairs(_hook_cooldowns_container) do
|
for i = 1, #_hook_cooldowns_container do
|
||||||
func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname)
|
local successful, errorText = pcall(_hook_cooldowns_container[i], nil, token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, spellId, spellName)
|
||||||
|
if (not successful) then
|
||||||
|
_detalhes:Msg("error occurred on a cooldown hook function:", errorText)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return _spell_utility_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, token, "BUFF_OR_DEBUFF", "COOLDOWN")
|
return _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, token, "BUFF_OR_DEBUFF", "COOLDOWN")
|
||||||
end
|
end
|
||||||
|
|
||||||
--serach key: ~interrupts
|
--serach key: ~interrupts
|
||||||
@@ -4029,49 +4033,49 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
---number 6: emeny casted a spell
|
---number 6: emeny casted a spell
|
||||||
---@param token string
|
---@param token string
|
||||||
---@param time number
|
---@param time number
|
||||||
---@param who_serial string
|
---@param sourceSerial string
|
||||||
---@param who_name string
|
---@param sourceName string
|
||||||
---@param who_flags number
|
---@param sourceFlags number
|
||||||
---@param alvo_serial string
|
---@param targetSerial string
|
||||||
---@param alvo_name string
|
---@param targetName string
|
||||||
---@param alvo_flags number
|
---@param targetFlags number
|
||||||
function parser:dead (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags)
|
function parser:dead (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags)
|
||||||
--early checks and fixes
|
--early checks and fixes
|
||||||
if (not alvo_name) then
|
if (not targetName) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
||||||
--build dead
|
--build dead
|
||||||
|
|
||||||
local damageActor = _current_damage_container:GetActor(alvo_name)
|
local damageActor = _current_damage_container:GetActor(targetName)
|
||||||
--check for outsiders
|
--check for outsiders
|
||||||
if (_in_combat and alvo_flags and (not damageActor or (bitBand(alvo_flags, 0x00000008) ~= 0 and not damageActor.grupo))) then
|
if (_in_combat and targetFlags and (not damageActor or (bitBand(targetFlags, 0x00000008) ~= 0 and not damageActor.grupo))) then
|
||||||
--frags
|
--frags
|
||||||
if (_detalhes.only_pvp_frags and (bitBand(alvo_flags, 0x00000400) == 0 or (bitBand(alvo_flags, 0x00000040) == 0 and bitBand(alvo_flags, 0x00000020) == 0))) then --byte 2 = 4 (HOSTILE) byte 3 = 4 (OBJECT_TYPE_PLAYER)
|
if (_detalhes.only_pvp_frags and (bitBand(targetFlags, 0x00000400) == 0 or (bitBand(targetFlags, 0x00000040) == 0 and bitBand(targetFlags, 0x00000020) == 0))) then --byte 2 = 4 (HOSTILE) byte 3 = 4 (OBJECT_TYPE_PLAYER)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if (not _current_combat.frags [alvo_name]) then
|
if (not _current_combat.frags [targetName]) then
|
||||||
_current_combat.frags [alvo_name] = 1
|
_current_combat.frags [targetName] = 1
|
||||||
else
|
else
|
||||||
_current_combat.frags [alvo_name] = _current_combat.frags [alvo_name] + 1
|
_current_combat.frags [targetName] = _current_combat.frags [targetName] + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
_current_combat.frags_need_refresh = true
|
_current_combat.frags_need_refresh = true
|
||||||
|
|
||||||
--player death
|
--player death
|
||||||
elseif (not UnitIsFeignDeath (alvo_name)) then
|
elseif (not UnitIsFeignDeath(targetName)) then
|
||||||
if (
|
if (
|
||||||
--player in your group
|
--player in your group
|
||||||
(bitBand(alvo_flags, AFFILIATION_GROUP) ~= 0 or (damageActor and damageActor.grupo)) and
|
(bitBand(targetFlags, AFFILIATION_GROUP) ~= 0 or (damageActor and damageActor.grupo)) and
|
||||||
--must be a player
|
--must be a player
|
||||||
bitBand(alvo_flags, OBJECT_TYPE_PLAYER) ~= 0 and
|
bitBand(targetFlags, OBJECT_TYPE_PLAYER) ~= 0 and
|
||||||
--must be in combat
|
--must be in combat
|
||||||
_in_combat
|
_in_combat
|
||||||
) then
|
) then
|
||||||
if (ignore_death[alvo_name]) then
|
if (ignore_death[targetName]) then
|
||||||
ignore_death[alvo_name] = nil
|
ignore_death[targetName] = nil
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -4082,11 +4086,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
_current_gtotal [4].dead = _current_gtotal [4].dead + 1
|
_current_gtotal [4].dead = _current_gtotal [4].dead + 1
|
||||||
|
|
||||||
--main actor no container de misc que ir� armazenar a morte
|
--main actor no container de misc que ir� armazenar a morte
|
||||||
local thisPlayer, meu_dono = misc_cache [alvo_name]
|
local thisPlayer, meu_dono = misc_cache [targetName]
|
||||||
if (not thisPlayer) then --pode ser um desconhecido ou um pet
|
if (not thisPlayer) then --pode ser um desconhecido ou um pet
|
||||||
thisPlayer, meu_dono, who_name = _current_misc_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true)
|
thisPlayer, meu_dono, sourceName = _current_misc_container:PegarCombatente (targetSerial, targetName, targetFlags, true)
|
||||||
if (not meu_dono) then --se n�o for um pet, adicionar no cache
|
if (not meu_dono) then --se n�o for um pet, adicionar no cache
|
||||||
misc_cache [alvo_name] = thisPlayer
|
misc_cache [targetName] = thisPlayer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -4094,9 +4098,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
local eventsBeforePlayerDeath = {}
|
local eventsBeforePlayerDeath = {}
|
||||||
|
|
||||||
--get the table where is registered the last events before the player died
|
--get the table where is registered the last events before the player died
|
||||||
local recordedEvents = last_events_cache[alvo_name]
|
local recordedEvents = last_events_cache[targetName]
|
||||||
if (not recordedEvents) then
|
if (not recordedEvents) then
|
||||||
recordedEvents = _current_combat:CreateLastEventsTable(alvo_name)
|
recordedEvents = _current_combat:CreateLastEventsTable(targetName)
|
||||||
end
|
end
|
||||||
|
|
||||||
--lesses index = older / higher index = newer
|
--lesses index = older / higher index = newer
|
||||||
@@ -4226,7 +4230,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
eventTable[3] = 0 --amount of damage or healing but in this case is 0
|
eventTable[3] = 0 --amount of damage or healing but in this case is 0
|
||||||
eventTable[4] = thisPlayer.last_cooldown[1] --when the event happened using unix time
|
eventTable[4] = thisPlayer.last_cooldown[1] --when the event happened using unix time
|
||||||
eventTable[5] = 0 --player health when the event happened
|
eventTable[5] = 0 --player health when the event happened
|
||||||
eventTable[6] = alvo_name --source name
|
eventTable[6] = targetName --source name
|
||||||
eventsBeforePlayerDeath[#eventsBeforePlayerDeath+1] = eventTable
|
eventsBeforePlayerDeath[#eventsBeforePlayerDeath+1] = eventTable
|
||||||
else
|
else
|
||||||
--no last cooldown found so just add a last cooldown used event with no spellId and time 0
|
--no last cooldown found so just add a last cooldown used event with no spellId and time 0
|
||||||
@@ -4236,7 +4240,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
eventTable [3] = 0 --amount of damage or healing but in this case is 0
|
eventTable [3] = 0 --amount of damage or healing but in this case is 0
|
||||||
eventTable [4] = 0 --when the event happened using unix time
|
eventTable [4] = 0 --when the event happened using unix time
|
||||||
eventTable [5] = 0 --player health when the event happened
|
eventTable [5] = 0 --player health when the event happened
|
||||||
eventTable [6] = alvo_name --source name
|
eventTable [6] = targetName --source name
|
||||||
eventsBeforePlayerDeath[#eventsBeforePlayerDeath+1] = eventTable
|
eventsBeforePlayerDeath[#eventsBeforePlayerDeath+1] = eventTable
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -4271,15 +4275,15 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
|
|
||||||
["dead"] = true,
|
["dead"] = true,
|
||||||
["last_cooldown"] = thisPlayer.last_cooldown,
|
["last_cooldown"] = thisPlayer.last_cooldown,
|
||||||
["dead_at"] = combatElapsedTime
|
["dead_at"] = combatElapsedTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
tinsert(_current_combat.last_events_tables, #_current_combat.last_events_tables+1, playerDeathTable)
|
tinsert(_current_combat.last_events_tables, #_current_combat.last_events_tables+1, playerDeathTable)
|
||||||
|
|
||||||
if (_hook_deaths) then
|
if (_hook_deaths) then
|
||||||
--send event to registred functions
|
--send event to registred functions
|
||||||
for _, func in ipairs(_hook_deaths_container) do
|
for _, func in ipairs(_hook_deaths_container) do
|
||||||
local copiedDeathTable = Details.CopyTable(playerDeathTable)
|
local successful, errortext = pcall(func, nil, token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, playerDeathTable, thisPlayer.last_cooldown, combatElapsedTime, maxHealth)
|
||||||
local successful, errortext = pcall(func, nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, copiedDeathTable, thisPlayer.last_cooldown, combatElapsedTime, maxHealth)
|
|
||||||
if (not successful) then
|
if (not successful) then
|
||||||
_detalhes:Msg("error occurred on a death hook function:", errortext)
|
_detalhes:Msg("error occurred on a death hook function:", errortext)
|
||||||
end
|
end
|
||||||
@@ -4298,9 +4302,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
|
|
||||||
--get the elapsed time
|
--get the elapsed time
|
||||||
local timeElapsed = GetTime() - _detalhes.tabela_overall:GetStartTime()
|
local timeElapsed = GetTime() - _detalhes.tabela_overall:GetStartTime()
|
||||||
local minutos, segundos = floor(timeElapsed/60), floor(timeElapsed%60)
|
local minutes, seconds = floor(timeElapsed/60), floor(timeElapsed % 60)
|
||||||
|
|
||||||
overallDeathTable [6] = minutos.."m "..segundos.."s"
|
overallDeathTable [6] = minutes .. "m " .. seconds .. "s"
|
||||||
overallDeathTable.dead_at = timeElapsed
|
overallDeathTable.dead_at = timeElapsed
|
||||||
|
|
||||||
tinsert(_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables + 1, overallDeathTable)
|
tinsert(_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables + 1, overallDeathTable)
|
||||||
@@ -4308,36 +4312,35 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
|||||||
end
|
end
|
||||||
|
|
||||||
--remove the player death events from the cache
|
--remove the player death events from the cache
|
||||||
last_events_cache[alvo_name] = nil
|
last_events_cache[targetName] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function parser:environment (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, env_type, amount)
|
function parser:environment(token, time, sourceSerial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, env_type, amount)
|
||||||
|
local spelId
|
||||||
local spelid
|
|
||||||
|
|
||||||
if (env_type == "Falling") then
|
if (env_type == "Falling") then
|
||||||
who_name = ENVIRONMENTAL_FALLING_NAME
|
who_name = ENVIRONMENTAL_FALLING_NAME
|
||||||
spelid = 3
|
spelId = 3
|
||||||
elseif (env_type == "Drowning") then
|
elseif (env_type == "Drowning") then
|
||||||
who_name = ENVIRONMENTAL_DROWNING_NAME
|
who_name = ENVIRONMENTAL_DROWNING_NAME
|
||||||
spelid = 4
|
spelId = 4
|
||||||
elseif (env_type == "Fatigue") then
|
elseif (env_type == "Fatigue") then
|
||||||
who_name = ENVIRONMENTAL_FATIGUE_NAME
|
who_name = ENVIRONMENTAL_FATIGUE_NAME
|
||||||
spelid = 5
|
spelId = 5
|
||||||
elseif (env_type == "Fire") then
|
elseif (env_type == "Fire") then
|
||||||
who_name = ENVIRONMENTAL_FIRE_NAME
|
who_name = ENVIRONMENTAL_FIRE_NAME
|
||||||
spelid = 6
|
spelId = 6
|
||||||
elseif (env_type == "Lava") then
|
elseif (env_type == "Lava") then
|
||||||
who_name = ENVIRONMENTAL_LAVA_NAME
|
who_name = ENVIRONMENTAL_LAVA_NAME
|
||||||
spelid = 7
|
spelId = 7
|
||||||
elseif (env_type == "Slime") then
|
elseif (env_type == "Slime") then
|
||||||
who_name = ENVIRONMENTAL_SLIME_NAME
|
who_name = ENVIRONMENTAL_SLIME_NAME
|
||||||
spelid = 8
|
spelId = 8
|
||||||
end
|
end
|
||||||
|
|
||||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spelid or 1, env_type, 00000003, amount, -1, 1) --localize-me
|
return parser:spell_dmg(token, time, sourceSerial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spelId or 1, env_type, 00000003, amount, -1, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -258,7 +258,11 @@ end
|
|||||||
cooldownLine:SetIcon(spellIcon, .1, .9, .1, .9)
|
cooldownLine:SetIcon(spellIcon, .1, .9, .1, .9)
|
||||||
|
|
||||||
local classColor = C_ClassColor.GetClassColor(cooldownLine.class or "PRIEST")
|
local classColor = C_ClassColor.GetClassColor(cooldownLine.class or "PRIEST")
|
||||||
cooldownLine:SetStatusBarColor(classColor.r, classColor.g, classColor.b)
|
if (classColor) then
|
||||||
|
cooldownLine:SetStatusBarColor(classColor.r, classColor.g, classColor.b)
|
||||||
|
else
|
||||||
|
cooldownLine:SetStatusBarColor(1, 1, 1)
|
||||||
|
end
|
||||||
cooldownLine:SetLeftText(DF:RemoveRealmName(cooldownLine.unitName))
|
cooldownLine:SetLeftText(DF:RemoveRealmName(cooldownLine.unitName))
|
||||||
cooldownLine:SetSize(Details.ocd_tracker.width, Details.ocd_tracker.height)
|
cooldownLine:SetSize(Details.ocd_tracker.width, Details.ocd_tracker.height)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ Details222.Mixins.ActorMixin = {
|
|||||||
|
|
||||||
elseif (containerType == "spell") then
|
elseif (containerType == "spell") then
|
||||||
return self.spells
|
return self.spells
|
||||||
|
|
||||||
|
elseif (containerType == "cooldowns") then
|
||||||
|
return self.cooldowns_defensive_spells
|
||||||
end
|
end
|
||||||
|
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user