- Added new custom display: Health Potion & Stone.
- Added tooltip and support for healers on 'My Spells' display. - Changed healing multistrike to use the same format as damage done. - Fre improvements on Tiny Threat plugin: color gradient green-red is fixed, texts and bar texture now correctly uses the window settings. - Fixed 'First Hit' raid tool. - Fixed 'Open Options Panel' from interface panel.
This commit is contained in:
+216
-74
@@ -143,6 +143,10 @@
|
||||
return _detalhes:EndRefresh (instance, 0, combat, combat [1])
|
||||
end
|
||||
|
||||
total = total or 0
|
||||
top = top or 0
|
||||
amount = amount or 0
|
||||
|
||||
else
|
||||
--> get the attribute
|
||||
local attribute = custom_object:GetAttribute()
|
||||
@@ -1245,20 +1249,74 @@
|
||||
self.custom [#self.custom+1] = PotionUsed
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local Healthstone = {
|
||||
name = Loc ["STRING_CUSTOM_HEALTHSTONE_DEFAULT"],
|
||||
icon = [[Interface\ICONS\warlock_ healthstone]],
|
||||
attribute = "healdone",
|
||||
spellid = 6262,
|
||||
author = "Details!",
|
||||
attribute = false,
|
||||
spellid = false,
|
||||
author = "Details! Team",
|
||||
desc = Loc ["STRING_CUSTOM_HEALTHSTONE_DEFAULT_DESC"],
|
||||
source = "[raid]",
|
||||
target = "[raid]",
|
||||
script = false,
|
||||
tooltip = false,
|
||||
script_version = 1,
|
||||
source = false,
|
||||
target = false,
|
||||
script = [[
|
||||
--get the parameters passed
|
||||
local combat, instance_container, instance = ...
|
||||
--declade the values to return
|
||||
local total, top, amount = 0, 0, 0
|
||||
|
||||
--do the loop
|
||||
local AllHealCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_HEAL)
|
||||
for index, character in ipairs (AllHealCharacters) do
|
||||
local AllSpells = character:GetSpellList()
|
||||
local found = false
|
||||
for spellid, spell in pairs (AllSpells) do
|
||||
if (spellid == 6262 or spellid == 156445) then
|
||||
instance_container:AddValue (character, spell.total)
|
||||
total = total + spell.total
|
||||
if (top < spell.total) then
|
||||
top = spell.total
|
||||
end
|
||||
found = true
|
||||
end
|
||||
end
|
||||
|
||||
if (found) then
|
||||
amount = amount + 1
|
||||
end
|
||||
end
|
||||
--loop end
|
||||
--return the values
|
||||
return total, top, amount
|
||||
]],
|
||||
tooltip = [[
|
||||
--get the parameters passed
|
||||
local actor, combat, instance = ...
|
||||
|
||||
--get the cooltip object (we dont use the convencional GameTooltip here)
|
||||
local GameCooltip = GameCooltip
|
||||
local R, G, B, A = 0, 0, 0, 0.75
|
||||
local hs = actor:GetSpell (6262)
|
||||
if (hs) then
|
||||
GameCooltip:AddLine (select (1, GetSpellInfo(6262)), _detalhes:ToK(hs.total))
|
||||
GameCooltip:AddIcon (select (3, GetSpellInfo (6262)), 1, 1, 16, 16)
|
||||
GameCooltip:AddStatusBar (100, 1, R, G, B, A)
|
||||
end
|
||||
|
||||
local pot = actor:GetSpell (156445)
|
||||
if (pot) then
|
||||
GameCooltip:AddLine (select (1, GetSpellInfo(156445)), _detalhes:ToK(pot.total))
|
||||
GameCooltip:AddIcon (select (3, GetSpellInfo (156445)), 1, 1, 16, 16)
|
||||
GameCooltip:AddStatusBar (100, 1, R, G, B, A)
|
||||
end
|
||||
--Cooltip code
|
||||
]],
|
||||
percent_script = false,
|
||||
total_script = false,
|
||||
script_version = 3,
|
||||
}
|
||||
|
||||
-- /run_detalhes:AddDefaultCustomDisplays()
|
||||
local have = false
|
||||
for _, custom in ipairs (self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_HEALTHSTONE_DEFAULT"] and (custom.script_version and custom.script_version >= Healthstone.script_version) ) then
|
||||
@@ -1276,7 +1334,7 @@
|
||||
Healthstone.__index = _detalhes.atributo_custom
|
||||
self.custom [#self.custom+1] = Healthstone
|
||||
end
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local DamageActivityTime = {
|
||||
@@ -1571,15 +1629,26 @@
|
||||
desc = Loc ["STRING_CUSTOM_MYSPELLS_DESC"],
|
||||
source = false,
|
||||
target = false,
|
||||
script_version = 1,
|
||||
script_version = 2,
|
||||
script = [[
|
||||
--get the parameters passed
|
||||
local combat, instance_container, instance = ...
|
||||
--declade the values to return
|
||||
local total, top, amount = 0, 0, 0
|
||||
|
||||
local player
|
||||
local role = UnitGroupRolesAssigned ("player")
|
||||
|
||||
if (role == "DAMAGER") then
|
||||
player = combat (DETAILS_ATTRIBUTE_DAMAGE, _detalhes.playername)
|
||||
elseif (role == "HEALER") then
|
||||
player = combat (DETAILS_ATTRIBUTE_HEAL, _detalhes.playername)
|
||||
else
|
||||
player = combat (DETAILS_ATTRIBUTE_DAMAGE, _detalhes.playername)
|
||||
end
|
||||
|
||||
--do the loop
|
||||
local player = combat (DETAILS_ATTRIBUTE_DAMAGE, _detalhes.playername)
|
||||
|
||||
if (player) then
|
||||
local spells = player:GetSpellList()
|
||||
for spellid, spell in pairs (spells) do
|
||||
@@ -1610,71 +1679,144 @@
|
||||
local GC = GameCooltip
|
||||
GC:SetOption ("YSpacingMod", 1)
|
||||
|
||||
local role = UnitGroupRolesAssigned ("player")
|
||||
|
||||
local spellschool, schooltext = spell.spellschool, ""
|
||||
if (spellschool) then
|
||||
local t = _detalhes.spells_school [spellschool]
|
||||
if (t and t.name) then
|
||||
schooltext = t.formated
|
||||
end
|
||||
end
|
||||
|
||||
local total_hits = spell.counter
|
||||
local combat_time = instance.showing:GetCombatTime()
|
||||
|
||||
--Cooltip code
|
||||
GC:AddLine ("Hits:", spell.counter)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
local average = spell.total / total_hits
|
||||
GC:AddLine ("Average:", _detalhes:ToK (average))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("E-Dps:", _detalhes:ToK (spell.total / combat_time))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("School:", schooltext)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Normal Hits: ", spell.n_amt .. " (" ..floor ( spell.n_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
local n_average = spell.n_dmg / spell.n_amt
|
||||
local T = (combat_time*spell.n_dmg)/spell.total
|
||||
local P = average/n_average*100
|
||||
T = P*T/100
|
||||
|
||||
GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format ("%.1f",spell.n_dmg / T ))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Critical Hits: ", spell.c_amt .. " (" ..floor ( spell.c_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
if (spell.c_amt > 0) then
|
||||
local c_average = spell.c_dmg/spell.c_amt
|
||||
local T = (combat_time*spell.c_dmg)/spell.total
|
||||
local P = average/c_average*100
|
||||
T = P*T/100
|
||||
local crit_dps = spell.c_dmg / T
|
||||
if (spell.n_dmg) then
|
||||
|
||||
local spellschool, schooltext = spell.spellschool, ""
|
||||
if (spellschool) then
|
||||
local t = _detalhes.spells_school [spellschool]
|
||||
if (t and t.name) then
|
||||
schooltext = t.formated
|
||||
end
|
||||
end
|
||||
|
||||
local total_hits = spell.counter
|
||||
local combat_time = instance.showing:GetCombatTime()
|
||||
|
||||
--Cooltip code
|
||||
GC:AddLine ("Hits:", spell.counter)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
local average = spell.total / total_hits
|
||||
GC:AddLine ("Average:", _detalhes:ToK (average))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("E-Dps:", _detalhes:ToK (spell.total / combat_time))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("School:", schooltext)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Normal Hits: ", spell.n_amt .. " (" ..floor ( spell.n_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
local n_average = spell.n_dmg / spell.n_amt
|
||||
local T = (combat_time*spell.n_dmg)/spell.total
|
||||
local P = average/n_average*100
|
||||
T = P*T/100
|
||||
|
||||
GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format ("%.1f",spell.n_dmg / T ))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Critical Hits: ", spell.c_amt .. " (" ..floor ( spell.c_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
if (spell.c_amt > 0) then
|
||||
local c_average = spell.c_dmg/spell.c_amt
|
||||
local T = (combat_time*spell.c_dmg)/spell.total
|
||||
local P = average/c_average*100
|
||||
T = P*T/100
|
||||
local crit_dps = spell.c_dmg / T
|
||||
|
||||
GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (c_average) .. " / " .. _detalhes:comma_value (crit_dps))
|
||||
else
|
||||
GC:AddLine ("Average / E-Dps: ", "0 / 0")
|
||||
end
|
||||
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Multistrike: ", spell.m_amt .. " (" ..floor ( spell.m_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("On Normal / On Critical:", spell.m_amt - spell.m_crit .. " / " .. spell.m_crit)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
elseif (spell.n_curado) then
|
||||
|
||||
local spellschool, schooltext = spell.spellschool, ""
|
||||
if (spellschool) then
|
||||
local t = _detalhes.spells_school [spellschool]
|
||||
if (t and t.name) then
|
||||
schooltext = t.formated
|
||||
end
|
||||
end
|
||||
|
||||
local total_hits = spell.counter
|
||||
local combat_time = instance.showing:GetCombatTime()
|
||||
|
||||
--Cooltip code
|
||||
GC:AddLine ("Hits:", spell.counter)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
local average = spell.total / total_hits
|
||||
GC:AddLine ("Average:", _detalhes:ToK (average))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("E-Hps:", _detalhes:ToK (spell.total / combat_time))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("School:", schooltext)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Normal Hits: ", spell.n_amt .. " (" ..floor ( spell.n_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
local n_average = spell.n_curado / spell.n_amt
|
||||
local T = (combat_time*spell.n_curado)/spell.total
|
||||
local P = average/n_average*100
|
||||
T = P*T/100
|
||||
|
||||
GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format ("%.1f",spell.n_curado / T ))
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Critical Hits: ", spell.c_amt .. " (" ..floor ( spell.c_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
if (spell.c_amt > 0) then
|
||||
local c_average = spell.c_curado/spell.c_amt
|
||||
local T = (combat_time*spell.c_curado)/spell.total
|
||||
local P = average/c_average*100
|
||||
T = P*T/100
|
||||
local crit_dps = spell.c_curado / T
|
||||
|
||||
GC:AddLine ("Average / E-Hps: ", _detalhes:ToK (c_average) .. " / " .. _detalhes:comma_value (crit_dps))
|
||||
else
|
||||
GC:AddLine ("Average / E-Hps: ", "0 / 0")
|
||||
end
|
||||
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Multistrike: ", spell.m_amt .. " (" ..floor ( spell.m_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("On Normal / On Critical:", spell.m_amt - spell.m_crit .. " / " .. spell.m_crit)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
|
||||
GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (c_average) .. " / " .. _detalhes:comma_value (crit_dps))
|
||||
else
|
||||
GC:AddLine ("Average / E-Dps: ", "0 / 0")
|
||||
end
|
||||
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
--GC:AddLine (" ")
|
||||
|
||||
GC:AddLine ("Multistrike: ", spell.m_amt .. " (" ..floor ( spell.m_amt/total_hits*100) .. "%)")
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
|
||||
GC:AddLine ("On Normal / On Critical:", spell.m_amt - spell.m_crit .. " / " .. spell.m_crit)
|
||||
GC:AddStatusBar (100, 1, R, G, B, A)
|
||||
]],
|
||||
|
||||
percent_script = [[
|
||||
|
||||
+12
-21
@@ -1909,33 +1909,24 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
|
||||
if (esta_magia.m_amt > 0) then
|
||||
|
||||
local multistrike_hits = esta_magia.m_amt
|
||||
local multistrike_heal = esta_magia.m_curado
|
||||
local multistrike_heal = esta_magia.m_healed
|
||||
|
||||
local media_multistrike = multistrike_heal/multistrike_hits
|
||||
|
||||
local T
|
||||
if (media_multistrike > 0) then
|
||||
T = (meu_tempo*multistrike_heal)/esta_magia.total
|
||||
local P = (esta_magia.total/esta_magia.counter)/media_multistrike*100
|
||||
T = P*T/100
|
||||
else
|
||||
T = 1
|
||||
end
|
||||
|
||||
local overheal = esta_magia.m_overheal
|
||||
overheal = overheal / (multistrike_heal + overheal) * 100
|
||||
local media_normal = multistrike_heal / multistrike_hits
|
||||
local T = (meu_tempo * multistrike_heal) / esta_magia.total
|
||||
local P = media / media_normal * 100
|
||||
T = P * T / 100
|
||||
|
||||
data[#data+1] = t3
|
||||
multistrike_table.p = esta_magia.m_amt/total_hits*100
|
||||
|
||||
t3[1] = esta_magia.m_amt
|
||||
t3[1] = multistrike_hits
|
||||
t3[2] = multistrike_table
|
||||
t3[3] = Loc ["STRING_MULTISTRIKE"]
|
||||
t3[4] = Loc ["STRING_OVERHEAL"] .. ": " .. _math_floor (overheal) .. "%"
|
||||
t3[5] = ""
|
||||
t3[6] = Loc ["STRING_AVERAGE"] .. ": " .. _detalhes:comma_value (esta_magia.m_curado/esta_magia.m_amt)
|
||||
t3[7] = Loc ["STRING_HPS"] .. ": " .. _detalhes:comma_value (esta_magia.m_curado/T)
|
||||
t3[8] = esta_magia.m_amt .. " / " .. _cstr ("%.1f", esta_magia.m_amt/total_hits*100) .. "%"
|
||||
t3[3] = Loc ["STRING_MULTISTRIKE_HITS"]
|
||||
t3[4] = "On Critical: " .. esta_magia.m_crit
|
||||
t3[5] = "On Normals: " .. (esta_magia.m_amt - esta_magia.m_crit)
|
||||
t3[6] = Loc ["STRING_AVERAGE"] .. ": " .. _detalhes:comma_value (multistrike_heal / multistrike_hits)
|
||||
t3[7] = Loc ["STRING_HPS"] .. ": " .. _detalhes:comma_value (multistrike_heal / T)
|
||||
t3[8] = multistrike_hits .. " / " .. _cstr ("%.1f", multistrike_hits / total_hits * 100) .. "%"
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
|
||||
--> multistrike
|
||||
m_amt = 0,
|
||||
m_curado = 0,
|
||||
m_overheal = 0,
|
||||
m_healed = 0,
|
||||
m_crit = 0,
|
||||
|
||||
--> normal hits
|
||||
n_min = 0,
|
||||
@@ -56,34 +56,35 @@
|
||||
|
||||
function habilidade_cura:Add (serial, nome, flag, amount, who_nome, absorbed, critical, overhealing, is_shield, multistrike)
|
||||
|
||||
self.counter = self.counter + 1
|
||||
|
||||
amount = amount or 0
|
||||
self.total = self.total + amount
|
||||
self.targets [nome] = (self.targets [nome] or 0) + amount
|
||||
|
||||
if (multistrike) then
|
||||
self.m_amt = self.m_amt + 1
|
||||
self.m_curado = self.m_curado + amount
|
||||
self.m_overheal = self.m_overheal + overhealing
|
||||
end
|
||||
self.m_healed = self.m_healed + amount
|
||||
|
||||
if (critical) then
|
||||
self.m_crit = self.m_crit + 1
|
||||
end
|
||||
else
|
||||
|
||||
if (absorbed and absorbed > 0) then
|
||||
self.absorbed = self.absorbed + absorbed
|
||||
end
|
||||
|
||||
if (overhealing and overhealing > 0) then
|
||||
self.overheal = self.overheal + overhealing
|
||||
self.targets_overheal [nome] = (self.targets_overheal [nome] or 0) + amount
|
||||
end
|
||||
|
||||
if (amount and amount > 0) then
|
||||
|
||||
self.total = self.total + amount
|
||||
self.counter = self.counter + 1
|
||||
|
||||
if (absorbed and absorbed > 0) then
|
||||
self.absorbed = self.absorbed + absorbed
|
||||
end
|
||||
|
||||
if (overhealing and overhealing > 0) then
|
||||
self.overheal = self.overheal + overhealing
|
||||
self.targets_overheal [nome] = (self.targets_overheal [nome] or 0) + amount
|
||||
end
|
||||
|
||||
if (is_shield) then
|
||||
self.totalabsorb = self.totalabsorb + amount
|
||||
self.targets_absorbs [nome] = (self.targets_absorbs [nome] or 0) + amount
|
||||
end
|
||||
|
||||
|
||||
if (critical) then
|
||||
self.c_curado = self.c_curado+amount --> amount é o total de dano
|
||||
self.c_amt = self.c_amt+1 --> amount é o total de dano
|
||||
@@ -103,6 +104,7 @@
|
||||
self.n_min = amount
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@
|
||||
)
|
||||
) then
|
||||
--> não entra em combate se for DOT
|
||||
if (_detalhes.encounter_table.id and _detalhes.encounter_table ["start"] >= _G.time()-3 and _detalhes.announce_firsthit.enabled) then
|
||||
if (_detalhes.encounter_table.id and _detalhes.encounter_table ["start"] >= _GetTime() - 3 and _detalhes.announce_firsthit.enabled) then
|
||||
local link
|
||||
if (spellid <= 10) then
|
||||
link = _GetSpellInfo (spellid)
|
||||
|
||||
@@ -19,6 +19,18 @@
|
||||
return _detalhes.plugin_database [PluginAbsoluteName]
|
||||
end
|
||||
|
||||
function _detalhes:GetPluginInstance (PluginAbsoluteName)
|
||||
local plugin = self
|
||||
if (PluginAbsoluteName) then
|
||||
plugin = _detalhes:GetPlugin (PluginAbsoluteName)
|
||||
end
|
||||
|
||||
local id = plugin.instance_id
|
||||
if (id) then
|
||||
return _detalhes:GetInstance (id)
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:IsPluginEnabled (PluginAbsoluteName)
|
||||
if (PluginAbsoluteName) then
|
||||
local plugin = _detalhes.plugin_database [PluginAbsoluteName]
|
||||
|
||||
@@ -1436,6 +1436,21 @@
|
||||
f.options_button:SetWidth (170)
|
||||
f.options_button:SetScript ("OnClick", function (self)
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
--> no window opened?
|
||||
local instance1 = _detalhes.tabela_instancias [1]
|
||||
if (instance1) then
|
||||
instance1:Enable()
|
||||
return _detalhes:OpenOptionsWindow (instance1)
|
||||
else
|
||||
instance1 = _detalhes:CriarInstancia (_, true)
|
||||
if (instance1) then
|
||||
return _detalhes:OpenOptionsWindow (instance1)
|
||||
else
|
||||
_detalhes:Msg ("couldn't open options panel: no window available.")
|
||||
end
|
||||
end
|
||||
end
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end)
|
||||
|
||||
|
||||
+26
-1
@@ -22,7 +22,10 @@
|
||||
["DETAILS_INSTANCE_CHANGEATTRIBUTE"] = {},
|
||||
["DETAILS_INSTANCE_CHANGEMODE"] = {},
|
||||
["DETAILS_INSTANCE_NEWROW"] = {},
|
||||
|
||||
|
||||
--> misc
|
||||
["DETAILS_OPTIONS_MODIFIED"] = {},
|
||||
|
||||
--> data
|
||||
["DETAILS_DATA_RESET"] = {},
|
||||
["DETAILS_DATA_SEGMENTREMOVED"] = {},
|
||||
@@ -72,6 +75,7 @@ local common_events = {
|
||||
["DETAILS_INSTANCE_CHANGEATTRIBUTE"] = true,
|
||||
["DETAILS_INSTANCE_CHANGEMODE"] = true,
|
||||
["DETAILS_INSTANCE_NEWROW"] = true,
|
||||
["DETAILS_OPTIONS_MODIFIED"] = true,
|
||||
["DETAILS_DATA_RESET"] = true,
|
||||
["DETAILS_DATA_SEGMENTREMOVED"] = true,
|
||||
["COMBAT_PLAYER_ENTER"] = true,
|
||||
@@ -252,6 +256,27 @@ local common_events = {
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> special cases
|
||||
function _detalhes:SendOptionsModifiedEvent (instance)
|
||||
|
||||
_detalhes.last_options_modified = _detalhes.last_options_modified or (GetTime() - 5)
|
||||
|
||||
if (_detalhes.last_options_modified + 0.3 < GetTime()) then
|
||||
_detalhes:SendEvent ("DETAILS_OPTIONS_MODIFIED", nil, instance, param)
|
||||
_detalhes.last_options_modified = GetTime()
|
||||
if (_detalhes.last_options_modified_schedule) then
|
||||
_detalhes:CancelTimer (_detalhes.last_options_modified_schedule)
|
||||
_detalhes.last_options_modified_schedule = nil
|
||||
end
|
||||
else
|
||||
if (_detalhes.last_options_modified_schedule) then
|
||||
_detalhes:CancelTimer (_detalhes.last_options_modified_schedule)
|
||||
end
|
||||
_detalhes.last_options_modified_schedule = _detalhes:ScheduleTimer ("SendOptionsModifiedEvent", 0.31, instance)
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> listeners
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,12 +49,15 @@ local function CreatePluginFrames (data)
|
||||
-->
|
||||
ThreatMeter.Actived = false
|
||||
|
||||
--> localize functions
|
||||
ThreatMeter.percent_color = ThreatMeter.percent_color
|
||||
|
||||
--> window reference
|
||||
local instance
|
||||
local player
|
||||
|
||||
--> OnEvent Table
|
||||
function ThreatMeter:OnDetailsEvent (event)
|
||||
function ThreatMeter:OnDetailsEvent (event, ...)
|
||||
|
||||
if (event == "HIDE") then --> plugin hidded, disabled
|
||||
ThreatMeter.Actived = false
|
||||
@@ -90,8 +93,18 @@ local function CreatePluginFrames (data)
|
||||
end
|
||||
|
||||
elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then
|
||||
ThreatMeter:SizeChanged()
|
||||
ThreatMeter:RefreshRows()
|
||||
|
||||
local what_window = select (1, ...)
|
||||
if (what_window == instance) then
|
||||
ThreatMeter:SizeChanged()
|
||||
ThreatMeter:RefreshRows()
|
||||
end
|
||||
|
||||
elseif (event == "DETAILS_OPTIONS_MODIFIED") then
|
||||
local what_window = select (1, ...)
|
||||
if (what_window == instance) then
|
||||
ThreatMeter:RefreshRows()
|
||||
end
|
||||
|
||||
elseif (event == "DETAILS_INSTANCE_STARTSTRETCH") then
|
||||
ThreatMeterFrame:SetFrameStrata ("TOOLTIP")
|
||||
@@ -146,6 +159,8 @@ local function CreatePluginFrames (data)
|
||||
|
||||
function ThreatMeter:SizeChanged()
|
||||
|
||||
local instance = ThreatMeter:GetPluginInstance()
|
||||
|
||||
local w, h = instance:GetSize()
|
||||
ThreatMeterFrame:SetWidth (w)
|
||||
ThreatMeterFrame:SetHeight (h)
|
||||
@@ -173,10 +188,15 @@ local function CreatePluginFrames (data)
|
||||
end
|
||||
|
||||
function ThreatMeter:RefreshRow (row)
|
||||
|
||||
local instance = ThreatMeter:GetPluginInstance()
|
||||
|
||||
row.textsize = instance.row_info.font_size
|
||||
row.textfont = instance.row_info.font_face
|
||||
row.texture = instance.row_info.texture
|
||||
row.shadow = instance.row_info.textL_outline
|
||||
|
||||
row.width = instance.baseframe:GetWidth()-5
|
||||
end
|
||||
|
||||
function ThreatMeter:RefreshRows()
|
||||
@@ -351,7 +371,9 @@ local function CreatePluginFrames (data)
|
||||
pullRow:SetValue (100)
|
||||
|
||||
local myPercentToAggro = myThreat / aggro * 100
|
||||
local r, g = myPercentToAggro / 100, (100-myPercentToAggro) / 100
|
||||
|
||||
local r, g = ThreatMeter:percent_color (myPercentToAggro)
|
||||
--local r, g = myPercentToAggro / 100, (100-myPercentToAggro) / 100
|
||||
pullRow:SetColor (r, g, 0)
|
||||
pullRow._icon:SetTexture ([[Interface\PVPFrame\Icon-Combat]])
|
||||
--pullRow._icon:SetVertexColor (r, g, 0)
|
||||
@@ -393,12 +415,8 @@ local function CreatePluginFrames (data)
|
||||
if (index == 2) then
|
||||
thisRow:SetColor (pct*0.01, _math_abs (pct-100)*0.01, 0, 1)
|
||||
else
|
||||
thisRow:SetColor (pct*0.01, _math_abs (pct-100)*0.01, 0, .3)
|
||||
if (pct >= 50) then
|
||||
thisRow:SetColor ( 1, _math_abs (pct - 100)/100, 0, 1)
|
||||
else
|
||||
thisRow:SetColor (pct/100, 1, 0, 1)
|
||||
end
|
||||
local r, g = ThreatMeter:percent_color (pct, true)
|
||||
thisRow:SetColor (r, g, 0, 1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -425,10 +443,12 @@ local function CreatePluginFrames (data)
|
||||
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
|
||||
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)")
|
||||
thisRow:SetValue (threat_actor [2])
|
||||
|
||||
if (options.useplayercolor) then
|
||||
thisRow:SetColor (_unpack (options.playercolor))
|
||||
else
|
||||
thisRow:SetColor (threat_actor [2]*0.01, _math_abs (threat_actor [2]-100)*0.01, 0, .3)
|
||||
local r, g = ThreatMeter:percent_color (threat_actor [2], true)
|
||||
thisRow:SetColor (r, g, 0, .3)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -628,6 +648,7 @@ function ThreatMeter:OnEvent (_, event, ...)
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_SIZECHANGED")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_STARTSTRETCH")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_ENDSTRETCH")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_OPTIONS_MODIFIED")
|
||||
|
||||
ThreatMeterFrame:RegisterEvent ("PLAYER_TARGET_CHANGED")
|
||||
ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_DISABLED")
|
||||
|
||||
Reference in New Issue
Block a user