Fixed custom display My Spells not using spell school color and tooltip being to small

This commit is contained in:
Tercio Jose
2024-08-24 11:54:43 -03:00
committed by andrew6180
parent 5e5f24d218
commit cec32b8d17
+43 -20
View File
@@ -556,7 +556,9 @@
-- update tooltip function -- -- update tooltip function --
if (self.id) then if (self.id) then
local school = Details.spell_school_cache[self.nome] ---@type spelltable
local spellTable = self.my_actor
local school = Details.spell_school_cache[self.nome] or (spellTable and spellTable.spellschool)
if (school) then if (school) then
local schoolColor = Details.spells_school[school] local schoolColor = Details.spells_school[school]
if (not schoolColor) then if (not schoolColor) then
@@ -648,7 +650,9 @@
if (bFromResize) then if (bFromResize) then
if (self.id) then if (self.id) then
local schoolData = Details.spell_school_cache[self.nome] ---@type spelltable
local spellTable = self.my_actor
local schoolData = Details.spell_school_cache[self.nome] or (spellTable and spellTable.spellschool)
if (schoolData) then if (schoolData) then
local schoolColor = Details.spells_school[schoolData] local schoolColor = Details.spells_school[schoolData]
if (not schoolColor) then if (not schoolColor) then
@@ -1380,7 +1384,7 @@
icon = [[Interface\Buttons\UI-MicroStream-Red]], icon = [[Interface\Buttons\UI-MicroStream-Red]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = Loc ["STRING_CUSTOM_ACTIVITY_DPS_DESC"], desc = Loc ["STRING_CUSTOM_ACTIVITY_DPS_DESC"],
source = false, source = false,
target = false, target = false,
@@ -1442,7 +1446,7 @@
icon = [[Interface\Buttons\UI-MicroStream-Green]], icon = [[Interface\Buttons\UI-MicroStream-Green]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = Loc ["STRING_CUSTOM_ACTIVITY_HPS_DESC"], desc = Loc ["STRING_CUSTOM_ACTIVITY_HPS_DESC"],
source = false, source = false,
target = false, target = false,
@@ -1508,7 +1512,7 @@
icon = [[Interface\ICONS\Spell_Frost_FreezingBreath]], icon = [[Interface\ICONS\Spell_Frost_FreezingBreath]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = "Show the crowd control amount for each player.", desc = "Show the crowd control amount for each player.",
source = false, source = false,
target = false, target = false,
@@ -1612,7 +1616,7 @@
icon = [[Interface\ICONS\Spell_Frost_ChainsOfIce]], icon = [[Interface\ICONS\Spell_Frost_ChainsOfIce]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = "Show the amount of crowd control received for each player.", desc = "Show the amount of crowd control received for each player.",
source = false, source = false,
target = false, target = false,
@@ -1746,11 +1750,11 @@
icon = [[Interface\CHATFRAME\UI-ChatIcon-Battlenet]], icon = [[Interface\CHATFRAME\UI-ChatIcon-Battlenet]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = Loc ["STRING_CUSTOM_MYSPELLS_DESC"], desc = Loc ["STRING_CUSTOM_MYSPELLS_DESC"],
source = false, source = false,
target = false, target = false,
script_version = 11, script_version = 12,
script = [[ script = [[
--get the parameters passed --get the parameters passed
local combat, instance_container, instance = ... local combat, instance_container, instance = ...
@@ -1816,9 +1820,13 @@
--get the parameters passed --get the parameters passed
local spell, combat, instance = ... local spell, combat, instance = ...
local iconTexture = "Interface\\BUTTONS\\UI-GuildButton-PublicNote-Disabled"
local iconSize = 16
--get the cooltip object (we dont use the convencional GameTooltip here) --get the cooltip object (we dont use the convencional GameTooltip here)
local GC = GameCooltip local GC = GameCooltip
GC:SetOption("YSpacingMod", 0)
GC:SetOption("YSpacingMod", -6)
local role = DetailsFramework.UnitGroupRolesAssigned("player") local role = DetailsFramework.UnitGroupRolesAssigned("player")
@@ -1852,33 +1860,40 @@
cast_string = cast_string .. amountOfCasts cast_string = cast_string .. amountOfCasts
end end
--Cooltip code --Cooltip code
GC:AddLine("Casts:", cast_string or "?") GC:AddLine("Casts:", cast_string or "?")
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
if (debuff_uptime_total ~= "") then if (debuff_uptime_total ~= "") then
GC:AddLine("Uptime:", (debuff_uptime_total or "?") .. "%") GC:AddLine("Uptime:", (debuff_uptime_total or "?") .. "%")
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
end end
GC:AddLine("Hits:", spell.counter) GC:AddLine("Hits:", spell.counter)
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
local average = spell.total / total_hits local average = spell.total / total_hits
GC:AddLine("Average:", _detalhes:ToK (average)) GC:AddLine("Average:", _detalhes:ToK (average))
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
GC:AddLine("E-Dps:", _detalhes:ToK (spell.total / combat_time)) GC:AddLine("E-Dps:", _detalhes:ToK (spell.total / combat_time))
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
GC:AddLine("School:", schooltext) GC:AddLine("School:", schooltext)
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
--GC:AddLine(" ")
GC:AddLine("Normal Hits: ", spell.n_amt .. " (" ..floor( spell.n_amt/total_hits*100) .. "%)") GC:AddLine("Normal Hits: ", spell.n_amt .. " (" ..floor( spell.n_amt/total_hits*100) .. "%)")
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
if (spell.n_amt and spell.n_amt > 0) then
local n_average = spell.n_total / spell.n_amt local n_average = spell.n_total / spell.n_amt
local T = (combat_time*spell.n_total)/spell.total local T = (combat_time*spell.n_total)/spell.total
local P = average/n_average*100 local P = average/n_average*100
@@ -1886,11 +1901,12 @@
GC:AddLine("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format("%.1f",spell.n_total / T )) GC:AddLine("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format("%.1f",spell.n_total / T ))
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
--GC:AddLine(" ") end
GC:AddLine("Critical Hits: ", spell.c_amt .. " (" ..floor( spell.c_amt/total_hits*100) .. "%)") GC:AddLine("Critical Hits: ", spell.c_amt .. " (" ..floor( spell.c_amt/total_hits*100) .. "%)")
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
if (spell.c_amt > 0) then if (spell.c_amt > 0) then
local c_average = spell.c_total/spell.c_amt local c_average = spell.c_total/spell.c_amt
@@ -1905,7 +1921,7 @@
end end
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
elseif (spell.n_total) then elseif (spell.n_total) then
@@ -1923,21 +1939,26 @@
--Cooltip code --Cooltip code
GC:AddLine("Hits:", spell.counter) GC:AddLine("Hits:", spell.counter)
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
local average = spell.total / total_hits local average = spell.total / total_hits
GC:AddLine("Average:", _detalhes:ToK (average)) GC:AddLine("Average:", _detalhes:ToK (average))
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
GC:AddLine("E-Hps:", _detalhes:ToK (spell.total / combat_time)) GC:AddLine("E-Hps:", _detalhes:ToK (spell.total / combat_time))
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
GC:AddLine("School:", schooltext) GC:AddLine("School:", schooltext)
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
--GC:AddLine(" ") --GC:AddLine(" ")
GC:AddLine("Normal Hits: ", spell.n_amt .. " (" ..floor( spell.n_amt/total_hits*100) .. "%)") GC:AddLine("Normal Hits: ", spell.n_amt .. " (" ..floor( spell.n_amt/total_hits*100) .. "%)")
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
local n_average = spell.n_total / spell.n_amt local n_average = spell.n_total / spell.n_amt
local T = (combat_time*spell.n_total)/spell.total local T = (combat_time*spell.n_total)/spell.total
@@ -1946,11 +1967,11 @@
GC:AddLine("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format("%.1f",spell.n_total / T )) GC:AddLine("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format("%.1f",spell.n_total / T ))
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
--GC:AddLine(" ")
GC:AddLine("Critical Hits: ", spell.c_amt .. " (" ..floor( spell.c_amt/total_hits*100) .. "%)") GC:AddLine("Critical Hits: ", spell.c_amt .. " (" ..floor( spell.c_amt/total_hits*100) .. "%)")
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
if (spell.c_amt > 0) then if (spell.c_amt > 0) then
local c_average = spell.c_total/spell.c_amt local c_average = spell.c_total/spell.c_amt
@@ -1965,7 +1986,9 @@
end end
GC:AddStatusBar (100, 1, R, G, B, A) GC:AddStatusBar (100, 1, R, G, B, A)
GC:AddIcon(iconTexture, 1, 1, iconSize, iconSize)
end end
]], ]],
percent_script = [[ percent_script = [[
@@ -2006,7 +2029,7 @@
icon = [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_8]], icon = [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_8]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = Loc ["STRING_CUSTOM_DAMAGEONSKULL_DESC"], desc = Loc ["STRING_CUSTOM_DAMAGEONSKULL_DESC"],
source = false, source = false,
target = false, target = false,
@@ -2098,7 +2121,7 @@
icon = [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_5]], icon = [[Interface\TARGETINGFRAME\UI-RaidTargetingIcon_5]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = Loc ["STRING_CUSTOM_DAMAGEONANYMARKEDTARGET_DESC"], desc = Loc ["STRING_CUSTOM_DAMAGEONANYMARKEDTARGET_DESC"],
source = false, source = false,
target = false, target = false,
@@ -2232,7 +2255,7 @@
icon = [[Interface\Buttons\Spell-Reset]], icon = [[Interface\Buttons\Spell-Reset]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = "Show overall damage done on the fly.", desc = "Show overall damage done on the fly.",
source = false, source = false,
target = false, target = false,
@@ -2404,7 +2427,7 @@
icon = [[Interface\ICONS\Spell_Holy_PowerWordShield]], icon = [[Interface\ICONS\Spell_Holy_PowerWordShield]],
attribute = false, attribute = false,
spellid = false, spellid = false,
author = "Details!", author = "Terciob",
desc = "Damage done to shields", desc = "Damage done to shields",
source = false, source = false,
target = false, target = false,