- Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar.
- Implemented code for early tests with new version checker. - Renamed option menu "externals" to "Data Feed".
This commit is contained in:
@@ -1124,9 +1124,55 @@ end
|
||||
function atributo_custom:IsSpellTarget()
|
||||
return self.spellid and self.target and true
|
||||
end
|
||||
|
||||
|
||||
function atributo_custom:RemoveCustom (index)
|
||||
|
||||
if (not _detalhes.tabela_instancias) then
|
||||
--> do not remove customs while the addon is loading.
|
||||
return
|
||||
end
|
||||
|
||||
table.remove (_detalhes.custom, index)
|
||||
|
||||
for _, instance in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (instance.atributo == 5 and instance.sub_atributo == index) then
|
||||
instance:ResetAttribute()
|
||||
elseif (instance.atributo == 5 and instance.sub_atributo > index) then
|
||||
instance.sub_atributo = instance.sub_atributo - 1
|
||||
instance.sub_atributo_last [5] = 1
|
||||
else
|
||||
instance.sub_atributo_last [5] = 1
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.switch:OnRemoveCustom (index)
|
||||
end
|
||||
|
||||
function _detalhes.refresh:r_atributo_custom()
|
||||
for _, custom_object in _ipairs (_detalhes.custom) do
|
||||
|
||||
--> check for non used temp displays
|
||||
if (_detalhes.tabela_instancias) then
|
||||
for i = #_detalhes.custom, 1, -1 do
|
||||
local custom_object = _detalhes.custom [i]
|
||||
if (custom_object.temp) then
|
||||
--> check if there is a instance showing this custom
|
||||
local showing = false
|
||||
|
||||
for index, instance in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (instance.atributo == 5 and instance.sub_atributo == i) then
|
||||
showing = true
|
||||
end
|
||||
end
|
||||
|
||||
if (not showing) then
|
||||
atributo_custom:RemoveCustom (i)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> restore metatable and indexes
|
||||
for index, custom_object in _ipairs (_detalhes.custom) do
|
||||
_setmetatable (custom_object, atributo_custom)
|
||||
custom_object.__index = atributo_custom
|
||||
end
|
||||
|
||||
@@ -1691,6 +1691,13 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
|
||||
|
||||
end
|
||||
|
||||
--> enemies
|
||||
if (instancia.sub_atributo == 6) then
|
||||
GameCooltip:AddLine (" ")
|
||||
GameCooltip:AddLine ("|cFFFFCC00middle button|r: real-time damage taken")
|
||||
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 14/512, 64/512, 127/512, 204/512)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -2011,7 +2011,12 @@ function _detalhes:MontaAtributosOption (instancia, func)
|
||||
CoolTip:AddMenu (2, _detalhes.OpenCustomDisplayWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], "Interface\\PaperDollInfoFrame\\Character-Plus", true)
|
||||
|
||||
for index, custom in _ipairs (_detalhes.custom) do
|
||||
CoolTip:AddLine (custom.name, nil, 2)
|
||||
if (custom.temp) then
|
||||
CoolTip:AddLine (custom.name .. Loc ["STRING_CUSTOM_TEMPORARILY"], nil, 2)
|
||||
else
|
||||
CoolTip:AddLine (custom.name, nil, 2)
|
||||
end
|
||||
|
||||
CoolTip:AddMenu (2, func, true, 5, index)
|
||||
CoolTip:AddIcon (custom.icon, 2, 1, 16, 16)
|
||||
end
|
||||
|
||||
@@ -1217,10 +1217,23 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
if (_IsInRaid()) then
|
||||
|
||||
local pot_usage = {}
|
||||
local pot_usage_test = {}
|
||||
|
||||
for raidIndex = 1, _GetNumGroupMembers() do
|
||||
for buffIndex = 1, 41 do
|
||||
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("raid"..raidIndex, buffIndex, nil, "HELPFUL")
|
||||
|
||||
if (in_or_out == "BUFF_UPTIME_IN") then
|
||||
if (_detalhes.PotionList [spellid]) then
|
||||
print ("Pre Potion Found on raidIndex", raidIndex, unitCaster, spellid)
|
||||
local playerName, realmName = _UnitName ("raid"..raidIndex)
|
||||
if (realmName and realmName ~= "") then
|
||||
playerName = playerName .. "-" .. realmName
|
||||
end
|
||||
pot_usage_test [playerName] = spellid
|
||||
end
|
||||
end
|
||||
|
||||
--print (name, unitCaster, "==", "raid"..raidIndex)
|
||||
if (name and unitCaster == "raid"..raidIndex) then
|
||||
|
||||
@@ -1243,7 +1256,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
end
|
||||
end
|
||||
|
||||
--> i don't remmember why do we iterate through the player again.
|
||||
--> unitCaster return player instead of raidIndex
|
||||
for buffIndex = 1, 41 do
|
||||
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
|
||||
if (name and unitCaster == "player") then
|
||||
@@ -1262,17 +1275,24 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
end
|
||||
|
||||
if (in_or_out == "BUFF_UPTIME_IN") then
|
||||
|
||||
local string_output = "pre-potion: "
|
||||
|
||||
local string_output = "pre-potion raw: "
|
||||
for playername, potspellid in _pairs (pot_usage_test) do
|
||||
local name, _, icon = _GetSpellInfo (potspellid)
|
||||
local _, class = UnitClass (playername)
|
||||
local class_color = RAID_CLASS_COLORS [class].colorStr
|
||||
string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t "
|
||||
end
|
||||
_detalhes.debug_pots1 = string_output
|
||||
|
||||
local string_output = "pre-potion: "
|
||||
for playername, potspellid in _pairs (pot_usage) do
|
||||
local name, _, icon = _GetSpellInfo (potspellid)
|
||||
local _, class = UnitClass (playername)
|
||||
local class_color = RAID_CLASS_COLORS [class].colorStr
|
||||
string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t "
|
||||
end
|
||||
|
||||
_detalhes:Msg (string_output)
|
||||
_detalhes.debug_pots2 = string_output
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user