- Full rework on how deaths are handled, now the last events before death should be more precise.
- Added damage taken from environment, like falling, lava, drowning, etc. - Added Fire and Brimstone spell customizations for warlocks. - Bookmark now are shared between all characters. - Fixed few inconsistencies with trash recognition. - Fixed Cloud Capture where sometimes it wasn't sharing. - Fixed report where it wasn't sharing for guild and raid when the player name box were empty. - Report box now also saves the position and last report channel. - You Are Not Prepared plugin now have tooltips for spells and auto open after a boss encounter. - Advanced Death Logs plugin got full rewrite (and still are in development). - New API: _detalhes:GetFramework() return the framework object. - New API: combat:GetDifficult() return the raid difficult on the combat object. - New API: combat:GetBossInfo() return the boss info object. - New API: combat:GetDeaths() return the table used to store deaths. - New API: _detalhes:CreatePluginOptionsFrame (name, title, template), create a preset frame for options. - New API Alias: framework:CreateLabel (parent, text, size, color, font, member, name)
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
-- combat class object
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
local _
|
||||
|
||||
|
||||
--[[global]] DETAILS_TOTALS_ONLYGROUP = true
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -14,6 +15,7 @@
|
||||
local _bit_band = bit.band -- lua local
|
||||
local _date = date -- lua local
|
||||
local _table_remove = table.remove -- lua local
|
||||
local _rawget = rawget
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
@@ -53,7 +55,19 @@
|
||||
end
|
||||
|
||||
function combate:IsTrash()
|
||||
return self.is_trash
|
||||
return _rawget (self, "is_trash")
|
||||
end
|
||||
|
||||
function combate:GetDifficult()
|
||||
return self.is_boss and self.is_boss.diff
|
||||
end
|
||||
|
||||
function combate:GetBossInfo()
|
||||
return self.is_boss
|
||||
end
|
||||
|
||||
function combate:GetDeaths()
|
||||
return self.last_events_tables
|
||||
end
|
||||
|
||||
--return the name of the encounter or enemy
|
||||
@@ -62,7 +76,7 @@
|
||||
return self.is_pvp.name
|
||||
elseif (self.is_boss) then
|
||||
return self.is_boss.encounter
|
||||
elseif (self.is_tras) then
|
||||
elseif (_rawget (self, "is_trash")) then
|
||||
return Loc ["STRING_SEGMENT_TRASH"]
|
||||
else
|
||||
if (self.enemy) then
|
||||
@@ -149,9 +163,12 @@
|
||||
esta_tabela.data_fim = 0
|
||||
esta_tabela.data_inicio = 0
|
||||
|
||||
--> record last event before dead
|
||||
--> record deaths
|
||||
esta_tabela.last_events_tables = {}
|
||||
|
||||
--> last events from players
|
||||
esta_tabela.player_last_events = {}
|
||||
|
||||
--> players in the raid
|
||||
esta_tabela.raid_roster = {}
|
||||
|
||||
@@ -236,6 +253,14 @@
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> core
|
||||
|
||||
function combate:CreateLastEventsTable (player_name)
|
||||
--> sixteen indexes, thinking in 32 but it's just too much
|
||||
local t = { {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {} }
|
||||
t.n = 1
|
||||
self.player_last_events [player_name] = t
|
||||
return t
|
||||
end
|
||||
|
||||
--trava o tempo dos jogadores após o término do combate.
|
||||
function combate:TravarTempos()
|
||||
if (self [1]) then
|
||||
|
||||
@@ -201,6 +201,13 @@
|
||||
return table1 [4] > table2 [4]
|
||||
end
|
||||
|
||||
--[[exported]] function _detalhes.Sort4Reverse (table1, table2)
|
||||
if (not table2) then
|
||||
return true
|
||||
end
|
||||
return table1 [4] < table2 [4]
|
||||
end
|
||||
|
||||
--[[exported]] function _detalhes:GetBarColor (actor)
|
||||
actor = actor or self
|
||||
|
||||
@@ -266,8 +273,8 @@
|
||||
_setmetatable (_new_damageActor, atributo_damage)
|
||||
|
||||
if (link) then
|
||||
_new_damageActor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
_new_damageActor.last_events_table.original = true
|
||||
--_new_damageActor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
--_new_damageActor.last_events_table.original = true
|
||||
|
||||
_new_damageActor.targets.shadow = link.targets
|
||||
_new_damageActor.spell_tables.shadow = link.spell_tables
|
||||
@@ -3014,7 +3021,7 @@ end
|
||||
if (not actor) then
|
||||
actor = self
|
||||
end
|
||||
actor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
--actor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
end
|
||||
|
||||
--> restaura e liga o ator com a sua shadow durante a inicialização (startup function)
|
||||
|
||||
@@ -112,8 +112,8 @@ function atributo_heal:NovaTabela (serial, nome, link)
|
||||
_setmetatable (_new_healActor, atributo_heal)
|
||||
|
||||
if (link) then --> se não for a shadow
|
||||
_new_healActor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
_new_healActor.last_events_table.original = true
|
||||
--_new_healActor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
--_new_healActor.last_events_table.original = true
|
||||
|
||||
_new_healActor.targets.shadow = link.targets
|
||||
_new_healActor.spell_tables.shadow = link.spell_tables
|
||||
@@ -1981,7 +1981,7 @@ end
|
||||
if (not actor) then
|
||||
actor = self
|
||||
end
|
||||
actor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
--actor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
end
|
||||
|
||||
--> restaura e liga o ator com a sua shadow durante a inicialização
|
||||
|
||||
+45
-46
@@ -171,63 +171,65 @@ function _detalhes:ToolTipDead (instancia, morte, esta_barra, keydown)
|
||||
GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, _unpack (self.click_to_report_color))
|
||||
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625)
|
||||
GameCooltip:AddStatusBar (0, 1, 1, 1, 1, 1, false, {value = 100, color = {.3, .3, .3, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar_serenity]]})
|
||||
|
||||
for index, evento in _ipairs (eventos) do
|
||||
|
||||
local hp = _math_floor (evento[5]/hp_max*100)
|
||||
--death parser
|
||||
for index, event in _ipairs (eventos) do
|
||||
|
||||
local hp = _math_floor (event[5]/hp_max*100)
|
||||
if (hp > 100) then
|
||||
hp = 100
|
||||
end
|
||||
|
||||
if (evento [1]) then --> Dano
|
||||
--print ("DANO|"..evento [4]-hora_da_morte.."|"..evento [2].."|"..evento [3]) --> {true, spellid, amount, _tempo}
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (evento [2])
|
||||
|
||||
if (evento[3]) then
|
||||
local amt_golpes = evento[7]
|
||||
if (amt_golpes) then
|
||||
amt_golpes = "(x"..amt_golpes..") "
|
||||
else
|
||||
amt_golpes = ""
|
||||
end
|
||||
|
||||
if (type (evento [1]) ~= "boolean" and evento [1] == 2) then --> last cooldown
|
||||
lastcooldown = evento
|
||||
else
|
||||
--> [1] left text [2] right text [3] main 1 or sub 2 [...] color
|
||||
GameCooltip:AddLine ("".._cstr ("%.1f", evento[4] - hora_da_morte) .."s "..amt_golpes..nome_magia.." ("..evento[6]..")", "-".._detalhes:ToK (evento[3]).." (".. hp .."%)", 1, "white", "white")
|
||||
--> [1] icon [2] main 1 or sub 2 [3] left or right [4,5] width height [...] texcoord
|
||||
GameCooltip:AddIcon (icone_magia) --, 1, 1, nil, nil, 0.078125, 0.921875, 0.078125, 0.921875
|
||||
|
||||
--> [1] value [2] main 1 or sub 2 [...] color [4] glow
|
||||
if (type (evento [1]) ~= "boolean" and evento [1] == 1) then --> cooldown
|
||||
GameCooltip:AddStatusBar (100, 1, "yellow", true)
|
||||
else
|
||||
GameCooltip:AddStatusBar (hp, 1, "red", true)
|
||||
end
|
||||
end
|
||||
local evtype = event [1]
|
||||
local spellname, _, spellicon = _GetSpellInfo (event [2])
|
||||
local amount = event [3]
|
||||
local time = event [4]
|
||||
local source = event [6]
|
||||
|
||||
elseif (not battleress) then --> battle ress
|
||||
battleress = evento
|
||||
if (type (evtype) == "boolean") then
|
||||
--> is damage or heal
|
||||
if (evtype) then
|
||||
--> damage
|
||||
GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (spellicon)
|
||||
|
||||
if (event [9]) then
|
||||
--> friendly fire
|
||||
GameCooltip:AddStatusBar (hp, 1, "darkorange", true)
|
||||
else
|
||||
--> from a enemy
|
||||
GameCooltip:AddStatusBar (hp, 1, "red", true)
|
||||
end
|
||||
else
|
||||
--> heal
|
||||
GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (spellicon)
|
||||
GameCooltip:AddStatusBar (hp, 1, "green", true)
|
||||
|
||||
end
|
||||
|
||||
else --> Cura
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (evento [2])
|
||||
GameCooltip:AddLine ("".._cstr ("%.1f", evento[4] - hora_da_morte) .."s "..nome_magia.." ("..evento[6]..")", "+".._detalhes:ToK (evento[3]).." (".. hp .."%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (icone_magia) --, 1, 1, nil, nil, 0.0625, 0.9375, 0.0625, 0.9375
|
||||
GameCooltip:AddStatusBar (hp, 1, "green", true)
|
||||
elseif (type (evtype) == "number") then
|
||||
if (evtype == 1) then
|
||||
--> cooldown
|
||||
GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "cooldown (" .. hp .. "%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (spellicon)
|
||||
GameCooltip:AddStatusBar (100, 1, "yellow", true)
|
||||
|
||||
elseif (evtype == 2 and not battleress) then
|
||||
--> battle ress
|
||||
battleress = event
|
||||
|
||||
elseif (evtype == 3) then
|
||||
--> last cooldown used
|
||||
lastcooldown = event
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--_table_insert (linhas, 2, {{"Interface\\AddOns\\Details\\images\\small_icons", .75, 1, 0, 1}, morte [6] .. " Morreu", "-- -- -- ", 100, {75/255, 75/255, 75/255, 1}, {noglow = true}}) --> localize-me
|
||||
GameCooltip:AddLine (morte [6] .. " " .. Loc ["STRING_TIME_OF_DEATH"] , "-- -- -- ", 1, "white")
|
||||
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\small_icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
GameCooltip:AddStatusBar (0, 1, .5, .5, .5, .5, false, {value = 100, color = {.5, .5, .5, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_vidro]]})
|
||||
--GameCooltip:AddSpecial ("line", 2, nil, morte [6] .. " " .. Loc ["STRING_TIME_OF_DEATH"] , "-- -- -- ", 1, "white")
|
||||
--GameCooltip:AddSpecial ("icon", 2, nil, "Interface\\AddOns\\Details\\images\\small_icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
--GameCooltip:AddSpecial ("statusbar", 2, nil, 100, 1, "darkgray", false)
|
||||
|
||||
if (battleress) then
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (battleress [2])
|
||||
@@ -248,7 +250,6 @@ function _detalhes:ToolTipDead (instancia, morte, esta_barra, keydown)
|
||||
GameCooltip:AddStatusBar (0, 1, 1, 1, 1, 1, false, {value = 100, color = {.3, .3, .3, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar_serenity]]})
|
||||
end
|
||||
|
||||
--GameCooltip:AddLine (" ", " ", 1, "white", "white")
|
||||
|
||||
GameCooltip:SetOption ("StatusBarHeightMod", -6)
|
||||
GameCooltip:SetOption ("FixedWidth", 300)
|
||||
@@ -260,8 +261,6 @@ function _detalhes:ToolTipDead (instancia, morte, esta_barra, keydown)
|
||||
|
||||
GameCooltip:ShowCooltip()
|
||||
|
||||
--_detalhes.popup:ShowMe (esta_barra, "tooltip_bars", linhas, 300, 16, 9) --> [1] ancora [2] tipo do painel [3] texto/linhas [4] largura [5] tamanho do icone e altura da barra [6] tamanho da fonte
|
||||
|
||||
end
|
||||
|
||||
local function RefreshBarraMorte (morte, barra, instancia)
|
||||
@@ -313,7 +312,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia)
|
||||
tinsert (report_array, {elapsed .. " ", spelllink, " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. " (" .. hp .. "%) "})
|
||||
end
|
||||
|
||||
elseif (not evento [1]) then --> heal
|
||||
elseif (not evento [1] and type (evento [1]) == "boolean") then --> heal
|
||||
local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s"
|
||||
local spelllink = GetSpellLink (evento [2])
|
||||
local source = _detalhes:GetOnlyName (evento [6])
|
||||
|
||||
+13
-24
@@ -52,30 +52,12 @@
|
||||
|
||||
local ZoneName, InstanceType, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo()
|
||||
if (InstanceType == "party" or InstanceType == "raid") then
|
||||
_detalhes.tabela_vigente.is_trash = true
|
||||
return Loc ["STRING_SEGMENT_TRASH"]
|
||||
end
|
||||
|
||||
local trash_list
|
||||
if (_detalhes.in_group and _detalhes.last_instance) then
|
||||
trash_list = _detalhes:GetInstanceTrashInfo (_detalhes.last_instance)
|
||||
end
|
||||
|
||||
for _, actor in _ipairs (_detalhes.tabela_vigente[class_type_dano]._ActorTable) do
|
||||
|
||||
if (not actor.grupo and not actor.owner and not actor.nome:find ("[*]") and _bit_band (actor.flag_original, 0x00000060) ~= 0) then --> 0x20+0x40 neutral + enemy reaction
|
||||
|
||||
if (trash_list) then
|
||||
local serial = tonumber (actor.serial:sub(6, 10), 16)
|
||||
if (serial and trash_list [serial]) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) segment against trash mobs.")
|
||||
end
|
||||
_detalhes.tabela_vigente.is_trash = true
|
||||
return Loc ["STRING_SEGMENT_TRASH"]
|
||||
end
|
||||
end
|
||||
|
||||
for name, _ in _pairs (actor.targets._NameIndexTable) do
|
||||
if (name == _detalhes.playername) then
|
||||
return actor.nome
|
||||
@@ -113,6 +95,7 @@
|
||||
zone = zone,
|
||||
mapid = mapid,
|
||||
diff = diff,
|
||||
diff_string = select (4, GetInstanceInfo()),
|
||||
ej_instance_id = EJ_GetCurrentInstance(),
|
||||
}
|
||||
|
||||
@@ -421,13 +404,18 @@
|
||||
_detalhes.tabela_vigente:seta_tempo_decorrido() --> salva o end_time
|
||||
_detalhes.tabela_overall:seta_tempo_decorrido() --seta o end_time
|
||||
|
||||
--> drop last events table to garbage collector
|
||||
_detalhes.tabela_vigente.player_last_events = {}
|
||||
|
||||
--> flag instance type
|
||||
local _, InstanceType = _GetInstanceInfo()
|
||||
_detalhes.tabela_vigente.instance_type = InstanceType
|
||||
|
||||
if (not _detalhes.tabela_vigente.is_boss) then
|
||||
|
||||
local inimigo = _detalhes:FindEnemy()
|
||||
|
||||
if (InstanceType == "party" or InstanceType == "raid") then
|
||||
_detalhes.tabela_vigente.is_trash = true
|
||||
end
|
||||
|
||||
if (inimigo) then
|
||||
if (_detalhes.debug) then
|
||||
@@ -581,6 +569,7 @@
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.pre_pot_used = nil
|
||||
_table_wipe (_detalhes.encounter_table)
|
||||
|
||||
_detalhes:SendEvent ("COMBAT_PLAYER_LEAVE", nil, _detalhes.tabela_vigente)
|
||||
@@ -786,9 +775,9 @@
|
||||
--_detalhes:ScheduleTimer ("EqualizePets", 1+math.random())
|
||||
|
||||
--> do not equilize if there is any disabled capture
|
||||
if (_detalhes:CaptureIsAllEnabled()) then
|
||||
--if (_detalhes:CaptureIsAllEnabled()) then
|
||||
_detalhes:ScheduleTimer ("EqualizeActors", 2+math.random()+math.random() , host_of)
|
||||
end
|
||||
--end
|
||||
end
|
||||
|
||||
function _detalhes:EqualizeActors (host_of)
|
||||
@@ -806,13 +795,13 @@
|
||||
end
|
||||
|
||||
if (damage) then
|
||||
damage = {damage.total, damage.damage_taken, damage.friendlyfire_total}
|
||||
damage = {damage.total or 0, damage.damage_taken or 0, damage.friendlyfire_total or 0}
|
||||
else
|
||||
damage = {0, 0, 0}
|
||||
end
|
||||
|
||||
if (heal) then
|
||||
heal = {heal.total, heal.totalover, heal.healing_taken}
|
||||
heal = {heal.total or 0, heal.totalover or 0, heal.healing_taken or 0}
|
||||
else
|
||||
heal = {0, 0, 0}
|
||||
end
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
|
||||
if (_detalhes.schedule_chat_leave) then
|
||||
_detalhes:CancelTimer (_detalhes.schedule_chat_leave)
|
||||
_detalhes.schedule_chat_leave = nil
|
||||
end
|
||||
_detalhes.schedule_chat_enter = nil
|
||||
|
||||
@@ -451,6 +452,7 @@
|
||||
|
||||
if (_detalhes.schedule_chat_enter) then
|
||||
_detalhes:CancelTimer (_detalhes.schedule_chat_enter)
|
||||
_detalhes.schedule_chat_enter = nil
|
||||
end
|
||||
_detalhes.schedule_chat_leave = nil
|
||||
|
||||
|
||||
+152
-95
@@ -79,6 +79,8 @@
|
||||
local raid_members_cache = setmetatable ({}, _detalhes.weaktable)
|
||||
--> tanks
|
||||
local tanks_members_cache = setmetatable ({}, _detalhes.weaktable)
|
||||
--> damage and heal last events
|
||||
local last_events_cache = {} --> placeholder
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
@@ -92,13 +94,19 @@
|
||||
local AFFILIATION_GROUP = 0x00000007
|
||||
local REACTION_FRIENDLY = 0x00000010
|
||||
|
||||
--> recording data options shortcuts
|
||||
local ENVIRONMENTAL_FALLING_NAME = Loc ["STRING_ENVIRONMENTAL_FALLING"]
|
||||
local ENVIRONMENTAL_DROWNING_NAME = Loc ["STRING_ENVIRONMENTAL_DROWNING"]
|
||||
local ENVIRONMENTAL_FATIGUE_NAME = Loc ["STRING_ENVIRONMENTAL_FATIGUE"]
|
||||
local ENVIRONMENTAL_FIRE_NAME = Loc ["STRING_ENVIRONMENTAL_FIRE"]
|
||||
local ENVIRONMENTAL_LAVA_NAME = Loc ["STRING_ENVIRONMENTAL_LAVA"]
|
||||
local ENVIRONMENTAL_SLIME_NAME = Loc ["STRING_ENVIRONMENTAL_SLIME"]
|
||||
|
||||
--> recording data options flags
|
||||
local _recording_self_buffs = false
|
||||
local _recording_ability_with_buffs = false
|
||||
--local _recording_took_damage = false
|
||||
local _recording_healing = false
|
||||
local _recording_buffs_and_debuffs = false
|
||||
--> in combat shortcut
|
||||
--> in combat flag
|
||||
local _in_combat = false
|
||||
--> hooks
|
||||
local _hook_cooldowns = false
|
||||
@@ -235,29 +243,31 @@
|
||||
elseif (jogador_alvo.grupo) then
|
||||
|
||||
--> record death log
|
||||
local t = jogador_alvo.last_events_table
|
||||
local t = last_events_cache [alvo_name]
|
||||
|
||||
if (not t) then
|
||||
jogador_alvo.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
t = jogador_alvo.last_events_table
|
||||
t = _current_combat:CreateLastEventsTable (alvo_name)
|
||||
end
|
||||
|
||||
local i = t.n
|
||||
|
||||
t.n = i + 1
|
||||
|
||||
t = t [i]
|
||||
local this_event = t [i]
|
||||
|
||||
t [1] = true --> true if this is a damage || false for healing
|
||||
t [2] = spellid --> spellid || false if this is a battle ress line
|
||||
t [3] = amount --> amount of damage or healing
|
||||
t [4] = time --> parser time
|
||||
t [5] = _UnitHealth (alvo_name) --> current unit heal
|
||||
t [6] = who_name --> source name
|
||||
this_event [1] = true --> true if this is a damage || false for healing
|
||||
this_event [2] = spellid --> spellid || false if this is a battle ress line
|
||||
this_event [3] = amount --> amount of damage or healing
|
||||
this_event [4] = time --> parser time
|
||||
this_event [5] = _UnitHealth (alvo_name) --> current unit heal
|
||||
this_event [6] = who_name --> source name
|
||||
this_event [7] = absorbed
|
||||
this_event [8] = school
|
||||
|
||||
i = i + 1
|
||||
if (i == 9) then
|
||||
jogador_alvo.last_events_table.n = 1
|
||||
|
||||
if (i == 17) then
|
||||
t.n = 1
|
||||
else
|
||||
t.n = i
|
||||
end
|
||||
|
||||
--> record avoidance only for player actors
|
||||
@@ -353,28 +363,31 @@
|
||||
if (raid_members_cache [who_serial] and raid_members_cache [alvo_serial]) then
|
||||
|
||||
--> record death log
|
||||
local t = jogador_alvo.last_events_table
|
||||
local t = last_events_cache [alvo_name]
|
||||
|
||||
if (not t) then
|
||||
jogador_alvo.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
t = jogador_alvo.last_events_table
|
||||
t = _current_combat:CreateLastEventsTable (alvo_name)
|
||||
end
|
||||
|
||||
local i = t.n
|
||||
|
||||
t.n = i + 1
|
||||
|
||||
t = t [i]
|
||||
|
||||
t [1] = true --> true if this is a damage || false for healing
|
||||
t [2] = spellid --> spellid || false if this is a battle ress line
|
||||
t [3] = amount --> amount of damage or healing
|
||||
t [4] = time --> parser time
|
||||
t [5] = _UnitHealth (alvo_name) --> current unit heal
|
||||
t [6] = who_name --> source name
|
||||
local this_event = t [i]
|
||||
|
||||
this_event [1] = true --> true if this is a damage || false for healing
|
||||
this_event [2] = spellid --> spellid || false if this is a battle ress line
|
||||
this_event [3] = amount --> amount of damage or healing
|
||||
this_event [4] = time --> parser time
|
||||
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 [9] = true
|
||||
i = i + 1
|
||||
if (i == 9) then
|
||||
jogador_alvo.last_events_table.n = 1
|
||||
|
||||
if (i == 17) then
|
||||
t.n = 1
|
||||
else
|
||||
t.n = i
|
||||
end
|
||||
|
||||
--> faz a adução do friendly fire
|
||||
@@ -628,28 +641,33 @@
|
||||
|
||||
if (jogador_alvo.grupo) then
|
||||
|
||||
local t = jogador_alvo.last_events_table
|
||||
local t = last_events_cache [alvo_name]
|
||||
|
||||
if (not t) then
|
||||
jogador_alvo.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
t = jogador_alvo.last_events_table
|
||||
t = _current_combat:CreateLastEventsTable (alvo_name)
|
||||
end
|
||||
|
||||
local i = t.n
|
||||
t.n = i + 1
|
||||
|
||||
t = t [i]
|
||||
|
||||
t [1] = false --> true if this is a damage || false for healing
|
||||
t [2] = spellid --> spellid || false if this is a battle ress line
|
||||
t [3] = amount --> amount of damage or healing
|
||||
t [4] = time --> parser time
|
||||
t [5] = _UnitHealth (alvo_name) --> current unit heal
|
||||
t [6] = who_name --> source name
|
||||
local this_event = t [i]
|
||||
|
||||
this_event [1] = false --> true if this is a damage || false for healing
|
||||
this_event [2] = spellid --> spellid || false if this is a battle ress line
|
||||
this_event [3] = amount --> amount of damage or healing
|
||||
this_event [4] = time --> parser time
|
||||
this_event [5] = _UnitHealth (alvo_name) --> current unit heal
|
||||
this_event [6] = who_name --> source name
|
||||
this_event [7] = is_shield
|
||||
this_event [8] = absorbed
|
||||
|
||||
i = i + 1
|
||||
if (i == 9) then
|
||||
jogador_alvo.last_events_table.n = 1
|
||||
|
||||
if (i == 17) then
|
||||
t.n = 1
|
||||
else
|
||||
t.n = i
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
@@ -1490,28 +1508,28 @@
|
||||
end
|
||||
end
|
||||
|
||||
local t = damage_actor.last_events_table
|
||||
--> last events
|
||||
local t = last_events_cache [who_name]
|
||||
|
||||
if (not t) then
|
||||
damage_actor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
t = damage_actor.last_events_table
|
||||
t = _current_combat:CreateLastEventsTable (who_name)
|
||||
end
|
||||
|
||||
local i = t.n
|
||||
t.n = i + 1
|
||||
|
||||
t = t [i]
|
||||
local this_event = t [i]
|
||||
|
||||
t [1] = 1 --> true if this is a damage || false for healing || 1 for cooldown
|
||||
t [2] = spellid --> spellid || false if this is a battle ress line
|
||||
t [3] = 1 --> amount of damage or healing
|
||||
t [4] = time --> parser time
|
||||
t [5] = _UnitHealth (who_name) --> current unit heal
|
||||
t [6] = who_name --> source name
|
||||
this_event [1] = 1 --> true if this is a damage || false for healing || 1 for cooldown
|
||||
this_event [2] = spellid --> spellid || false if this is a battle ress line
|
||||
this_event [3] = 1 --> amount of damage or healing
|
||||
this_event [4] = time --> parser time
|
||||
this_event [5] = _UnitHealth (who_name) --> current unit heal
|
||||
this_event [6] = who_name --> source name
|
||||
|
||||
i = i + 1
|
||||
if (i == 9) then
|
||||
damage_actor.last_events_table.n = 1
|
||||
if (i == 17) then
|
||||
t.n = 1
|
||||
else
|
||||
t.n = i
|
||||
end
|
||||
|
||||
este_jogador.last_cooldown = {time, spellid}
|
||||
@@ -2008,7 +2026,14 @@
|
||||
end
|
||||
|
||||
if (not jaTem) then
|
||||
_table_insert (_current_combat.last_events_tables [i] [1], 1, {true, spellid, false, time, _UnitHealth (alvo_name), who_name })
|
||||
_table_insert (_current_combat.last_events_tables [i] [1], 1, {
|
||||
2,
|
||||
spellid,
|
||||
1,
|
||||
time,
|
||||
_UnitHealth (alvo_name),
|
||||
who_name
|
||||
})
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -2214,57 +2239,55 @@
|
||||
end
|
||||
|
||||
--> monta a estrutura da morte pegando a tabela de dano e a tabela de cura
|
||||
local dano = _current_combat[1]:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) --> container do dano
|
||||
local cura = _current_combat[2]:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) --> container da cura
|
||||
--> objeto da morte
|
||||
local esta_morte = {}
|
||||
|
||||
--> adiciona a tabela da morte apenas os DANOS recentes
|
||||
for index, tabela in _ipairs (dano.last_events_table) do
|
||||
if (tabela [4]) then
|
||||
if (tabela [4] + 12 > time) then --> mostra apenas eventos recentes
|
||||
esta_morte [#esta_morte+1] = tabela
|
||||
end
|
||||
end
|
||||
--> add events
|
||||
local t = last_events_cache [alvo_name]
|
||||
if (not t) then
|
||||
t = _current_combat:CreateLastEventsTable (alvo_name)
|
||||
end
|
||||
|
||||
--> adiciona a tabela da morte apenas as CURAS recentes
|
||||
if (cura.last_events_table) then
|
||||
for index, tabela in _ipairs (cura.last_events_table) do
|
||||
if (tabela [4]) then
|
||||
if (tabela [4] + 12 > time) then
|
||||
esta_morte [#esta_morte+1] = tabela
|
||||
end
|
||||
local last_index = t.n --or 'next index'
|
||||
if (last_index < 17 and not t[last_index][4]) then
|
||||
for i = 1, last_index-1 do
|
||||
if (t[i][4] and t[i][4]+16 > time) then
|
||||
_table_insert (esta_morte, t[i])
|
||||
end
|
||||
end
|
||||
else
|
||||
for i = last_index, 16 do --next index to 16
|
||||
if (t[i][4] and t[i][4]+16 > time) then
|
||||
_table_insert (esta_morte, t[i])
|
||||
end
|
||||
end
|
||||
for i = 1, last_index-1 do --1 to latest index
|
||||
if (t[i][4] and t[i][4]+16 > time) then
|
||||
_table_insert (esta_morte, t[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--parser:safe_sort_dead (esta_morte)
|
||||
_table_sort (esta_morte, _detalhes.Sort4)
|
||||
|
||||
if (_hook_deaths) then
|
||||
--> send event to registred functions
|
||||
local death_at = _tempo - _current_combat.start_time
|
||||
local max_health = _UnitHealthMax (alvo_name)
|
||||
|
||||
local new_death_table = {}
|
||||
for index, t in _ipairs (esta_morte) do
|
||||
new_death_table [index] = t
|
||||
end
|
||||
|
||||
for _, func in _ipairs (_hook_deaths_container) do
|
||||
local new_death_table = table_deepcopy (esta_morte)
|
||||
func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, new_death_table, este_jogador.last_cooldown, death_at, max_health)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (_detalhes.deadlog_limit and #esta_morte > _detalhes.deadlog_limit) then
|
||||
for i = #esta_morte, _detalhes.deadlog_limit+1, -1 do
|
||||
_table_remove (esta_morte, i)
|
||||
if (_detalhes.deadlog_limit and #esta_morte > _detalhes.deadlog_limit) then
|
||||
while (#esta_morte > _detalhes.deadlog_limit) do
|
||||
_table_remove (esta_morte, 1)
|
||||
end
|
||||
end
|
||||
|
||||
if (este_jogador.last_cooldown) then
|
||||
local t = {}
|
||||
t [1] = 2 --> true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown
|
||||
t [1] = 3 --> true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown
|
||||
t [2] = este_jogador.last_cooldown[2] --> spellid || false if this is a battle ress line
|
||||
t [3] = 1 --> amount of damage or healing
|
||||
t [4] = este_jogador.last_cooldown[1] --> parser time
|
||||
@@ -2273,7 +2296,7 @@
|
||||
esta_morte [#esta_morte+1] = t
|
||||
else
|
||||
local t = {}
|
||||
t [1] = 2 --> true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown
|
||||
t [1] = 3 --> true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown
|
||||
t [2] = 0 --> spellid || false if this is a battle ress line
|
||||
t [3] = 0 --> amount of damage or healing
|
||||
t [4] = 0 --> parser time
|
||||
@@ -2285,13 +2308,14 @@
|
||||
local decorrido = _tempo - _current_combat.start_time
|
||||
local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60)
|
||||
|
||||
local t = {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true}
|
||||
local t = {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true, ["last_cooldown"] = este_jogador.last_cooldown, ["dead_at"] = decorrido}
|
||||
|
||||
_table_insert (_current_combat.last_events_tables, #_current_combat.last_events_tables+1, t)
|
||||
|
||||
--> reseta a pool
|
||||
dano.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
cura.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
last_events_cache [alvo_name] = nil
|
||||
--dano.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
--cura.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
|
||||
end
|
||||
end
|
||||
@@ -2344,10 +2368,38 @@
|
||||
death_table = t
|
||||
local status, error = xpcall (do_death_sort, sort_error)
|
||||
if (not status) then
|
||||
_table_sort (t, _detalhes.Sort4)
|
||||
--_detalhes:Msg ("(debug) xpcall return false, sort got error.")
|
||||
_table_sort (t, _detalhes.Sort4Reverse)
|
||||
end
|
||||
end
|
||||
|
||||
function parser:environment (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, env_type, amount)
|
||||
|
||||
local spelid
|
||||
|
||||
if (env_type == "Falling") then
|
||||
who_name = ENVIRONMENTAL_FALLING_NAME
|
||||
spelid = 3
|
||||
elseif (env_type == "Drowning") then
|
||||
who_name = ENVIRONMENTAL_DROWNING_NAME
|
||||
spelid = 4
|
||||
elseif (env_type == "Fatigue") then
|
||||
who_name = ENVIRONMENTAL_FATIGUE_NAME
|
||||
spelid = 5
|
||||
elseif (env_type == "Fire") then
|
||||
who_name = ENVIRONMENTAL_FIRE_NAME
|
||||
spelid = 6
|
||||
elseif (env_type == "Lava") then
|
||||
who_name = ENVIRONMENTAL_LAVA_NAME
|
||||
spelid = 7
|
||||
elseif (env_type == "Slime") then
|
||||
who_name = ENVIRONMENTAL_SLIME_NAME
|
||||
spelid = 8
|
||||
end
|
||||
|
||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spelid or 1, env_type, 00000003, amount) --> localize-me
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> core
|
||||
|
||||
@@ -2428,6 +2480,7 @@
|
||||
token_list ["RANGE_MISSED"] = nil
|
||||
token_list ["SWING_MISSED"] = nil
|
||||
token_list ["SPELL_MISSED"] = nil
|
||||
token_list ["ENVIRONMENTAL_DAMAGE"] = nil
|
||||
|
||||
elseif (capture_type == "heal") then
|
||||
token_list ["SPELL_HEAL"] = nil
|
||||
@@ -2490,6 +2543,7 @@
|
||||
token_list ["RANGE_MISSED"] = parser.rangemissed
|
||||
token_list ["SWING_MISSED"] = parser.swingmissed
|
||||
token_list ["SPELL_MISSED"] = parser.missed
|
||||
token_list ["ENVIRONMENTAL_DAMAGE"] = parser.environment
|
||||
|
||||
elseif (capture_type == "heal") then
|
||||
token_list ["SPELL_HEAL"] = parser.heal
|
||||
@@ -3085,6 +3139,9 @@
|
||||
|
||||
--> refresh combat tables
|
||||
_current_combat = _detalhes.tabela_vigente
|
||||
|
||||
--> last events pointer
|
||||
last_events_cache = _current_combat.player_last_events
|
||||
|
||||
--> refresh total containers
|
||||
_current_total = _current_combat.totals
|
||||
|
||||
+53
-2
@@ -30,8 +30,8 @@
|
||||
else
|
||||
if (current [key] == nil) then
|
||||
current [key] = value
|
||||
elseif (type (current [key]) ~= type (value)) then
|
||||
current [key] = value
|
||||
--elseif (type (current [key]) ~= type (value)) then
|
||||
-- current [key] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -224,3 +224,54 @@
|
||||
|
||||
return NewPlugin
|
||||
end
|
||||
|
||||
function _detalhes:CreatePluginOptionsFrame (name, title, template)
|
||||
|
||||
template = template or 1
|
||||
|
||||
if (template == 1) then
|
||||
local options_frame = CreateFrame ("frame", name, UIParent)
|
||||
tinsert (UISpecialFrames, name)
|
||||
options_frame:SetSize (500, 200)
|
||||
options_frame:SetFrameStrata ("DIALOG")
|
||||
options_frame:SetScript ("OnMouseDown", function(self, button)
|
||||
if (button == "RightButton") then
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
end
|
||||
return options_frame:Hide()
|
||||
elseif (button == "LeftButton" and not self.moving) then
|
||||
self.moving = true
|
||||
self:StartMoving()
|
||||
end
|
||||
end)
|
||||
options_frame:SetScript ("OnMouseUp", function(self)
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
end
|
||||
end)
|
||||
options_frame:SetMovable (true)
|
||||
options_frame:EnableMouse (true)
|
||||
options_frame:Hide()
|
||||
options_frame:SetPoint ("center", UIParent, "center")
|
||||
|
||||
options_frame:SetBackdrop ({bgFile = [[Interface\ACHIEVEMENTFRAME\UI-Achievement-Parchment-Horizontal]], tile = true, tileSize = 830,
|
||||
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 32,
|
||||
insets = {left = 5, right = 5, top = 5, bottom = 5}})
|
||||
options_frame:SetBackdropColor (0, 0, 0, .7)
|
||||
|
||||
local title = _detalhes.gump:NewLabel (options_frame, nil, "$parentTitle", nil, title, nil, 20, "yellow")
|
||||
title:SetPoint (12, -13)
|
||||
_detalhes:SetFontOutline (title, true)
|
||||
|
||||
local c = CreateFrame ("Button", nil, options_frame, "UIPanelCloseButton")
|
||||
c:SetWidth (32)
|
||||
c:SetHeight (32)
|
||||
c:SetPoint ("TOPRIGHT", options_frame, "TOPRIGHT", -3, -3)
|
||||
c:SetFrameLevel (options_frame:GetFrameLevel()+1)
|
||||
|
||||
return options_frame
|
||||
end
|
||||
end
|
||||
+13
-2
@@ -191,7 +191,7 @@
|
||||
end
|
||||
|
||||
--> unpack more than 1 table
|
||||
-- thanks http://www.dzone.com/snippets/lua-unpack-multiple-tables
|
||||
-- http://www.dzone.com/snippets/lua-unpack-multiple-tables
|
||||
function _detalhes:unpacks (...)
|
||||
local values = {}
|
||||
for i = 1, select ('#', ...) do
|
||||
@@ -202,11 +202,22 @@
|
||||
return unpack (values)
|
||||
end
|
||||
|
||||
--> trim thanks from http://lua-users.org/wiki/StringTrim
|
||||
--> trim http://lua-users.org/wiki/StringTrim
|
||||
function _detalhes:trim (s)
|
||||
local from = s:match"^%s*()"
|
||||
return from > #s and "" or s:match(".*%S", from)
|
||||
end
|
||||
|
||||
--> reverse numerical table
|
||||
function _detalhes:reverse_table (t)
|
||||
local new = {}
|
||||
local index = 1
|
||||
for i = #t, 1, -1 do
|
||||
new [index] = t[i]
|
||||
index = index + 1
|
||||
end
|
||||
return new
|
||||
end
|
||||
|
||||
-- lua base64 codec (c) 2006-2008 by Alex Kloss - http://www.it-rfc.de - licensed under the terms of the LGPL2 - http://lua-users.org/wiki/BaseSixtyFour
|
||||
do
|
||||
|
||||
@@ -208,6 +208,9 @@ local LabelMetaFunctions = {}
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> object constructor
|
||||
function gump:CreateLabel (parent, text, size, color, font, member, name)
|
||||
return gump:NewLabel (parent, nil, name, member, text, font, size, color)
|
||||
end
|
||||
|
||||
function gump:NewLabel (parent, container, name, member, text, font, size, color)
|
||||
|
||||
@@ -224,6 +227,8 @@ function gump:NewLabel (parent, container, name, member, text, font, size, color
|
||||
end
|
||||
|
||||
if (name:find ("$parent")) then
|
||||
local pname = parent:GetName()
|
||||
assert (pname, "label used $parent but parent has no name.")
|
||||
name = name:gsub ("$parent", parent:GetName())
|
||||
end
|
||||
|
||||
|
||||
@@ -408,47 +408,10 @@ local APIBarFunctions
|
||||
--> hooks
|
||||
function BarMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
if (hookType == "OnEnterHook") then
|
||||
self.OnEnterHook = func
|
||||
return true
|
||||
elseif (hookType == "OnLeaveHook") then
|
||||
self.OnLeaveHook = func
|
||||
return true
|
||||
elseif (hookType == "OnHideHook") then
|
||||
self.OnHideHook = func
|
||||
return true
|
||||
elseif (hookType == "OnShowHook") then
|
||||
self.OnShowHook = func
|
||||
return true
|
||||
elseif (hookType == "OnMouseDownHook") then
|
||||
self.OnMouseDownHook = func
|
||||
return true
|
||||
elseif (hookType == "OnMouseUpHook") then
|
||||
self.OnMouseUpHook = func
|
||||
return true
|
||||
end
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
if (hookType == "OnEnterHook") then
|
||||
self.OnEnterHook = nil
|
||||
return true
|
||||
elseif (hookType == "OnLeaveHook") then
|
||||
self.OnLeaveHook = nil
|
||||
return true
|
||||
elseif (hookType == "OnHideHook") then
|
||||
self.OnHideHook = nil
|
||||
return true
|
||||
elseif (hookType == "OnShowHook") then
|
||||
self.OnShowHook = nil
|
||||
return true
|
||||
elseif (hookType == "OnMouseDownHook") then
|
||||
self.OnMouseDownHook = nil
|
||||
return true
|
||||
elseif (hookType == "OnMouseUpHook") then
|
||||
self.OnMouseUpHook = nil
|
||||
return true
|
||||
end
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -715,7 +715,7 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
|
||||
|
||||
for i = 1, amount do
|
||||
|
||||
local row = gump:NewPanel (scrollframe, nil, "$parentRow_" .. i, nil, 1, size)
|
||||
local row = gump:NewPanel (parent, nil, "$parentRow_" .. i, nil, 1, size)
|
||||
row.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]]}
|
||||
row.color = {1, 1, 1, .2}
|
||||
row:SetPoint ("topleft", scrollframe, "topleft", 0, (i-1) * size * -1)
|
||||
|
||||
+7
-23
@@ -93,7 +93,7 @@ function _detalhes:LoadGlobalAndCharacterData()
|
||||
if (_detalhes_global and not _detalhes_global.profile_pool) then
|
||||
_detalhes_global.profile_pool = {}
|
||||
end
|
||||
|
||||
|
||||
for key, value in pairs (_detalhes.default_player_data) do
|
||||
|
||||
--> check if key exists
|
||||
@@ -109,7 +109,7 @@ function _detalhes:LoadGlobalAndCharacterData()
|
||||
if (type (value) == "table") then
|
||||
_detalhes [key] = table_deepcopy (_detalhes_database [key])
|
||||
else
|
||||
_detalhes [key] = value
|
||||
_detalhes [key] = _detalhes_database [key]
|
||||
end
|
||||
|
||||
end
|
||||
@@ -118,7 +118,7 @@ function _detalhes:LoadGlobalAndCharacterData()
|
||||
if (not _detalhes_global) then
|
||||
_detalhes_global = table_deepcopy (_detalhes.default_global_data)
|
||||
end
|
||||
|
||||
|
||||
for key, value in pairs (_detalhes.default_global_data) do
|
||||
|
||||
--> check if key exists
|
||||
@@ -145,9 +145,9 @@ function _detalhes:LoadGlobalAndCharacterData()
|
||||
if (type (value) == "table") then
|
||||
_detalhes [key] = table_deepcopy (_detalhes_global [key])
|
||||
else
|
||||
_detalhes [key] = value
|
||||
_detalhes [key] = _detalhes_global [key]
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--> end
|
||||
@@ -270,25 +270,9 @@ function _detalhes:LoadConfig()
|
||||
end
|
||||
end
|
||||
|
||||
--if (_detalhes_database.RaidTablesSaved) then
|
||||
|
||||
--for id, instance in ipairs (_detalhes.tabela_instancias) do
|
||||
-- if (instance.modo == _detalhes._detalhes_props["MODO_RAID"]) then
|
||||
-- _detalhes:AlteraModo (instance, _detalhes._detalhes_props["MODO_GROUP"])
|
||||
-- end
|
||||
--end
|
||||
|
||||
--if (_detalhes_database.RaidTablesSaved.Mode) then
|
||||
-- _detalhes.RaidTables.Mode = _detalhes_database.RaidTablesSaved.Mode
|
||||
-- _detalhes.RaidTables.LastSelected = _detalhes_database.RaidTablesSaved.LastSelected
|
||||
--else
|
||||
-- _detalhes.RaidTables.Mode = 1
|
||||
--end
|
||||
--end
|
||||
|
||||
--> switch tables
|
||||
_detalhes.switch.slots = _detalhes_database.switchSaved.slots
|
||||
_detalhes.switch.table = _detalhes_database.switchSaved.table
|
||||
_detalhes.switch.slots = _detalhes_global.switchSaved.slots
|
||||
_detalhes.switch.table = _detalhes_global.switchSaved.table
|
||||
|
||||
--> last boss
|
||||
_detalhes.last_encounter = _detalhes_database.last_encounter
|
||||
|
||||
@@ -632,8 +632,6 @@ local default_player_data = {
|
||||
--> plugins tables
|
||||
SoloTablesSaved = {},
|
||||
RaidTablesSaved = {},
|
||||
--> switch tables
|
||||
switchSaved = {slots = 6, table = {}},
|
||||
--> saved skins
|
||||
savedStyles = {},
|
||||
}
|
||||
@@ -649,6 +647,11 @@ local default_global_data = {
|
||||
savedCustomSpells = {},
|
||||
savedTimeCaptures = {},
|
||||
lastUpdateWarning = 0,
|
||||
report_where = "SAY",
|
||||
--> switch tables
|
||||
switchSaved = {slots = 6, table = {}},
|
||||
report_pos = {1, 1},
|
||||
--> tutorial
|
||||
tutorial = {
|
||||
logons = 0,
|
||||
unlock_button = 0,
|
||||
|
||||
+3
-272
@@ -1,269 +1,8 @@
|
||||
--[[this file save the data when player logout and load data and player login back again]]
|
||||
--[[this file save the data when player leave the game]]
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
|
||||
function _detalhes:SaveData()
|
||||
|
||||
if (_G._detalhes_saver) then
|
||||
return
|
||||
end
|
||||
|
||||
_detalhes:SaveDataOnLogout()
|
||||
end
|
||||
|
||||
function _detalhes:SaveDataOnLogout()
|
||||
if (true) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local force_reset = function()
|
||||
print ("Check Point: Force reset.")
|
||||
_detalhes.tabela_instancias = {}
|
||||
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
|
||||
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
|
||||
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
|
||||
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
|
||||
_detalhes_database = {}
|
||||
return
|
||||
end
|
||||
|
||||
function _detalhes:LoadData()
|
||||
|
||||
--[[
|
||||
if (true) then --> DEBUG, force empty data
|
||||
return force_reset()
|
||||
end --]]
|
||||
|
||||
local _detalhes_database = _G._detalhes_database
|
||||
|
||||
if (_detalhes_database) then
|
||||
|
||||
----------------------------------------------------------------------------------------
|
||||
--> fora dos profiles
|
||||
----------------------------------------------------------------------------------------
|
||||
|
||||
--> nicktag cache
|
||||
_detalhes.nick_tag_cache = _detalhes_database.nick_tag_cache or {}
|
||||
_detalhes:NickTagSetCache (_detalhes.nick_tag_cache)
|
||||
|
||||
--> plugin data
|
||||
_detalhes.plugin_database = _detalhes_database.plugin_database
|
||||
|
||||
--> character info
|
||||
_detalhes.character_data = _detalhes_database.character_data
|
||||
|
||||
--> build basic containers
|
||||
_detalhes.tabela_historico = _detalhes_database.tabela_historico or _detalhes.historico:NovoHistorico() -- segments
|
||||
_detalhes.tabela_overall = _detalhes.combate:NovaTabela() -- overall
|
||||
_detalhes.tabela_pets = _detalhes_database.tabela_pets or _detalhes.container_pets:NovoContainer() -- pets
|
||||
|
||||
--> version
|
||||
_detalhes.last_realversion = _detalhes_database.last_realversion or _detalhes.realversion --> core
|
||||
_detalhes.last_version = _detalhes_database.last_version or "v1.0.0" --> version
|
||||
|
||||
if (_detalhes.last_realversion < _detalhes.realversion) then
|
||||
--> details was been hard upgraded
|
||||
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
|
||||
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
|
||||
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
|
||||
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
|
||||
end
|
||||
|
||||
if (_detalhes.last_version ~= _detalhes.userversion) then
|
||||
_detalhes.is_version_first_run = true
|
||||
end
|
||||
|
||||
--> re-build all indexes and metatables
|
||||
_detalhes:RestauraMetaTables()
|
||||
|
||||
--> get last combat table
|
||||
local historico_UM = _detalhes.tabela_historico.tabelas[1]
|
||||
|
||||
if (historico_UM) then
|
||||
_detalhes.tabela_vigente = historico_UM --> significa que elas eram a mesma tabela, então aqui elas se tornam a mesma tabela
|
||||
else
|
||||
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
|
||||
end
|
||||
|
||||
_detalhes.combat_id = _detalhes_database.combat_id
|
||||
|
||||
----------------------------------------------------------------------------------------
|
||||
--> estão nos profiles
|
||||
----------------------------------------------------------------------------------------
|
||||
|
||||
--> minimap
|
||||
_detalhes.minimap = _detalhes_database.minimap
|
||||
--> PvP
|
||||
_detalhes.only_pvp_frags = _detalhes_database.only_pvp_frags
|
||||
|
||||
--> instances (windows)
|
||||
|
||||
_detalhes.tabela_instancias = _detalhes_database.tabela_instancias or {}
|
||||
_detalhes.class_icons_small = _detalhes_database.class_icons_small
|
||||
_detalhes.class_coords = _detalhes_database.class_coords
|
||||
_detalhes.class_colors = _detalhes_database.class_colors
|
||||
|
||||
if (_detalhes_database.SoloTables) then
|
||||
if (_detalhes_database.SoloTables.Mode) then
|
||||
_detalhes.SoloTables.Mode = _detalhes_database.SoloTables.Mode
|
||||
_detalhes.SoloTables.LastSelected = _detalhes_database.SoloTables.LastSelected
|
||||
else
|
||||
_detalhes.SoloTables.Mode = 1
|
||||
end
|
||||
end
|
||||
|
||||
if (_detalhes_database.RaidTables) then
|
||||
if (_detalhes_database.RaidTables.Mode) then
|
||||
_detalhes.RaidTables.Mode = _detalhes_database.RaidTables.Mode
|
||||
_detalhes.RaidTables.LastSelected = _detalhes_database.RaidTables.LastSelected
|
||||
else
|
||||
_detalhes.RaidTables.Mode = 1
|
||||
end
|
||||
end
|
||||
|
||||
--> load options data
|
||||
--window size
|
||||
_detalhes.max_window_size = _detalhes_database.max_window_size
|
||||
_detalhes.new_window_size = _detalhes_database.new_window_size
|
||||
_detalhes.window_clamp = _detalhes_database.window_clamp
|
||||
-- max segments
|
||||
_detalhes.segments_amount = _detalhes_database.segments_amount
|
||||
_detalhes.instances_amount = _detalhes_database.instances_amount
|
||||
_detalhes.clear_ungrouped = _detalhes_database.clear_ungrouped
|
||||
_detalhes.clear_graphic = _detalhes_database.clear_graphic
|
||||
--> text sizes
|
||||
_detalhes.font_sizes = _detalhes_database.font_sizes
|
||||
_detalhes.ps_abbreviation = _detalhes_database.ps_abbreviation
|
||||
-- row animation
|
||||
_detalhes.use_row_animations = _detalhes_database.use_row_animations
|
||||
_detalhes.animate_scroll = _detalhes_database.animate_scroll
|
||||
_detalhes.use_scroll = _detalhes_database.use_scroll
|
||||
-- death log
|
||||
_detalhes.deadlog_limit = _detalhes_database.deadlog_limit
|
||||
-- report
|
||||
_detalhes.report_lines = _detalhes_database.report_lines
|
||||
_detalhes.report_to_who = _detalhes_database.report_to_who
|
||||
-- colors
|
||||
_detalhes.default_bg_color = _detalhes_database.default_bg_color
|
||||
_detalhes.default_bg_alpha = _detalhes_database.default_bg_alpha
|
||||
-- fades
|
||||
_detalhes.row_fade_in = _detalhes_database.row_fade_in
|
||||
_detalhes.windows_fade_in = _detalhes_database.windows_fade_in
|
||||
_detalhes.row_fade_out = _detalhes_database.row_fade_out
|
||||
_detalhes.windows_fade_out = _detalhes_database.windows_fade_out
|
||||
-- modes
|
||||
_detalhes.solo = _detalhes_database.solo
|
||||
_detalhes.raid = _detalhes_database.tank
|
||||
-- switch
|
||||
if (_detalhes_database.switch) then
|
||||
_detalhes.switch.slots = _detalhes_database.switch.slots
|
||||
_detalhes.switch.table = _detalhes_database.switch.table
|
||||
end
|
||||
|
||||
--> buffs
|
||||
_detalhes.savedbuffs = _detalhes_database.savedbuffs
|
||||
_detalhes.Buffs:BuildTables()
|
||||
|
||||
--> customs
|
||||
_detalhes.custom = _detalhes_database.custom
|
||||
|
||||
--> need refresh for all containers
|
||||
for _, container in ipairs (_detalhes.tabela_overall) do
|
||||
container.need_refresh = true
|
||||
end
|
||||
for _, container in ipairs (_detalhes.tabela_vigente) do
|
||||
container.need_refresh = true
|
||||
end
|
||||
|
||||
_detalhes_database.tabela_vigente = nil
|
||||
_detalhes_database.tabela_historico = nil
|
||||
_detalhes_database.tabela_pets = nil
|
||||
|
||||
else
|
||||
_detalhes.tabela_instancias = {}
|
||||
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
|
||||
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
|
||||
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
|
||||
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
|
||||
_detalhes_database = {}
|
||||
end
|
||||
|
||||
-- capture
|
||||
_detalhes.capture_real = _detalhes_database and _detalhes_database.capture_real or {
|
||||
["damage"] = true,
|
||||
["heal"] = true,
|
||||
["energy"] = false,
|
||||
["miscdata"] = true,
|
||||
["aura"] = true,
|
||||
["spellcast"] = true,
|
||||
}
|
||||
|
||||
if (_detalhes.capture_real.spellcast == nil) then
|
||||
_detalhes.capture_real.spellcast = true
|
||||
end
|
||||
|
||||
_detalhes.capture_current = {}
|
||||
for captureType, captureValue in pairs (_detalhes.capture_real) do
|
||||
_detalhes.capture_current [captureType] = captureValue
|
||||
end
|
||||
|
||||
_detalhes.cloud_capture = _detalhes_database.cloud_capture
|
||||
_detalhes.minimum_combat_time = _detalhes_database.minimum_combat_time
|
||||
|
||||
-- On Account
|
||||
|
||||
local _detalhes_global = _G._detalhes_global
|
||||
|
||||
if (_detalhes_global) then
|
||||
--saved styles
|
||||
--vardump (_detalhes_global.savedStyles)
|
||||
|
||||
_detalhes.__profiiles = _detalhes_global.__profiiles
|
||||
|
||||
_detalhes.savedStyles = _detalhes_global.savedStyles or _detalhes.savedStyles
|
||||
_detalhes.standard_skin = _detalhes_global.standard_skin
|
||||
|
||||
if (not _detalhes_global.got_first_run) then
|
||||
_detalhes.is_first_run = true
|
||||
end
|
||||
--max segments
|
||||
_detalhes.segments_amount = _detalhes_global.segments_amount or _detalhes.segments_amount
|
||||
_detalhes.segments_amount_to_save = _detalhes_global.segments_amount_to_save or _detalhes.segments_amount_to_save
|
||||
_detalhes.segments_panic_mode = _detalhes_global.segments_panic_mode or _detalhes.segments_panic_mode
|
||||
-- row animation
|
||||
_detalhes.use_row_animations = _detalhes_global.use_row_animations or _detalhes.use_row_animations
|
||||
_detalhes.animate_scroll = _detalhes_global.animate_scroll or _detalhes.animate_scroll
|
||||
-- scrollbar
|
||||
_detalhes.use_scroll = _detalhes_global.use_scroll or _detalhes.use_scroll
|
||||
-- core
|
||||
_detalhes.clear_ungrouped = _detalhes_global.clear_ungrouped or _detalhes.clear_ungrouped
|
||||
_detalhes.update_speed = _detalhes_global.update_speed or _detalhes.update_speed
|
||||
_detalhes.time_type = _detalhes_global.time_type or _detalhes.time_type
|
||||
_detalhes.memory_threshold = _detalhes_global.memory_threshold
|
||||
_detalhes.memory_ram = _detalhes_global.memory_ram
|
||||
_detalhes.remove_realm_from_name = _detalhes_global.remove_realm_from_name
|
||||
_detalhes.trash_concatenate = _detalhes_global.trash_concatenate
|
||||
_detalhes.trash_auto_remove = _detalhes_global.trash_auto_remove
|
||||
|
||||
_detalhes.SpellOverwriteUser = _detalhes_global.SpellOverwriteUser or _detalhes.SpellOverwriteUser
|
||||
|
||||
--tutorial
|
||||
_detalhes.tutorial = _detalhes_global.tutorial
|
||||
|
||||
--profiles
|
||||
_detalhes.__profiiles = _detalhes_global.__profiiles
|
||||
|
||||
else
|
||||
_detalhes.is_first_run = true
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
function _detalhes:WipeConfig()
|
||||
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
|
||||
local b = CreateFrame ("button", "DetailsResetConfigButton", UIParent, "OptionsButtonTemplate")
|
||||
@@ -273,7 +12,6 @@ function _detalhes:WipeConfig()
|
||||
b:SetText (Loc ["STRING_SLASH_WIPECONFIG_CONFIRM"])
|
||||
b:SetScript ("OnClick", function() _detalhes.wipe_full_config = true; ReloadUI(); end)
|
||||
b:SetPoint ("center", UIParent, "center", 0, 0)
|
||||
|
||||
end
|
||||
|
||||
local is_exception = {
|
||||
@@ -324,18 +62,11 @@ function _detalhes:SaveConfig()
|
||||
end
|
||||
end
|
||||
|
||||
--if (_detalhes.RaidTables.Mode) then
|
||||
-- _detalhes_database.RaidTablesSaved = {}
|
||||
-- _detalhes_database.RaidTablesSaved.Mode = _detalhes.RaidTables.Mode
|
||||
-- if (_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode]) then
|
||||
-- _detalhes_database.RaidTablesSaved.LastSelected = _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].real_name
|
||||
-- end
|
||||
--end
|
||||
_detalhes_database.RaidTablesSaved = nil
|
||||
|
||||
--> salva switch tables
|
||||
_detalhes_database.switchSaved.slots = _detalhes.switch.slots
|
||||
_detalhes_database.switchSaved.table = _detalhes.switch.table
|
||||
_detalhes_global.switchSaved.slots = _detalhes.switch.slots
|
||||
_detalhes_global.switchSaved.table = _detalhes.switch.table
|
||||
|
||||
--> last boss
|
||||
_detalhes_database.last_encounter = _detalhes.last_encounter
|
||||
|
||||
@@ -58,6 +58,12 @@ do
|
||||
local default_user_spells = {
|
||||
[1] = {name = Loc ["STRING_MELEE"], icon = [[Interface\AddOns\Details\images\melee.tga]]},
|
||||
[2] = {name = Loc ["STRING_AUTOSHOT"], icon = [[Interface\AddOns\Details\images\autoshot.tga]]},
|
||||
[3] = {name = Loc ["STRING_ENVIRONMENTAL_FALLING"], icon = [[Interface\ICONS\Spell_Magic_FeatherFall]]},
|
||||
[4] = {name = Loc ["STRING_ENVIRONMENTAL_DROWNING"], icon = [[Interface\ICONS\Ability_Suffocate]]},
|
||||
[5] = {name = Loc ["STRING_ENVIRONMENTAL_FATIGUE"], icon = [[Interface\ICONS\Spell_Arcane_MindMastery]]},
|
||||
[6] = {name = Loc ["STRING_ENVIRONMENTAL_FIRE"], icon = [[Interface\ICONS\INV_SummerFest_FireSpirit]]},
|
||||
[7] = {name = Loc ["STRING_ENVIRONMENTAL_LAVA"], icon = [[Interface\ICONS\Ability_Rhyolith_Volcano]]},
|
||||
[8] = {name = Loc ["STRING_ENVIRONMENTAL_SLIME"], icon = [[Interface\ICONS\Ability_Creature_Poison_02]]},
|
||||
|
||||
[124464] = {name = GetSpellInfo (124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> shadow word: pain mastery proc (priest)
|
||||
[124465] = {name = GetSpellInfo (124465) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> vampiric touch mastery proc (priest)
|
||||
@@ -74,6 +80,10 @@ do
|
||||
[131079] = {name = GetSpellInfo (131079) .. " (Icy Veins)"}, --> frostbolt with icy veins glyph (mage)
|
||||
[131080] = {name = GetSpellInfo (131080) .. " (Icy Veins)"}, --> ice lance with icy veins glyph (mage)
|
||||
[131081] = {name = GetSpellInfo (131081) .. " (Icy Veins)"}, --> frostfire with icy veins glyph (mage)
|
||||
|
||||
[108686] = {name = GetSpellInfo (108686) .. " (" .. GetSpellInfo (108683) .. ")" }, --> immolate (brimstone)
|
||||
[108685] = {name = GetSpellInfo (108685) .. " (" .. GetSpellInfo (108683) .. ")" }, --> conflagrate (brimstone)
|
||||
[114654] = {name = GetSpellInfo (114654) .. " (" .. GetSpellInfo (108683) .. ")" }, --> incinetate (brimstone)
|
||||
}
|
||||
|
||||
function _detalhes:UserCustomSpellUpdate (index, name, icon)
|
||||
|
||||
+57
-21
@@ -185,6 +185,26 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals
|
||||
--> build report frame gump -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--> script
|
||||
local savepos = function (self)
|
||||
local xofs, yofs = self:GetCenter()
|
||||
local scale = self:GetEffectiveScale()
|
||||
local UIscale = UIParent:GetScale()
|
||||
xofs = xofs * scale - GetScreenWidth() * UIscale / 2
|
||||
yofs = yofs * scale - GetScreenHeight() * UIscale / 2
|
||||
local x = xofs / UIscale
|
||||
local y = yofs / UIscale
|
||||
_detalhes.report_pos [1] = x
|
||||
_detalhes.report_pos [2] = y
|
||||
end
|
||||
local restorepos = function (self)
|
||||
local x, y = _detalhes.report_pos [1], _detalhes.report_pos [2]
|
||||
local scale = self:GetEffectiveScale()
|
||||
local UIscale = UIParent:GetScale()
|
||||
x = x * UIscale / scale
|
||||
y = y * UIscale / scale
|
||||
self:ClearAllPoints()
|
||||
self:SetPoint ("center", UIParent, "center", x, y)
|
||||
end
|
||||
local function seta_scripts (este_gump)
|
||||
--> Janela
|
||||
este_gump:SetScript ("OnMouseDown",
|
||||
@@ -199,6 +219,7 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals
|
||||
function (self)
|
||||
if (self.isMoving) then
|
||||
self:StopMovingOrSizing()
|
||||
savepos (self)
|
||||
self.isMoving = false
|
||||
end
|
||||
end)
|
||||
@@ -207,16 +228,6 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals
|
||||
--> dropdown menus
|
||||
|
||||
local function cria_drop_down (este_gump)
|
||||
|
||||
--local selecionar = _CreateFrame ("Button", "Details_Report_DropDown", este_gump, "UIDropDownMenuTemplate")
|
||||
--este_gump.select = selecionar
|
||||
--selecionar:SetPoint ("topleft", este_gump, "topleft", 93, -53)
|
||||
|
||||
--local function OnClick (self)
|
||||
-- _UIDropDownMenu_SetSelectedID (selecionar, self:GetID())
|
||||
-- _detalhes.report_where = self.value
|
||||
--end
|
||||
|
||||
--[[
|
||||
Emote: 255 251 255
|
||||
Yell: 255 63 64
|
||||
@@ -325,9 +336,39 @@ local lista = {
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.report_where = "WHISPER"
|
||||
|
||||
|
||||
function select_output:CheckValid()
|
||||
|
||||
local last_selected = _detalhes.report_where
|
||||
local check_func
|
||||
for i, t in ipairs (lista) do
|
||||
if (t[2] == last_selected) then
|
||||
check_func = t[3]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (check_func) then
|
||||
local is_shown = check_func()
|
||||
if (is_shown) then
|
||||
select_output:Select (last_selected)
|
||||
else
|
||||
if (IsInRaid()) then
|
||||
select_output:Select ("RAID")
|
||||
elseif (IsInParty()) then
|
||||
select_output:Select ("PARTY")
|
||||
elseif (IsInGuild()) then
|
||||
select_output:Select ("GUILD")
|
||||
else
|
||||
select_output:Select ("SAY")
|
||||
end
|
||||
end
|
||||
else
|
||||
select_output:Select (last_selected)
|
||||
end
|
||||
end
|
||||
|
||||
select_output:CheckValid()
|
||||
end
|
||||
|
||||
--> slider
|
||||
@@ -526,26 +567,21 @@ local lista = {
|
||||
function gump:CriaJanelaReport()
|
||||
|
||||
local este_gump = _CreateFrame ("Frame", "DetailsReportWindow", _UIParent)
|
||||
este_gump:SetPoint ("CENTER", UIParent, "CENTER")
|
||||
este_gump:SetFrameStrata ("HIGH")
|
||||
|
||||
_tinsert (_UISpecialFrames, este_gump:GetName())
|
||||
|
||||
este_gump:SetScript ("OnHide", function (self)
|
||||
--[[ avoid taint problems
|
||||
if (not este_gump.hidden or este_gump.fading_in) then --> trick to fade an window closed by pressing escape
|
||||
este_gump:Show()
|
||||
gump:Fade (este_gump, "in")
|
||||
end
|
||||
--]]
|
||||
_detalhes.janela_report.ativa = false
|
||||
end)
|
||||
|
||||
este_gump:SetPoint ("CENTER", UIParent)
|
||||
|
||||
este_gump:SetWidth (320)
|
||||
este_gump:SetHeight (128)
|
||||
este_gump:EnableMouse (true)
|
||||
este_gump:SetResizable (false)
|
||||
este_gump:SetMovable (true)
|
||||
restorepos (este_gump)
|
||||
|
||||
_detalhes.janela_report = este_gump
|
||||
|
||||
|
||||
@@ -223,6 +223,13 @@ if not Loc then return end
|
||||
|
||||
--> Attributes
|
||||
|
||||
Loc ["STRING_ENVIRONMENTAL_FALLING"] = "Environment (falling)"
|
||||
Loc ["STRING_ENVIRONMENTAL_DROWNING"] = "Environment (Drowning)"
|
||||
Loc ["STRING_ENVIRONMENTAL_FATIGUE"] = "Environment (Fatigue)"
|
||||
Loc ["STRING_ENVIRONMENTAL_FIRE"] = "Environment (Fire)"
|
||||
Loc ["STRING_ENVIRONMENTAL_LAVA"] = "Environment (Lava)"
|
||||
Loc ["STRING_ENVIRONMENTAL_SLIME"] = "Environment (Slime)"
|
||||
|
||||
Loc ["STRING_ATTRIBUTE_DAMAGE"] = "Damage"
|
||||
Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"] = "Damage Done"
|
||||
Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"] = "DPS"
|
||||
|
||||
@@ -131,6 +131,12 @@ L["STRING_DODGE"] = "Desvio"
|
||||
L["STRING_DOT"] = " (DoT)"
|
||||
L["STRING_DPS"] = "Dps"
|
||||
L["STRING_EMPTY_SEGMENT"] = "Segmento vazio"
|
||||
L["STRING_ENVIRONMENTAL_DROWNING"] = "Ambiente (afogar)" -- Needs review
|
||||
L["STRING_ENVIRONMENTAL_FALLING"] = "Ambiente (queda)" -- Needs review
|
||||
L["STRING_ENVIRONMENTAL_FATIGUE"] = "Ambiente (fadiga)" -- Needs review
|
||||
L["STRING_ENVIRONMENTAL_FIRE"] = "Ambiente (fogo)" -- Needs review
|
||||
L["STRING_ENVIRONMENTAL_LAVA"] = "Ambiente (lava)" -- Needs review
|
||||
L["STRING_ENVIRONMENTAL_SLIME"] = "Ambiente (\195\161cido)" -- Needs review
|
||||
L["STRING_EQUILIZING"] = "Compartilhando dados" -- Needs review
|
||||
L["STRING_ERASE"] = "apagar"
|
||||
L["STRING_ERASE_DATA"] = "Zerar todos os dados"
|
||||
@@ -1216,3 +1222,5 @@ L["STRING_VOIDZONE_TOOLTIP"] = "Dano e tempo:"
|
||||
L["STRING_WAITPLUGIN"] = "esperando por\
|
||||
plugins"
|
||||
L["STRING_YES"] = "Sim"
|
||||
|
||||
|
||||
|
||||
@@ -520,48 +520,9 @@ local function CreatePluginFrames (data)
|
||||
end
|
||||
|
||||
local build_options_panel = function()
|
||||
local options_frame = CreateFrame ("frame", "ThreatMeterOptionsWindow", UIParent)
|
||||
tinsert (UISpecialFrames, "ThreatMeterOptionsWindow")
|
||||
options_frame:SetSize (500, 200)
|
||||
options_frame:SetFrameStrata ("DIALOG")
|
||||
options_frame:SetScript ("OnMouseDown", function(self, button)
|
||||
if (button == "RightButton") then
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
end
|
||||
return options_frame:Hide()
|
||||
elseif (button == "LeftButton" and not self.moving) then
|
||||
self.moving = true
|
||||
self:StartMoving()
|
||||
end
|
||||
end)
|
||||
options_frame:SetScript ("OnMouseUp", function(self)
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
end
|
||||
end)
|
||||
options_frame:SetMovable (true)
|
||||
options_frame:EnableMouse (true)
|
||||
options_frame:Hide()
|
||||
options_frame:SetPoint ("center", UIParent, "center")
|
||||
|
||||
options_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
|
||||
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 32,
|
||||
insets = {left = 5, right = 5, top = 5, bottom = 5}})
|
||||
options_frame:SetBackdropColor (.3, .3, .3, .3)
|
||||
|
||||
local title = ThreatMeter.gump:NewLabel (options_frame, nil, "$parentTitle", nil, "Tiny Threat Options", nil, 20, "yellow")
|
||||
title:SetPoint (12, -13)
|
||||
ThreatMeter:SetFontOutline (title, true)
|
||||
|
||||
local c = CreateFrame ("Button", nil, options_frame, "UIPanelCloseButton")
|
||||
c:SetWidth (32)
|
||||
c:SetHeight (32)
|
||||
c:SetPoint ("TOPRIGHT", options_frame, "TOPRIGHT", -3, -3)
|
||||
c:SetFrameLevel (options_frame:GetFrameLevel()+1)
|
||||
|
||||
|
||||
local options_frame = ThreatMeter:CreatePluginOptionsFrame ("ThreatMeterOptionsWindow", "Tiny Threat Options", 1)
|
||||
|
||||
local menu = {
|
||||
{
|
||||
type = "range",
|
||||
|
||||
@@ -1123,13 +1123,16 @@ local function CreatePluginFrames (data)
|
||||
local amt = 1
|
||||
local hp = _UnitHealthMax (_track_player_name)/3
|
||||
|
||||
for _, tabela in _ipairs (_track_player_object.last_events_table) do
|
||||
if (tabela[1]) then
|
||||
Vanguard:InsertDamage (tabela[3], amt, hp)
|
||||
if (amt == Vanguard.DamageLabels.Spots) then
|
||||
break
|
||||
local last_events_table = _combat_object.player_last_events [MyName]
|
||||
if (last_events_table) then
|
||||
for _, tabela in _ipairs (last_events_table) do
|
||||
if (tabela[1]) then
|
||||
Vanguard:InsertDamage (tabela[3], amt, hp)
|
||||
if (amt == Vanguard.DamageLabels.Spots) then
|
||||
break
|
||||
end
|
||||
amt = amt+1
|
||||
end
|
||||
amt = amt+1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
|
||||
YouAreNotPreparedFrame:SetScript ("OnMouseUp", function (self, button)
|
||||
if (button == "RightButton") then
|
||||
YouAreNotPrepared.db.rightclick_closed = true
|
||||
YouAreNotPreparedFrame:Hide()
|
||||
else
|
||||
if (YouAreNotPreparedFrame.isMoving) then
|
||||
@@ -107,9 +108,9 @@
|
||||
c:SetHeight (32)
|
||||
c:SetPoint ("TOPRIGHT", YouAreNotPreparedFrame, "TOPRIGHT", 1, -15)
|
||||
c:SetFrameLevel (YouAreNotPreparedFrame:GetFrameLevel()+1)
|
||||
|
||||
|
||||
--background image
|
||||
local b = DetailsFrameWork:NewImage (YouAreNotPreparedFrame, [[Interface\AddOns\Details_YouAreNotPrepared\background]], 512, 256, nil, nil, nil, "$parentBackground")
|
||||
local b = DetailsFrameWork:NewImage (YouAreNotPreparedFrame, [[Interface\AddOns\Details_YouAreNotPrepared\background]], 512, 256, "background", nil, nil, "$parentBackground")
|
||||
b:SetPoint ("topleft", YouAreNotPreparedFrame, "topleft")
|
||||
|
||||
--title
|
||||
@@ -118,6 +119,24 @@
|
||||
t:SetPoint ("top", YouAreNotPreparedFrame, "top", 20, -26)
|
||||
t:SetPoint ("center", YouAreNotPreparedFrame, "center", 0, 0)
|
||||
|
||||
local on_mouse_down = function (self, button)
|
||||
if (button == "RightButton" and not YouAreNotPreparedFrame.isMoving) then
|
||||
YouAreNotPrepared.db.rightclick_closed = true
|
||||
YouAreNotPreparedFrame:Hide()
|
||||
else
|
||||
if (not YouAreNotPreparedFrame.isMoving) then
|
||||
YouAreNotPreparedFrame:StartMoving()
|
||||
YouAreNotPreparedFrame.isMoving = true
|
||||
end
|
||||
end
|
||||
end
|
||||
local on_mouse_up = function (self, button)
|
||||
if (YouAreNotPreparedFrame.isMoving) then
|
||||
YouAreNotPreparedFrame:StopMovingOrSizing()
|
||||
YouAreNotPreparedFrame.isMoving = false
|
||||
end
|
||||
end
|
||||
|
||||
--bar container
|
||||
local container_bars = CreateFrame ("frame", "Details_YouAreNotPrepared_FauxScroll_Box", YouAreNotPreparedFrame)
|
||||
container_bars:SetPoint ("topleft", YouAreNotPreparedFrame, "topleft", 23, -80)
|
||||
@@ -127,22 +146,37 @@
|
||||
container_bars:SetBackdropColor (.1, .1, .1, .2)
|
||||
YouAreNotPrepared.container_bars = container_bars
|
||||
|
||||
container_bars:SetScript ("OnMouseDown", on_mouse_down)
|
||||
container_bars:SetScript ("OnMouseUp", on_mouse_up)
|
||||
|
||||
container_bars.bars = {}
|
||||
|
||||
local MouseUpCloseHook = function (_, button)
|
||||
local MouseDownCloseHook = function (_, button)
|
||||
if (button == "RightButton") then
|
||||
YouAreNotPrepared.db.rightclick_closed = true
|
||||
YouAreNotPreparedFrame:Hide()
|
||||
return true --> interrupt
|
||||
return true --> interrupt hook
|
||||
end
|
||||
end
|
||||
|
||||
local on_enter_bar = function (self)
|
||||
if (self.MyObject.spellid) then
|
||||
GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT")
|
||||
GameTooltip:SetSpellByID (self.MyObject.spellid)
|
||||
GameTooltip:Show()
|
||||
end
|
||||
end
|
||||
local on_leave_bar = function (self)
|
||||
GameTooltip:Hide()
|
||||
end
|
||||
|
||||
function container_bars:CreateChild()
|
||||
|
||||
local bar_number = #self.bars + 1
|
||||
|
||||
local bar = DetailsFrameWork:NewPanel (self, YouAreNotPreparedFrame, "$parentBar" .. bar_number, nil, 250, BAR_HEIGHT)
|
||||
bar:SetPoint ("topleft", self, "topleft", 1, bar_number*13*-1+9)
|
||||
bar:SetHook ("OnMouseUp", MouseUpCloseHook)
|
||||
bar:SetHook ("OnMouseDown", MouseDownCloseHook)
|
||||
bar.locked = false
|
||||
bar.backdrop = nil
|
||||
bar.hide = true
|
||||
@@ -154,6 +188,14 @@
|
||||
YouAreNotPrepared:SetFontFace (statusbar.textleft, "GameFontHighlightSmall")
|
||||
YouAreNotPrepared:SetFontFace (statusbar.textleft, "GameFontNormal")
|
||||
|
||||
statusbar:SetHook ("OnEnter", on_enter_bar)
|
||||
statusbar:SetHook ("OnLeave", on_leave_bar)
|
||||
statusbar:SetHook ("OnMouseDown", on_mouse_down)
|
||||
statusbar:SetHook ("OnMouseUp", on_mouse_up)
|
||||
|
||||
bar:SetHook ("OnMouseDown", on_mouse_down)
|
||||
bar:SetHook ("OnMouseUp", on_mouse_up)
|
||||
|
||||
container_bars.bars [bar_number] = bar
|
||||
|
||||
return bar
|
||||
@@ -161,6 +203,8 @@
|
||||
|
||||
function container_bars:UpdateChild (bar_number, data, time_of_death, max_health)
|
||||
|
||||
--> death parser
|
||||
|
||||
local spellname, _, icon = _GetSpellInfo (data[2])
|
||||
local bar = container_bars.bars [bar_number]
|
||||
|
||||
@@ -171,18 +215,22 @@
|
||||
hp = 100
|
||||
end
|
||||
|
||||
if (data[1]) then --> damage
|
||||
if (data[3] and type (data [1]) == "boolean") then --> is a real damage, not a battle ress and its not a last cooldown line
|
||||
bar.statusbar.textleft:SetText (string.format ("%.1f", data [4] - time_of_death) .. "s " .. spellname .. " (" .. data [6] .. ")")
|
||||
bar.statusbar.textright:SetText ("-" .. YouAreNotPrepared:ToK (data [3]) .. " (" .. hp .. "%)")
|
||||
bar.statusbar._icon:SetTexture (icon)
|
||||
if (data[1] and type (data [1]) == "boolean") then --> damage
|
||||
bar.statusbar.textleft:SetText (string.format ("%.1f", data [4] - time_of_death) .. "s " .. spellname .. " (" .. data [6] .. ")")
|
||||
bar.statusbar.textright:SetText ("-" .. YouAreNotPrepared:ToK (data [3]) .. " (" .. hp .. "%)")
|
||||
bar.statusbar._icon:SetTexture (icon)
|
||||
if (data [9]) then
|
||||
bar.statusbar.color = "darkorange"
|
||||
else
|
||||
bar.statusbar.color = "red"
|
||||
bar.statusbar.background:SetVertexColor (1, 0, 0, .2)
|
||||
bar.statusbar.textleft:SetWidth (250 - bar.statusbar.textright:GetStringWidth() - 20)
|
||||
bar.statusbar.value = hp
|
||||
return true
|
||||
end
|
||||
else
|
||||
bar.statusbar.background:SetVertexColor (1, 0, 0, .2)
|
||||
bar.statusbar.textleft:SetWidth (250 - bar.statusbar.textright:GetStringWidth() - 20)
|
||||
bar.statusbar.value = hp
|
||||
bar.statusbar.spellid = data[2]
|
||||
return true
|
||||
|
||||
elseif (not data[1] and type (data [1]) == "boolean") then --> healing
|
||||
bar.statusbar.textleft:SetText (string.format ("%.1f", data [4] - time_of_death) .. "s " .. spellname .. " (" .. data [6] .. ")")
|
||||
bar.statusbar.textright:SetText ("+" .. YouAreNotPrepared:ToK (data [3]) .. " (" .. hp .. "%)")
|
||||
bar.statusbar._icon:SetTexture (icon)
|
||||
@@ -190,7 +238,9 @@
|
||||
bar.statusbar.background:SetVertexColor (0, 1, 0, .2)
|
||||
bar.statusbar.textleft:SetWidth (250 - bar.statusbar.textright:GetStringWidth() - 20)
|
||||
bar.statusbar.value = hp
|
||||
bar.statusbar.spellid = data[2]
|
||||
return true
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -228,6 +278,25 @@
|
||||
scrollbar:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, BAR_HEIGHT, refresh_function) end)
|
||||
scrollbar:SetPoint ("topleft", YouAreNotPreparedFrame, "topleft", 23, -80)
|
||||
scrollbar:SetSize (250, 138)
|
||||
scrollbar:SetScript ("OnMouseDown", function (self, button)
|
||||
if (button == "RightButton" and not YouAreNotPreparedFrame.isMoving) then
|
||||
YouAreNotPrepared.db.rightclick_closed = true
|
||||
YouAreNotPreparedFrame:Hide()
|
||||
else
|
||||
if (not YouAreNotPreparedFrame.isMoving) then
|
||||
YouAreNotPreparedFrame:StartMoving()
|
||||
YouAreNotPreparedFrame.isMoving = true
|
||||
end
|
||||
end
|
||||
end)
|
||||
scrollbar:SetScript ("OnMouseUp", function (self, button)
|
||||
if (button == "LeftButton") then
|
||||
if (YouAreNotPreparedFrame.isMoving) then
|
||||
YouAreNotPreparedFrame:StopMovingOrSizing()
|
||||
YouAreNotPreparedFrame.isMoving = false
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
container_bars:EnableMouse (true)
|
||||
|
||||
@@ -350,6 +419,38 @@
|
||||
|
||||
_detalhes:InstanceAlert (Loc ["STRING_PLUGIN_ALERT"], {[[Interface\ICONS\Achievement_Boss_Illidan]], 14, 14, false, 0.8984375, 0.0546875, 0.0546875, 0.8984375}, YouAreNotPrepared.db.shown_time, {YouAreNotPrepared.ShowMeFromInstanceAlert})
|
||||
end
|
||||
|
||||
--auto open box
|
||||
local autoopen_checkbox = CreateFrame ("CheckButton", "YANP_AutoOpenCheckBox", YouAreNotPreparedFrame, "ChatConfigCheckButtonTemplate")
|
||||
autoopen_checkbox:SetPoint ("bottomleft", container_bars, "topleft", 45, -1)
|
||||
local text = _G ["YANP_AutoOpenCheckBoxText"]
|
||||
text:SetText ("Auto Open")
|
||||
autoopen_checkbox:SetFrameLevel (YouAreNotPreparedFrame:GetFrameLevel()+5)
|
||||
--YouAreNotPrepared:SetFontSize (text, 10)
|
||||
text:ClearAllPoints()
|
||||
text:SetPoint ("left", autoopen_checkbox, "right", -2, 1)
|
||||
--checkbox.tooltip = Loc ["STRING_REPORTFRAME_CURRENTINFO"]
|
||||
autoopen_checkbox:SetHitRectInsets (0, -60, 0, 0)
|
||||
autoopen_checkbox:SetScript ("PostClick", function(self)
|
||||
if (self:GetChecked()) then
|
||||
YouAreNotPrepared.db.auto_open = true
|
||||
else
|
||||
YouAreNotPrepared.db.auto_open = false
|
||||
end
|
||||
end)
|
||||
YouAreNotPrepared:SetFontColor (text, "greenyellow")
|
||||
|
||||
--> open options
|
||||
local options_button = CreateFrame ("button", nil, YouAreNotPreparedFrame)
|
||||
options_button:SetPoint ("left", text, "right", 2, 0)
|
||||
options_button:SetSize (18, 18)
|
||||
options_button:SetAlpha (0.8)
|
||||
options_button:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]])
|
||||
options_button:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]])
|
||||
options_button:SetPushedTexture ([[Interface\Buttons\UI-OptionsButton]])
|
||||
options_button:SetScript ("OnClick", YouAreNotPrepared.OpenOptionsPanel)
|
||||
local right_text = YouAreNotPrepared.gump:CreateLabel (YouAreNotPreparedFrame, "Options", nil, "greenyellow", "GameFontHighlight", "optionstext", "$parentOptionsText")
|
||||
right_text:SetPoint ("left", options_button, "right", 2, 0)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -385,6 +486,10 @@
|
||||
|
||||
if (alvo_name == YouAreNotPrepared.playername) then
|
||||
local combat = YouAreNotPrepared:GetCombat ("current")
|
||||
|
||||
--> store death
|
||||
local d = YouAreNotPrepared:reverse_table (death_table)
|
||||
death_table = d
|
||||
|
||||
if (combat.is_boss) then --> encounter or pvp
|
||||
YouAreNotPrepared.last_death_combat_id = YouAreNotPrepared.combat_id
|
||||
@@ -457,8 +562,9 @@
|
||||
|
||||
local default_settings = {
|
||||
shown_time = 30, --
|
||||
auto_open = false, --
|
||||
auto_open = true, --
|
||||
hide_on_combat = true, --
|
||||
rightclick_closed = false,
|
||||
deaths_table = {}
|
||||
}
|
||||
|
||||
@@ -470,6 +576,8 @@
|
||||
|
||||
YouAreNotPrepared.db = saveddata
|
||||
|
||||
YANP_AutoOpenCheckBox:SetChecked (saveddata.auto_open)
|
||||
|
||||
--> register needed events
|
||||
_G._detalhes:RegisterEvent (YouAreNotPrepared, "DETAILS_DATA_RESET")
|
||||
_G._detalhes:RegisterEvent (YouAreNotPrepared, "COMBAT_PLAYER_LEAVE")
|
||||
@@ -477,6 +585,14 @@
|
||||
--> register needed hooks
|
||||
_G._detalhes:InstallHook (DETAILS_HOOK_DEATH, YouAreNotPrepared.OnDeath)
|
||||
|
||||
--> create right click to close
|
||||
if (not YouAreNotPrepared.db.rightclick_closed) then
|
||||
local right_click = YouAreNotPrepared.gump:NewImage (YouAreNotPreparedFrame, [[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 16, 18, "overlay", {8/512, 70/512, 328/512, 409/512})
|
||||
right_click:SetPoint ("left", _G [YouAreNotPreparedFrame:GetName() .. "OptionsText"], "right", 2, 0)
|
||||
local right_text = YouAreNotPrepared.gump:CreateLabel (YouAreNotPreparedFrame, "Right Click to Close", nil, "greenyellow", "GameFontHighlight", "rightclicktext", "$parentRightClickText")
|
||||
right_text:SetPoint ("left", right_click, "right", 2, 0)
|
||||
end
|
||||
|
||||
--> install slash command
|
||||
SLASH_Details_YouAreNotPrepared1 = "/yanp"
|
||||
function SlashCmdList.Details_YouAreNotPrepared (msg, editbox)
|
||||
|
||||
+2
-2
@@ -62,7 +62,7 @@ function _G._detalhes:Start()
|
||||
--> start time machine
|
||||
self.timeMachine:Ligar()
|
||||
|
||||
--> update abbreviation shorcut
|
||||
--> update abbreviation shortcut
|
||||
|
||||
self.atributo_damage:UpdateSelectedToKFunction()
|
||||
self.atributo_heal:UpdateSelectedToKFunction()
|
||||
@@ -377,6 +377,6 @@ function _G._detalhes:Start()
|
||||
if (not _detalhes.schedule_chat_enter and not _detalhes.schedule_chat_leave) then
|
||||
_detalhes.schedule_chat_enter = _detalhes:ScheduleTimer ("EnterChatChannel", 30)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user