'/details users' major upgrade
- Stop showing the '/details users' panel again after the user closes the panel. - Improvements on aura detection at the start and end of an encounter. - Rewrite on Potion Used custom display.
This commit is contained in:
+68
-159
@@ -1225,194 +1225,103 @@
|
||||
desc = Loc ["STRING_CUSTOM_POT_DEFAULT_DESC"],
|
||||
source = false,
|
||||
target = false,
|
||||
script_version = 5,
|
||||
script_version = 6,
|
||||
script = [[
|
||||
--init:
|
||||
local combat, instance_container, instance = ...
|
||||
local total, top, amount = 0, 0, 0
|
||||
|
||||
|
||||
--get the misc actor container
|
||||
local misc_container = combat:GetActorList ( DETAILS_ATTRIBUTE_MISC )
|
||||
|
||||
|
||||
--do the loop:
|
||||
for _, player in ipairs ( misc_container ) do
|
||||
|
||||
--only player in group
|
||||
if (player:IsGroupPlayer()) then
|
||||
|
||||
local found_potion = false
|
||||
|
||||
--get the spell debuff uptime container
|
||||
local debuff_uptime_container = player.debuff_uptime and player.debuff_uptime_spells and player.debuff_uptime_spells._ActorTable
|
||||
if (debuff_uptime_container) then
|
||||
--potion of focus (can't use as pre-potion, so, its amount is always 1
|
||||
local focus_potion = debuff_uptime_container [DETAILS_FOCUS_POTION_ID]
|
||||
|
||||
if (focus_potion) then
|
||||
total = total + 1
|
||||
found_potion = true
|
||||
if (top < 1) then
|
||||
top = 1
|
||||
--only player in group
|
||||
if (player:IsGroupPlayer()) then
|
||||
|
||||
local found_potion = false
|
||||
|
||||
--get the spell debuff uptime container
|
||||
local debuff_uptime_container = player.debuff_uptime and player.debuff_uptime_spells and player.debuff_uptime_spells._ActorTable
|
||||
if (debuff_uptime_container) then
|
||||
--potion of focus (can't use as pre-potion, so, its amount is always 1
|
||||
local focus_potion = debuff_uptime_container [DETAILS_FOCUS_POTION_ID]
|
||||
|
||||
if (focus_potion) then
|
||||
total = total + 1
|
||||
found_potion = true
|
||||
if (top < 1) then
|
||||
top = 1
|
||||
end
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, 1)
|
||||
end
|
||||
end
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, 1)
|
||||
end
|
||||
|
||||
--get the spell buff uptime container
|
||||
local buff_uptime_container = player.buff_uptime and player.buff_uptime_spells and player.buff_uptime_spells._ActorTable
|
||||
if (buff_uptime_container) then
|
||||
for spellId, _ in pairs (DetailsFramework.PotionIDs) do
|
||||
local potionUsed = buff_uptime_container [spellId]
|
||||
|
||||
if (potionUsed) then
|
||||
local used = potionUsed.activedamt
|
||||
if (used and used > 0) then
|
||||
total = total + used
|
||||
found_potion = true
|
||||
if (used > top) then
|
||||
top = used
|
||||
end
|
||||
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, used)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (found_potion) then
|
||||
amount = amount + 1
|
||||
end
|
||||
end
|
||||
|
||||
--get the spell buff uptime container
|
||||
local buff_uptime_container = player.buff_uptime and player.buff_uptime_spells and player.buff_uptime_spells._ActorTable
|
||||
if (buff_uptime_container) then
|
||||
|
||||
--potion of the jade serpent
|
||||
local jade_serpent_potion = buff_uptime_container [DETAILS_INT_POTION_ID]
|
||||
if (jade_serpent_potion) then
|
||||
local used = jade_serpent_potion.activedamt
|
||||
if (used > 0) then
|
||||
total = total + used
|
||||
found_potion = true
|
||||
if (used > top) then
|
||||
top = used
|
||||
end
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, used)
|
||||
end
|
||||
end
|
||||
|
||||
--potion of mogu power
|
||||
local mogu_power_potion = buff_uptime_container [DETAILS_STR_POTION_ID]
|
||||
if (mogu_power_potion) then
|
||||
local used = mogu_power_potion.activedamt
|
||||
if (used > 0) then
|
||||
total = total + used
|
||||
found_potion = true
|
||||
if (used > top) then
|
||||
top = used
|
||||
end
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, used)
|
||||
end
|
||||
end
|
||||
|
||||
--mana potion
|
||||
local mana_potion = buff_uptime_container [DETAILS_MANA_POTION_ID]
|
||||
if (mana_potion) then
|
||||
local used = mana_potion.activedamt
|
||||
if (used > 0) then
|
||||
total = total + used
|
||||
found_potion = true
|
||||
if (used > top) then
|
||||
top = used
|
||||
end
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, used)
|
||||
end
|
||||
end
|
||||
|
||||
--potion of prolongued power
|
||||
local prolongued_power = buff_uptime_container [DETAILS_AGI_POTION_ID]
|
||||
if (prolongued_power) then
|
||||
local used = prolongued_power.activedamt
|
||||
if (used > 0) then
|
||||
total = total + used
|
||||
found_potion = true
|
||||
if (used > top) then
|
||||
top = used
|
||||
end
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, used)
|
||||
end
|
||||
end
|
||||
|
||||
--potion of the mountains
|
||||
local mountains_potion = buff_uptime_container [DETAILS_STAMINA_POTION_ID]
|
||||
if (mountains_potion) then
|
||||
local used = mountains_potion.activedamt
|
||||
if (used > 0) then
|
||||
total = total + used
|
||||
found_potion = true
|
||||
if (used > top) then
|
||||
top = used
|
||||
end
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, used)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (found_potion) then
|
||||
amount = amount + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--return:
|
||||
return total, top, amount
|
||||
]],
|
||||
|
||||
tooltip = [[
|
||||
--init:
|
||||
local player, combat, instance = ...
|
||||
|
||||
|
||||
--get the debuff container for potion of focus
|
||||
local debuff_uptime_container = player.debuff_uptime and player.debuff_uptime_spells and player.debuff_uptime_spells._ActorTable
|
||||
if (debuff_uptime_container) then
|
||||
local focus_potion = debuff_uptime_container [DETAILS_FOCUS_POTION_ID]
|
||||
if (focus_potion) then
|
||||
local focus_potion = debuff_uptime_container [DETAILS_FOCUS_POTION_ID]
|
||||
if (focus_potion) then
|
||||
local name, _, icon = GetSpellInfo (DETAILS_FOCUS_POTION_ID)
|
||||
GameCooltip:AddLine (name, 1) --> can use only 1 focus potion (can't be pre-potion)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--get the buff container for all the others potions
|
||||
|
||||
--get the misc actor container
|
||||
local buff_uptime_container = player.buff_uptime and player.buff_uptime_spells and player.buff_uptime_spells._ActorTable
|
||||
if (buff_uptime_container) then
|
||||
--potion of the jade serpent
|
||||
local jade_serpent_potion = buff_uptime_container [DETAILS_INT_POTION_ID]
|
||||
if (jade_serpent_potion) then
|
||||
local name, _, icon = GetSpellInfo (DETAILS_INT_POTION_ID)
|
||||
GameCooltip:AddLine (name, jade_serpent_potion.activedamt)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
|
||||
end
|
||||
|
||||
--potion of mogu power
|
||||
local mogu_power_potion = buff_uptime_container [DETAILS_STR_POTION_ID]
|
||||
if (mogu_power_potion) then
|
||||
local name, _, icon = GetSpellInfo (DETAILS_STR_POTION_ID)
|
||||
GameCooltip:AddLine (name, mogu_power_potion.activedamt)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
|
||||
end
|
||||
|
||||
--mana potion
|
||||
local mana_potion = buff_uptime_container [DETAILS_MANA_POTION_ID]
|
||||
if (mana_potion) then
|
||||
local name, _, icon = GetSpellInfo (DETAILS_MANA_POTION_ID)
|
||||
GameCooltip:AddLine (name, mana_potion.activedamt)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
|
||||
end
|
||||
|
||||
--prolongued power
|
||||
local prolongued_power = buff_uptime_container [DETAILS_AGI_POTION_ID]
|
||||
if (prolongued_power) then
|
||||
local name, _, icon = GetSpellInfo (DETAILS_AGI_POTION_ID)
|
||||
GameCooltip:AddLine (name, prolongued_power.activedamt)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
|
||||
end
|
||||
|
||||
--potion of the mountains
|
||||
local mountains_potion = buff_uptime_container [DETAILS_STAMINA_POTION_ID]
|
||||
if (mountains_potion) then
|
||||
local name, _, icon = GetSpellInfo (DETAILS_STAMINA_POTION_ID)
|
||||
GameCooltip:AddLine (name, mountains_potion.activedamt)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
|
||||
end
|
||||
for spellId, _ in pairs (DetailsFramework.PotionIDs) do
|
||||
local potionUsed = buff_uptime_container [spellId]
|
||||
|
||||
if (potionUsed) then
|
||||
local name, _, icon = GetSpellInfo (spellId)
|
||||
GameCooltip:AddLine (name, potionUsed.activedamt)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
|
||||
end
|
||||
end
|
||||
end
|
||||
]]
|
||||
]]
|
||||
}
|
||||
|
||||
local have = false
|
||||
|
||||
Reference in New Issue
Block a user