From 56eea9d3b1ae4aa611184954b07b11338e9cbba8 Mon Sep 17 00:00:00 2001 From: Tercio Date: Wed, 14 Aug 2013 23:34:30 -0300 Subject: [PATCH] - fixed issues with death log. - added upper images for CoolTip, parameter "top" for AddImage. - added GetBossPortrait (mapid, bossindex) - added new slash command "show" - switch menu now open with OnMouseDown instead MouseUp. - all menus on main window had the wait time down to 0.15s. - slight revamp on segment menu. - bugs fixed on TinyThreat. --- core/parser.lua | 91 ++++++--- framework/cooltip.lua | 37 +++- framework/cooltip.xml | 7 + functions/boss.lua | 5 + functions/slash.lua | 7 + functions/spells.lua | 5 +- gumps/janela_principal.lua | 176 +++++++++++------- locales/Details-enUS.lua | 11 +- locales/Details-ptBR.lua | 9 + .../ThroneOfThunder.lua | 19 +- .../Details_TinyThreat/Details_TinyThreat.lua | 97 +++++++--- 11 files changed, 344 insertions(+), 120 deletions(-) diff --git a/core/parser.lua b/core/parser.lua index fcf12f63..86768692 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -188,9 +188,25 @@ _overall_gtotal [1] = _overall_gtotal [1]+amount elseif (jogador_alvo.grupo) then + --> record death log - _table_insert (jogador_alvo.last_events_table, 1, {true, spellid, amount, time, _UnitHealth (alvo_name), who_name }) --: [1] true = damage, false = heal [2] spellid [3] amount - _table_remove (jogador_alvo.last_events_table, 20) --> max 20 spots + local t = jogador_alvo.last_events_table + 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 + + i = i + 1 + if (i == 9) then + jogador_alvo.last_events_table.n = 1 + end --> record avoidance only for player actors if (spellid < 3) then --> autoshot melee @@ -253,6 +269,11 @@ --> firendly fire if (_bit_band (who_flags, REACTION_FRIENDLY) ~= 0 and _bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0) then + + --> investigation about mind control and reaction switch done + --> details will do count mind control and reaction switch as normal damage. + --> reaction switch normally came as 0x548 flag on players and 0x1148 for pets. + este_jogador.friendlyfire_total = este_jogador.friendlyfire_total + amount shadow.friendlyfire_total = shadow.friendlyfire_total + amount @@ -270,11 +291,12 @@ if (not spell) then spell = amigo.spell_tables:PegaHabilidade (spellid, true, token) end - + return spell:AddFF (amount) --adiciona a classe da habilidade, a classe da habilidade se encarrega de adicionar aos alvos dela else _current_total [1] = _current_total [1]+amount _overall_total [1] = _overall_total [1]+amount + end ------------------------------------------------------------------------------------------------ @@ -478,8 +500,24 @@ end if (jogador_alvo.grupo) then - _table_insert (jogador_alvo.last_events_table, 1, {false, spellid, amount, time, _UnitHealth (alvo_name), who_name}) --: [1] true = damage, false = heal [2] spellid [3] amount - _table_remove (jogador_alvo.last_events_table, 20) --> limita a 20 spots + + local t = jogador_alvo.last_events_table + 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 + + i = i + 1 + if (i == 9) then + jogador_alvo.last_events_table.n = 1 + end end ------------------------------------------------------------------------------------------------ @@ -1396,7 +1434,7 @@ return spell:Add (alvo_serial, alvo_name, alvo_flags, who_name, token, extraSpellID, extraSpellName) end - --serach key: ~dead ~death + --serach key: ~dead ~death ~morte function parser:dead (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) --> not yet well cleaned, need more improvements @@ -1434,7 +1472,7 @@ _current_gtotal [4].dead = _current_gtotal [4].dead + 1 _overall_gtotal [4].dead = _overall_gtotal [4].dead + 1 - --> main actor + --> main actor no container de misc que irá armazenar a morte local este_jogador, meu_dono = misc_cache [alvo_name] if (not este_jogador) then --> pode ser um desconhecido ou um pet este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) @@ -1443,15 +1481,13 @@ end end - --> monta a estrutura da morte - 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 - local esta_morte = {} - + --[[ if (dano.last_events_table) then local novaTabela = {} local counter = 1 + + --> junta os danos iguais for i = 1, #dano.last_events_table, 1 do local este_dano = dano.last_events_table[i] @@ -1480,27 +1516,38 @@ counter = counter + 1 end + end + --]] - local amt = 0 - for index, tabela in _ipairs (dano.last_events_table) do + --> 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 + --print ("PARSER 3 dano", unpack (tabela)) + if (tabela [4]) then if (tabela [4] + 12 > time) then --> mostra apenas eventos recentes esta_morte [#esta_morte+1] = tabela - amt = amt + 1 end end end + --> adiciona a tabela da morte apenas as CURAS recentes if (cura.last_events_table) then - local amt = 0 for index, tabela in _ipairs (cura.last_events_table) do - if (tabela [4] + 12 > time) then --> mostra apenas eventos recentes - esta_morte [#esta_morte+1] = tabela - amt = amt + 1 + --print ("PARSER 3 cura", unpack (tabela)) + if (tabela [4]) then + if (tabela [4] + 12 > time) then + esta_morte [#esta_morte+1] = tabela + end end end end - _table_sort (esta_morte, function (a, b) return a[4] > b[4] end) + _table_sort (esta_morte, _detalhes.Sort4) if (_detalhes.deadlog_limit and #esta_morte > _detalhes.deadlog_limit) then for i = #esta_morte, _detalhes.deadlog_limit+1, -1 do @@ -1519,8 +1566,8 @@ _table_insert (_overall_combat.last_events_tables, #_current_combat.last_events_tables+1, t) --> reseta a pool - dano.last_events_table = {} - cura.last_events_table = {} + dano.last_events_table = _detalhes:CreateActorLastEventTable() + cura.last_events_table = _detalhes:CreateActorLastEventTable() end end diff --git a/framework/cooltip.lua b/framework/cooltip.lua index d8ca8f8f..7cc83325 100644 --- a/framework/cooltip.lua +++ b/framework/cooltip.lua @@ -45,6 +45,8 @@ function DetailsCreateCoolTip() CoolTip.LeftIconTableSub = {} CoolTip.RightIconTable = {} CoolTip.RightIconTableSub = {} + CoolTip.TopIcon = nil + CoolTip.TopIconTableSub = {} CoolTip.StatusBarTable = {} CoolTip.StatusBarTableSub = {} @@ -773,6 +775,17 @@ function DetailsCreateCoolTip() frame2:SetHeight ( (frame2.hHeight * CoolTip.IndexesSub [index]) + 12 + (-spacing)) + if (CoolTip.TopIconTableSub [index]) then + local upperImageTable = CoolTip.TopIconTableSub [index] + frame2.upperImage:SetTexture (upperImageTable [1]) + frame2.upperImage:SetWidth (upperImageTable [2]) + frame2.upperImage:SetHeight (upperImageTable [3]) + frame2.upperImage:SetTexCoord (upperImageTable[4], upperImageTable[5], upperImageTable[6], upperImageTable[7]) + frame2.upperImage:Show() + else + frame2.upperImage:Hide() + end + if (not CoolTip.OptionsTable.FixedWidthSub) then frame2:SetWidth (frame2.w + 44) end @@ -1256,6 +1269,11 @@ function DetailsCreateCoolTip() _table_wipe (CoolTip.RightIconTable) _table_wipe (CoolTip.RightIconTableSub) + CoolTip.TopIcon = nil + _table_wipe (CoolTip.TopIconTableSub) + frame1.upperImage:Hide() + frame2.upperImage:Hide() + _table_wipe (CoolTip.StatusBarTable) _table_wipe (CoolTip.StatusBarTableSub) @@ -1556,10 +1574,14 @@ function DetailsCreateCoolTip() local iconTable if (not frame or (type (frame) == "string" and frame == "main") or (type (frame) == "number" and frame == 1)) then + if (not side or (type (side) == "string" and side == "left") or (type (side) == "number" and side == 1)) then frameTable = CoolTip.LeftIconTable elseif ((type (side) == "string" and side == "right") or (type (side) == "number" and side == 2)) then frameTable = CoolTip.RightIconTable + elseif ((type (side) == "string" and side == "top") or (type (side) == "number" and side == 3)) then + CoolTip.TopIcon = iconTexture + return end if (CoolTip.isSpecial) then @@ -1580,6 +1602,16 @@ function DetailsCreateCoolTip() frameTable = CoolTip.LeftIconTableSub elseif ((type (side) == "string" and side == "right") or (type (side) == "number" and side == 2)) then frameTable = CoolTip.RightIconTableSub + elseif ((type (side) == "string" and side == "top") or (type (side) == "number" and side == 3)) then + CoolTip.TopIconTableSub [CoolTip.Indexes] = CoolTip.TopIconTableSub [CoolTip.Indexes] or {} + CoolTip.TopIconTableSub [CoolTip.Indexes] [1] = iconTexture + CoolTip.TopIconTableSub [CoolTip.Indexes] [2] = iconWidth or 16 + CoolTip.TopIconTableSub [CoolTip.Indexes] [3] = iconHeight or 16 + CoolTip.TopIconTableSub [CoolTip.Indexes] [4] = L or 0 + CoolTip.TopIconTableSub [CoolTip.Indexes] [5] = R or 1 + CoolTip.TopIconTableSub [CoolTip.Indexes] [6] = T or 0 + CoolTip.TopIconTableSub [CoolTip.Indexes] [7] = B or 1 + return end local subMenuContainerIcons = frameTable [CoolTip.Indexes] @@ -1927,9 +1959,11 @@ function DetailsCreateCoolTip() end end + local wait = 0.3 + local InjectOnUpdateEnter = function (self, elapsed) elapsedTime = elapsedTime+elapsed - if (elapsedTime > 0.3) then + if (elapsedTime > wait) then self:SetScript ("OnUpdate", nil) CoolTip:ExecFunc (self) end @@ -1970,6 +2004,7 @@ function DetailsCreateCoolTip() CoolTip:ExecFunc (self) else elapsedTime = 0 + wait = self.CoolTip.ShowSpeed or 0.3 self:SetScript ("OnUpdate", InjectOnUpdateEnter) end diff --git a/framework/cooltip.xml b/framework/cooltip.xml index a6791c24..1cda951a 100644 --- a/framework/cooltip.xml +++ b/framework/cooltip.xml @@ -53,6 +53,13 @@ + +