- Several improvements on combatlog reader and custom displays.

- Improvements on enemies damage taken tooltip.
This commit is contained in:
Tercio
2015-05-02 15:51:25 -03:00
parent 19eb7eab43
commit a50dad165a
8 changed files with 624 additions and 195 deletions
+7 -10
View File
File diff suppressed because one or more lines are too long
+218 -135
View File
@@ -508,20 +508,20 @@
local row_value = _math_floor ((self.value / top) * 100)
-- update tooltip function--
-- update tooltip function --
if (self.id) then
--if (self.id == 1) then
-- print (self.classe)
--end
local school_color = _detalhes.school_colors [self.classe]
if (not school_color) then
school_color = _detalhes.school_colors ["unknown"]
local school = _detalhes.spell_school_cache [self.nome]
if (school) then
local school_color = _detalhes.school_colors [school]
if (not school_color) then
school_color = _detalhes.school_colors ["unknown"]
end
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (school_color)
else
local color = _detalhes.school_colors ["unknown"]
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (color)
end
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (school_color)
else
actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor()
end
@@ -605,11 +605,17 @@
if (from_resize) then
if (self.id) then
local school_color = _detalhes.school_colors [self.classe]
if (not school_color) then
school_color = _detalhes.school_colors ["unknown"]
local school = _detalhes.spell_school_cache [self.nome]
if (school) then
local school_color = _detalhes.school_colors [school]
if (not school_color) then
school_color = _detalhes.school_colors ["unknown"]
end
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (school_color)
else
local color = _detalhes.school_colors ["unknown"]
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (color)
end
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (school_color)
else
actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor()
end
@@ -777,6 +783,8 @@
actors.new_actor.classe = actors.actor.classe
end
local icon_cache = {}
function atributo_custom:GetActorTable (actor, name_complement)
local index = self._NameIndexTable [actor.nome]
@@ -786,7 +794,10 @@
--> if is a spell object
local class
if (actor.id) then
local spellname = _GetSpellInfo (actor.id)
local spellname, _, icon = _GetSpellInfo (actor.id)
if (not icon_cache [spellname]) then
icon_cache [spellname] = icon
end
actor.nome = spellname
actor.classe = actor.spellschool
class = actor.spellschool
@@ -817,7 +828,16 @@
if (actor.id) then
new_actor.id = actor.id
new_actor.icon = select (3, _GetSpellInfo (actor.id))
--icon
if (icon_cache [actor.nome]) then
new_actor.icon = icon_cache [actor.nome]
else
local _, _, icon = _GetSpellInfo (actor.id)
if (icon) then
icon_cache [actor.nome] = icon
new_actor.icon = icon
end
end
else
if (not new_actor.classe) then
new_actor.classe = _detalhes:GetClass (actor.nome) or "UNKNOW"
@@ -1536,156 +1556,219 @@
desc = Loc ["STRING_CUSTOM_DTBS_DESC"],
source = false,
target = false,
script_version = 22,
script_version = 27,
on_shift_click = [[
local row, object, instance = ...
local spellname, _, spellicon = _detalhes.GetSpellInfo (object.id)
_detalhes:OpenAuraPanel (object.id, spellname, spellicon)
]],
script = [[
--> get the parameters passed
local combat, instance_container, instance = ...
--> declade the values to return
local total, top, amount = 0, 0, 0
--> get a list of all damage actors
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
--> get the parameters passed
local combat, instance_container, instance = ...
--> declade the values to return
local total, top, amount = 0, 0, 0
--> get a list of all damage actors
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
--> no amount increase for repeated spells
local NoRepeat = {}
--> no amount increase for repeated spells
local NoRepeat = {}
--> do a loop amoung the actors
for index, character in ipairs (AllDamageCharacters) do
--> do a loop amoung the actors
for index, character in ipairs (AllDamageCharacters) do
--> is the actor a player?
if (character:IsPlayer()) then
local taken_from = character.damage_from
for source_name, _ in pairs (taken_from) do
--> is the actor a enemy?
if (character:IsPlayer()) then
local taken_from = character.damage_from
for source_name, _ in pairs (taken_from) do
local source = combat (1, source_name)
if (source) then
--> came from an enemy
if (not source:IsPlayer()) then
local source = combat (1, source_name)
if (source) then
local AllSpells = source:GetSpellList()
for spellid, spell in pairs (AllSpells) do
local on_player = spell.targets [character.nome]
if (not source:IsPlayer()) then
local AllSpells = source:GetSpellList()
for spellid, spell in pairs (AllSpells) do
local on_player = spell.targets [character.nome]
if (on_player and on_player >= 1) then
instance_container:AddValue (spell, on_player)
total = total + on_player
local value = instance_container:GetValue (spell)
if (value > top) then
top = value
end
if (not NoRepeat [spellid]) then
amount = amount + 1
NoRepeat [spellid] = true
end
end
end
else -------------
end -----------
if (on_player and on_player >= 1) then
instance_container:AddValue (spell, on_player)
total = total + on_player
local value = instance_container:GetValue (spell)
if (value > top) then
top = value
end
if (not NoRepeat [spellid]) then
amount = amount + 1
NoRepeat [spellid] = true
end
end
end
end
elseif (source:IsGroupPlayer()) then -- friendly fire
local AllSpells = source.friendlyfire [character.nome] and source.friendlyfire [character.nome].spells
for spellid, on_player in pairs (AllSpells) do
if (on_player and on_player >= 1) then
local TEMP_SPELL_OBJECT = _G ["DetailsDamageTakenBySpellTemp"..spellid]
if (not TEMP_SPELL_OBJECT) then
TEMP_SPELL_OBJECT = {}
_G ["DetailsDamageTakenBySpellTemp"..spellid] = TEMP_SPELL_OBJECT
end
TEMP_SPELL_OBJECT.id = spellid
TEMP_SPELL_OBJECT.spellschool = 1
instance_container:AddValue (TEMP_SPELL_OBJECT, on_player)
total = total + on_player
local value = instance_container:GetValue (TEMP_SPELL_OBJECT)
if (value > top) then
top = value
end
if (not NoRepeat [spellid]) then
amount = amount + 1
NoRepeat [spellid] = true
end
end
end
end
end
end
end
end
end
return total, top, amount
return total, top, amount
]],
tooltip = [[
--get the parameters passed
local actor, combat, instance = ...
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local GameCooltip = GameCooltip
local from_spell = actor.id
--get the parameters passed
local actor, combat, instance = ...
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local GameCooltip = GameCooltip
local from_spell = actor.id
--> get a list of all damage actors
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
--> get a list of all damage actors
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
--> hold the targets
local Targets = {}
local total = 0
local top = 0
--> hold the targets
local Targets = {}
local total = 0
local top = 0
for index, character in ipairs (AllDamageCharacters) do
for index, character in ipairs (AllDamageCharacters) do
for playername, ff_table in pairs (character.friendlyfire) do
if (ff_table.spells [from_spell]) then
--> playername = target which suffered the damage
--> character = who dealt the damage
--> ff_table.spells [from_spell] = total done
local spell = character.spells._ActorTable [from_spell]
local damage_actor = combat (1, playername)
local heal_actor = combat (2, playername)
if (spell) then
for targetname, amount in pairs (spell.targets) do
if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then
local got
for index, t in ipairs (Targets) do
if (t[1] == playername) then
t[2] = t[2] + ff_table.spells [from_spell]
if (t[2] > top) then
top = t[2]
end
got = true
break
end
end
if (not got) then
local got = false
local damage_actor = combat (1, targetname)
local heal_actor = combat (2, targetname)
if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then
for index, t in ipairs (Targets) do
if (t[1] == targetname) then
t[2] = t[2] + amount
if (t[2] > top) then
top = t[2]
end
got = true
break
end
end
if (not got) then
Targets [#Targets+1] = {targetname, amount}
if (amount > top) then
top = amount
end
end
else
for index, t in ipairs (Targets) do
if (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then
t[2] = t[2] + amount
got = true
break
end
end
if (not got) then
Targets [#Targets+1] = {Loc ["STRING_TARGETS_OTHER1"], amount}
end
Targets [#Targets+1] = {playername, ff_table.spells [from_spell]}
if (ff_table.spells [from_spell] > top) then
top = ff_table.spells [from_spell]
end
end
end
end
table.sort (Targets, _detalhes.Sort2)
GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity")
local bar_background = {value = 100, color = {0, 0, 0, 0.7}, texture = "Interface\\AddOns\\Details\\images\\bar4"}
for index, t in ipairs (Targets) do
GameCooltip:AddLine (_detalhes:GetOnlyName(t[1]), _detalhes:ToK (t[2]))
local class, _, _, _, _, r, g, b = _detalhes:GetClass (t[1])
end
--> search actors which used the spell shown in the bar
local spell = character.spells._ActorTable [from_spell]
if (spell) then
for targetname, amount in pairs (spell.targets) do
GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.6, true, bar_background)
local got = false
if (class) then
local texture, l, r, t, b = _detalhes:GetClassIcon (class)
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, l, r, t, b)
elseif (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1)
local damage_actor = combat (1, targetname)
local heal_actor = combat (2, targetname)
if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then
for index, t in ipairs (Targets) do
if (t[1] == targetname) then
t[2] = t[2] + amount
if (t[2] > top) then
top = t[2]
end
got = true
break
end
end
if (not got) then
Targets [#Targets+1] = {targetname, amount}
if (amount > top) then
top = amount
end
end
-- else
-- for index, t in ipairs (Targets) do
-- if (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then
-- t[2] = t[2] + amount
-- got = true
--print (damage_actor and damage_actor.nome, heal_actor and heal_actor.nome)
-- break
-- end
-- end
-- if (not got) then
-- Targets [#Targets+1] = {Loc ["STRING_TARGETS_OTHER1"], amount}
-- end
end
end
local aura = ""
if (WeakAuras) then
aura = "|cFFffa200Shift Click|r: Create Aura"
end
end
end
GameCooltip:AddLine (" ")
GameCooltip:AddLine ("|cFFffa200Click|r: Report Results", aura, 1, "white", "white")
GameCooltip:AddStatusBar (100, 1, 0, 0, 0, 0.6, false, bar_background)
table.sort (Targets, _detalhes.Sort2)
GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity")
local bar_background = {value = 100, color = {0, 0, 0, 0.7}, texture = "Interface\\AddOns\\Details\\images\\bar4"}
for index, t in ipairs (Targets) do
GameCooltip:AddLine (_detalhes:GetOnlyName(t[1]), _detalhes:ToK (t[2]))
local class, _, _, _, _, r, g, b = _detalhes:GetClass (t[1])
GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.6, true, bar_background)
if (class) then
local texture, l, r, t, b = _detalhes:GetClassIcon (class)
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, l, r, t, b)
elseif (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1)
end
end
local aura = ""
if (WeakAuras) then
aura = "|cFFffa200Shift Click|r: Create Aura"
end
GameCooltip:AddLine (" ")
GameCooltip:AddLine ("|cFFffa200Click|r: Report Results", aura, 1, "white", "white")
GameCooltip:AddStatusBar (100, 1, 0, 0, 0, 0.6, false, bar_background)
]],
}
+205 -10
View File
@@ -76,6 +76,8 @@
local ntable = {} --temp
local vtable = {} --temp
local tooltip_temp_table = {}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> exported functions
@@ -1855,8 +1857,10 @@ function atributo_damage:ToolTip (instancia, numero, barra, keydown)
else
if (instancia.sub_atributo == 1 or instancia.sub_atributo == 2) then --> damage done or Dps or enemy
return self:ToolTip_DamageDone (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 3 or instancia.sub_atributo == 6) then --> damage taken
elseif (instancia.sub_atributo == 3) then --> damage taken
return self:ToolTip_DamageTaken (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 6) then --> enemies
return self:ToolTip_Enemies (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 4) then --> friendly fire
return self:ToolTip_FriendlyFire (instancia, numero, barra, keydown)
end
@@ -2105,6 +2109,111 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
return true
end
function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown)
local owner = self.owner
if (owner and owner.classe) then
r, g, b = unpack (_detalhes.class_colors [owner.classe])
else
r, g, b = unpack (_detalhes.class_colors [self.classe])
end
local combat = instancia:GetShowingCombat()
local enemy_name = self:name()
--> enemy damage taken
local i = 1
local damage_taken = 0
for _, actor in _ipairs (combat[1]._ActorTable) do
if (actor.grupo and actor.targets [self.nome]) then
local t = tooltip_temp_table [i]
if (not t) then
tooltip_temp_table [i] = {}
t = tooltip_temp_table [i]
end
t [1] = actor
t [2] = actor.targets [enemy_name] or 0
damage_taken = damage_taken + t [2]
i = i + 1
end
end
for o = i, #tooltip_temp_table do
local t = tooltip_temp_table [o]
t[2] = 0
t[1] = 0
end
_table_sort (tooltip_temp_table, _detalhes.Sort2)
-- enemy damage taken
_detalhes:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_TAKEN_FROM"], headerColor, r, g, b, i-1)
GameCooltip:AddIcon ([[Interface\Buttons\UI-MicroStream-Red]], 1, 1, 14, 14, 0.1875, 0.8125, 0.15625, 0.78125)
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, _detalhes.tooltip_key_size_width, _detalhes.tooltip_key_size_height, 0, 1, 0, 0.640625, _detalhes.tooltip_key_overlay2)
GameCooltip:AddStatusBar (100, 1, 0.7, g, b, 1)
--> build the tooltip
for o = 1, i-1 do
local player = tooltip_temp_table [o][1]
local total = tooltip_temp_table [o][2]
local player_name = _detalhes:GetOnlyName (player:name())
if (player_name:find (_detalhes.playername)) then
GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_taken) * 100) .. "%)", nil, "yellow")
else
GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_taken) * 100) .. "%)")
end
local classe = player:class()
if (not classe) then
classe = "UNKNOW"
end
if (classe == "UNKNOW") then
GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1)
else
GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, 14, 14, _unpack (_detalhes.class_coords [classe]))
end
_detalhes:AddTooltipBackgroundStatusbar()
end
--> damage done and heal
GameCooltip:AddLine (" ")
GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"], FormatTooltipNumber (_, _math_floor (self.total)))
local half = 0.00048828125
GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.005859375 + half, 0.025390625 - half, 0.3623046875, 0.3818359375)
_detalhes:AddTooltipBackgroundStatusbar()
local heal_actor = instancia.showing (2, self.nome)
if (heal_actor) then
GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], FormatTooltipNumber (_, _math_floor (heal_actor.heal_enemy_amt)))
else
GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], 0)
end
GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.037109375 + half, 0.056640625 - half, 0.3623046875, 0.3818359375)
_detalhes:AddTooltipBackgroundStatusbar()
--> enemy description
if (instancia.sub_atributo == 6) then
GameCooltip:AddLine (" ")
GameCooltip:AddLine (Loc ["STRING_LEFTCLICK_DAMAGETAKEN"])
GameCooltip:AddStatusBar (100, 1, 0, 0, 0, 0.7)
GameCooltip:AddLine (Loc ["STRING_MIDDLECLICK_DAMAGETAKEN"])
GameCooltip:AddStatusBar (100, 1, 0, 0, 0, 0.7)
end
--> clean up
for o = 1, #tooltip_temp_table do
local t = tooltip_temp_table [o]
t[2] = 0
t[1] = 0
end
return true
end
---------> DAMAGE TAKEN
function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
@@ -2123,15 +2232,23 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
local meus_agressores = {}
for nome, _ in _pairs (agressores) do --> lista de nomes
local este_agressor = showing._ActorTable [showing._NameIndexTable [nome]]
if (este_agressor) then --> checagem por causa do total e do garbage collector que não limpa os nomes que deram dano
local name = nome
local damage_amount = este_agressor.targets [self.nome]
if (damage_amount) then
if (este_agressor:IsPlayer() or este_agressor:IsNeutralOrEnemy()) then
meus_agressores [#meus_agressores+1] = {name, damage_amount, este_agressor.classe, este_agressor}
if (instancia.sub_atributo == 6) then
for _, actor in _ipairs (showing._ActorTable) do
if (actor.grupo and actor.targets [self.nome]) then
meus_agressores [#meus_agressores+1] = {actor.nome, actor.targets [self.nome], actor.classe, actor}
end
end
else
for nome, _ in _pairs (agressores) do --> lista de nomes
local este_agressor = showing._ActorTable [showing._NameIndexTable [nome]]
if (este_agressor) then --> checagem por causa do total e do garbage collector que não limpa os nomes que deram dano
local name = nome
local damage_amount = este_agressor.targets [self.nome]
if (damage_amount) then
if (este_agressor:IsPlayer() or este_agressor:IsNeutralOrEnemy()) then
meus_agressores [#meus_agressores+1] = {name, damage_amount, este_agressor.classe, este_agressor}
end
end
end
end
@@ -3503,6 +3620,8 @@ end
for i = #vtable, 1, -1 do
vtable [i] = nil
end
wipe (tooltip_temp_table)
end
--> atualize a funcao de abreviacao
@@ -3870,3 +3989,79 @@ function _detalhes.clear:c_atributo_damage (este_jogador)
_detalhes.clear:c_container_habilidades (este_jogador.spells)
end
--[[
--> enemy damage done
i = 1
local enemy = combat (1, enemy_name)
if (enemy) then
local damage_done = 0
--> get targets
for target_name, amount in _pairs (enemy.targets) do
local player = combat (1, target_name)
if (player and player.grupo) then
local t = tooltip_temp_table [i]
if (not t) then
tooltip_temp_table [i] = {}
t = tooltip_temp_table [i]
end
t [1] = player
t [2] = amount
damage_done = damage_done + amount
i = i + 1
end
end
--> first clenup
for o = i, #tooltip_temp_table do
local t = tooltip_temp_table [o]
t[2] = 0
t[1] = 0
end
_table_sort (tooltip_temp_table, _detalhes.Sort2)
--> enemy damage taken
_detalhes:AddTooltipSpellHeaderText (Loc ["STRING_ATTRIBUTE_DAMAGE"], headerColor, r, g, b, i-1, true)
GameCooltip:AddIcon ([=[Interface\Buttons\UI-MicroStream-Green]=], 2, 1, 14, 14, 0.1875, 0.8125, 0.15625, 0.78125)
GameCooltip:AddIcon ([=[Interface\AddOns\Details\images\key_shift]=], 2, 2, _detalhes.tooltip_key_size_width, _detalhes.tooltip_key_size_height, 0, 1, 0, 0.640625, _detalhes.tooltip_key_overlay2)
GameCooltip:AddStatusBar (100, 2, 0.7, g, b, 1)
--> build the tooltip
for o = 1, i-1 do
local player = tooltip_temp_table [o][1]
local total = tooltip_temp_table [o][2]
local player_name = player:name()
if (player_name:find (_detalhes.playername)) then
GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2, "yellow")
else
GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2)
end
local classe = player:class()
if (not classe) then
classe = "UNKNOW"
end
if (classe == "UNKNOW") then
GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", 2, nil, 14, 14, .25, .5, 0, 1)
else
GameCooltip:AddIcon (instancia.row_info.icon_file, 2, nil, 14, 14, _unpack (_detalhes.class_coords [classe]))
end
_detalhes:AddTooltipBackgroundStatusbar (2)
end
end
--> clean up
for o = 1, #tooltip_temp_table do
local t = tooltip_temp_table [o]
t[2] = 0
t[1] = 0
end
--]]
+19 -6
View File
@@ -1005,15 +1005,28 @@
local backgroundColor = {0, 0, 0, 0.6}
local avatarTextColor = {1, 1, 1, 1}
function _detalhes:AddTooltipBackgroundStatusbar()
GameCooltip:AddStatusBar (100, 1, unpack (_detalhes.tooltip.background))
function _detalhes:AddTooltipBackgroundStatusbar (side)
if (not side) then
GameCooltip:AddStatusBar (100, 1, unpack (_detalhes.tooltip.background))
else
GameCooltip:AddStatusBar (100, 2, unpack (_detalhes.tooltip.background))
end
end
function _detalhes:AddTooltipSpellHeaderText (headerText, headerColor, r, g, b, amount)
if (_detalhes.tooltip.show_amount) then
GameCooltip:AddLine (headerText, "x" .. amount .. "", nil, headerColor, r, g, b, .5, 10)
function _detalhes:AddTooltipSpellHeaderText (headerText, headerColor, r, g, b, amount, side)
if (not side) then
if (_detalhes.tooltip.show_amount) then
GameCooltip:AddLine (headerText, "x" .. amount .. "", nil, headerColor, r, g, b, .5, 10)
else
GameCooltip:AddLine (headerText, nil, nil, headerColor, nil, 12)
end
else
GameCooltip:AddLine (headerText, nil, nil, headerColor, nil, 12)
--> sub menu
if (_detalhes.tooltip.show_amount) then
GameCooltip:AddLine (headerText, "x" .. amount .. "", 2, headerColor, r, g, b, .5, 10)
else
GameCooltip:AddLine (headerText, nil, 2, headerColor, nil, 12)
end
end
end
+54 -27
View File
@@ -91,6 +91,7 @@
local container_damage_target = _detalhes.container_type.CONTAINER_DAMAGETARGET_CLASS
local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS
local OBJECT_TYPE_ENEMY = 0x00000040
local OBJECT_TYPE_PLAYER = 0x00000400
local OBJECT_TYPE_PETS = 0x00003000
local AFFILIATION_GROUP = 0x00000007
@@ -231,17 +232,19 @@
--> get actors
--> damager
local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial], damage_cache_petsOwners [who_serial]
local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial] or damage_cache [who_name], damage_cache_petsOwners [who_serial]
if (not este_jogador) then --> pode ser um desconhecido ou um pet
este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (meu_dono) then --> é um pet
damage_cache_pets [who_serial] = este_jogador
damage_cache_petsOwners [who_serial] = meu_dono
if (who_serial ~= "") then
damage_cache_pets [who_serial] = este_jogador
damage_cache_petsOwners [who_serial] = meu_dono
end
--conferir se o dono já esta no cache
if (not damage_cache [meu_dono.serial]) then
if (not damage_cache [meu_dono.serial] and meu_dono.serial ~= "") then
damage_cache [meu_dono.serial] = meu_dono
end
else
@@ -250,11 +253,12 @@
damage_cache [who_serial] = este_jogador
else
if (who_name:find ("%[")) then
damage_cache [who_name] = este_jogador
local _, _, icon = _GetSpellInfo (spellid or 1)
este_jogador.spellicon = icon
--print ("Spell Actor:", who_name)
--print ("no serial actor", spellname, who_name, "added to cache.")
else
--print ("No Serial Actor:", who_name)
--_detalhes:Msg ("Unknown actor with unknown serial ", spellname, who_name)
end
end
end
@@ -266,21 +270,23 @@
end
--> his target
local jogador_alvo, alvo_dono = damage_cache [alvo_serial] or damage_cache_pets [alvo_serial], damage_cache_petsOwners [alvo_serial]
local jogador_alvo, alvo_dono = damage_cache [alvo_serial] or damage_cache_pets [alvo_serial] or damage_cache [alvo_name], damage_cache_petsOwners [alvo_serial]
if (not jogador_alvo) then
jogador_alvo, alvo_dono, alvo_name = _current_damage_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true)
if (alvo_dono) then
damage_cache_pets [alvo_serial] = jogador_alvo
damage_cache_petsOwners [alvo_serial] = alvo_dono
if (alvo_serial ~= "") then
damage_cache_pets [alvo_serial] = jogador_alvo
damage_cache_petsOwners [alvo_serial] = alvo_dono
end
--conferir se o dono já esta no cache
if (not damage_cache [alvo_dono.serial]) then
if (not damage_cache [alvo_dono.serial] and alvo_dono.serial ~= "") then
damage_cache [alvo_dono.serial] = alvo_dono
end
else
if (alvo_flags) then --> ter certeza que não é um pet
if (alvo_flags and alvo_serial ~= "") then --> ter certeza que não é um pet
damage_cache [alvo_serial] = jogador_alvo
end
end
@@ -383,7 +389,7 @@
this_event [5] = _UnitHealth (alvo_name) --> current unit heal
this_event [6] = who_name --> source name
this_event [7] = absorbed
this_event [8] = school
this_event [8] = spelltype or school
this_event [9] = false
this_event [10] = overkill
@@ -446,7 +452,12 @@
spellid ~= 999997 --stagger
) then
--> record death log
--> ignore soul link (damage from the warlock on his pet)
if (spellid == 108446) then
return
end
--> record death log (o erro era o pet, não tinha tabela então dava erro)
if (este_jogador.grupo) then --> se tiver ele não adiciona o evento lá em cima
local t = last_events_cache [alvo_name]
@@ -465,7 +476,7 @@
this_event [5] = _UnitHealth (alvo_name) --> current unit heal
this_event [6] = who_name --> source name
this_event [7] = absorbed
this_event [8] = school
this_event [8] = spelltype or school
this_event [9] = true
this_event [10] = overkill
i = i + 1
@@ -534,7 +545,10 @@
local spell = este_jogador.spells._ActorTable [spellid]
if (not spell) then
spell = este_jogador.spells:PegaHabilidade (spellid, true, token)
spell.spellschool = school
spell.spellschool = spelltype or school
if (_current_combat.is_boss and who_flags and _bit_band (who_flags, OBJECT_TYPE_ENEMY) ~= 0) then
_detalhes.spell_school_cache [spellname] = spelltype or school
end
end
return spell_damage_func (spell, alvo_serial, alvo_name, alvo_flags, amount, who_name, resisted, blocked, absorbed, critical, glacing, token, multistrike, isoffhand)
@@ -542,17 +556,20 @@
function parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike)
--> get the damager and target actors
local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial], damage_cache_petsOwners [who_serial]
--> damager
local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial] or damage_cache [who_name], damage_cache_petsOwners [who_serial]
if (not este_jogador) then --> pode ser um desconhecido ou um pet
este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (meu_dono) then --> é um pet
damage_cache_pets [who_serial] = este_jogador
damage_cache_petsOwners [who_serial] = meu_dono
if (not damage_cache [meu_dono.serial]) then
if (who_serial ~= "") then
damage_cache_pets [who_serial] = este_jogador
damage_cache_petsOwners [who_serial] = meu_dono
end
--conferir se o dono já esta no cache
if (not damage_cache [meu_dono.serial] and meu_dono.serial ~= "") then
damage_cache [meu_dono.serial] = meu_dono
end
else
@@ -561,33 +578,40 @@
damage_cache [who_serial] = este_jogador
else
if (who_name:find ("%[")) then
damage_cache [who_name] = este_jogador
local _, _, icon = _GetSpellInfo (spellid or 1)
este_jogador.spellicon = icon
--print ("no serial actor", spellname, who_name, "added to cache.")
else
--_detalhes:Msg ("Unknown actor with unknown serial ", spellname, who_name)
end
end
end
end
elseif (meu_dono) then
--> é um pet
who_name = who_name .. " <" .. meu_dono.nome .. ">"
end
--> his target
local jogador_alvo, alvo_dono = damage_cache [alvo_serial] or damage_cache_pets [alvo_serial], damage_cache_petsOwners [alvo_serial]
local jogador_alvo, alvo_dono = damage_cache [alvo_serial] or damage_cache_pets [alvo_serial] or damage_cache [alvo_name], damage_cache_petsOwners [alvo_serial]
if (not jogador_alvo) then
jogador_alvo, alvo_dono, alvo_name = _current_damage_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true)
if (alvo_dono) then
damage_cache_pets [alvo_serial] = jogador_alvo
damage_cache_petsOwners [alvo_serial] = alvo_dono
if (alvo_serial ~= "") then
damage_cache_pets [alvo_serial] = jogador_alvo
damage_cache_petsOwners [alvo_serial] = alvo_dono
end
--conferir se o dono já esta no cache
if (not damage_cache [alvo_dono.serial]) then
if (not damage_cache [alvo_dono.serial] and alvo_dono.serial ~= "") then
damage_cache [alvo_dono.serial] = alvo_dono
end
else
if (alvo_flags) then --> ter certeza que não é um pet
if (alvo_flags and alvo_serial ~= "") then --> ter certeza que não é um pet
damage_cache [alvo_serial] = jogador_alvo
end
end
@@ -595,7 +619,6 @@
elseif (alvo_dono) then
--> é um pet
alvo_name = alvo_name .. " <" .. alvo_dono.nome .. ">"
end
--> last event
@@ -623,7 +646,7 @@
this_event [5] = _UnitHealth (alvo_name) --> current unit heal
this_event [6] = who_name --> source name
this_event [7] = absorbed
this_event [8] = school
this_event [8] = spelltype or school
this_event [9] = false
this_event [10] = overkill
@@ -739,6 +762,10 @@
local spell = este_jogador.spells._ActorTable [spellid]
if (not spell) then
spell = este_jogador.spells:PegaHabilidade (spellid, true, token)
spell.spellschool = spelltype
if (_current_combat.is_boss and who_flags and _bit_band (who_flags, OBJECT_TYPE_ENEMY) ~= 0) then
_detalhes.spell_school_cache [spellname] = spelltype
end
end
return spell_damageMiss_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, missType)
end
+2
View File
@@ -844,6 +844,7 @@ local default_profile = {
disable_reset_button = false,
disable_lock_ungroup_buttons = false,
disable_stretch_from_toolbar = false,
disable_stretch_button = false,
damage_taken_everything = false,
--> segments
@@ -1042,6 +1043,7 @@ local default_global_data = {
lastUpdateWarning = 0,
report_where = "SAY",
realm_sync = true,
spell_school_cache = {},
--> switch tables
switchSaved = {slots = 4, table = {
{["atributo"] = 1, ["sub_atributo"] = 1}, --damage done
+75
View File
@@ -1696,6 +1696,81 @@
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
code_editor:SetBackdropColor (0, 0, 0, 1)
code_editor:Hide()
code_editor.font_size = 11
local file, size, flags = code_editor.editbox:GetFont()
code_editor.editbox:SetFont (file, 11, flags)
local expand_func = function()
if (code_editor.expanded) then
code_editor:SetSize (420, 238)
code_editor.expanded = nil
else
code_editor:SetSize (950, 800)
code_editor.expanded = true
end
end
local font_change = function (size)
if (size) then
local file, size, flags = code_editor.editbox:GetFont()
code_editor.font_size = code_editor.font_size + 1
code_editor.editbox:SetFont (file, code_editor.font_size, flags)
else
local file, size, flags = code_editor.editbox:GetFont()
code_editor.font_size = code_editor.font_size - 1
code_editor.editbox:SetFont (file, code_editor.font_size, flags)
end
end
local apply_code = function()
_detalhes:ResetCustomFunctionsCache()
if (DetailsCustomPanel.CodeEditing == 1) then
DetailsCustomPanel.code1 = custom_window.codeeditor:GetText()
elseif (DetailsCustomPanel.CodeEditing == 2) then
DetailsCustomPanel.code2 = custom_window.codeeditor:GetText()
elseif (DetailsCustomPanel.CodeEditing == 3) then
DetailsCustomPanel.code3 = custom_window.codeeditor:GetText()
elseif (DetailsCustomPanel.CodeEditing == 4) then
DetailsCustomPanel.code4 = custom_window.codeeditor:GetText()
end
local main_code = DetailsCustomPanel.code1
local tooltip_code = DetailsCustomPanel.code2
local total_code = DetailsCustomPanel.code3
local percent_code = DetailsCustomPanel.code4
local object = DetailsCustomPanel.IsEditing
object.script = main_code
object.tooltip = tooltip_code
if (total_code ~= DetailsCustomPanel.code3_default) then
object.total_script = total_code
else
object.total_script = false
end
if (percent_code ~= DetailsCustomPanel.code4_default) then
object.percent_script = percent_code
else
object.percent_script = false
end
return true
end
local expand = gump:NewButton (code_editor, nil, "$parentExpand", "expandbutton", 8, 10, expand_func, 4, nil, nil, "^")
expand:SetPoint ("bottomleft", code_editor, "topleft", 3, 0)
local font_size1 = gump:NewButton (code_editor, nil, "$parentFont1", "font1button", 8, 10, font_change, true, nil, nil, "+")
font_size1:SetPoint ("left", expand, "right", -4, 2)
local font_size2 = gump:NewButton (code_editor, nil, "$parentFont2", "font2button", 8, 10, font_change, nil, nil, nil, "-")
font_size2:SetPoint ("left", font_size1, "right", -4, 2)
local apply1 = gump:NewButton (code_editor, nil, "$parentApply", "applybutton", 8, 10, apply_code, nil, nil, nil, "apply")
apply1:SetPoint ("left", font_size2, "right", -4, 1)
--code_editor:SetWidth (650)
--> select damage
DetailsCustomPanelAttributeMenu1:Click()
+44 -7
View File
@@ -374,7 +374,9 @@ local function OnEnterMainWindow (instancia, self)
end
--> stretch button
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6)
if (not _detalhes.disable_stretch_button) then
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6)
end
elseif (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and instancia.baseframe.isLocked) then
@@ -391,8 +393,9 @@ local function OnEnterMainWindow (instancia, self)
end
end
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6)
if (not _detalhes.disable_stretch_button) then
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6)
end
end
end
_detalhes.OnEnterMainWindow = OnEnterMainWindow
@@ -1399,6 +1402,10 @@ local resizeTooltip = {
local resize_scripts_onmousedown = function (self, button)
_G.GameCooltip:ShowMe (false) --> Hide Cooltip
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
if (not self:GetParent().isLocked and button == "LeftButton" and self._instance.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then
self:GetParent().isResizing = true
self._instance:BaseFrameSnap()
@@ -1475,6 +1482,10 @@ end
local resize_scripts_onmouseup = function (self, button)
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
if (self.afundado) then
self.afundado = false
if (self._myside == ">") then
@@ -1575,6 +1586,11 @@ local resize_scripts_onhide = function (self)
end
local resize_scripts_onenter = function (self)
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
if (self._instance.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not self._instance.baseframe.isLocked and not self.mostrando) then
OnEnterMainWindow (self._instance, self)
@@ -1626,6 +1642,11 @@ local lockButtonTooltip = {
}
local lockFunctionOnEnter = function (self)
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
if (self.instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not self.mostrando) then
OnEnterMainWindow (self.instancia, self)
@@ -1670,6 +1691,11 @@ function _detalhes:DelayOptionsRefresh (instance, no_reopen)
end
local lockFunctionOnClick = function (button)
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
local baseframe = button:GetParent()
if (baseframe.isLocked) then
baseframe.isLocked = false
@@ -1717,6 +1743,10 @@ local unSnapButtonTooltip = {
local unSnapButtonOnEnter = function (self)
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
local have_snap = false
for _, instancia_id in _pairs (self.instancia.snap) do
if (instancia_id) then
@@ -2076,7 +2106,9 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia)
button:SetScript ("OnEnter", function (self)
self.mouse_over = true
gump:Fade (self, "ALPHA", 1)
if (not _detalhes.disable_stretch_button) then
gump:Fade (self, "ALPHA", 1)
end
end)
button:SetScript ("OnLeave", function (self)
self.mouse_over = false
@@ -2510,6 +2542,10 @@ function _detalhes:InstanceAlertTime (instance)
instance.alert_time = nil
end
local hide_click_func = function()
--empty
end
function _detalhes:InstanceAlert (msg, icon, time, clickfunc)
if (not self.meu_id) then
@@ -2564,7 +2600,7 @@ function _detalhes:InstanceAlert (msg, icon, time, clickfunc)
if (clickfunc) then
self.alert.button:SetClickFunction (unpack (clickfunc))
else
self.alert.button.clickfunction = nil
self.alert.button:SetClickFunction (hide_click_func)
end
time = time or 15
@@ -3180,8 +3216,10 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
instancia.break_snap_button.instancia = instancia
instancia.break_snap_button:SetScript ("OnClick", function()
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
instancia:Desagrupar (-1)
--> hide tutorial
if (DetailsWindowGroupPopUp1 and DetailsWindowGroupPopUp1:IsShown()) then
DetailsWindowGroupPopUp1:Hide()
@@ -3190,7 +3228,6 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
instancia.break_snap_button:SetScript ("OnEnter", unSnapButtonOnEnter)
instancia.break_snap_button:SetScript ("OnLeave", unSnapButtonOnLeave)
instancia.break_snap_button:SetNormalTexture (DEFAULT_SKIN)
instancia.break_snap_button:SetDisabledTexture (DEFAULT_SKIN)