diff --git a/.pkgmeta b/.pkgmeta index b5c3db68..14196a30 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -1,8 +1,9 @@ move-folders: Details/plugins/Details_DmgRank: Details_DmgRank - Details/plugins/Details_EncounterDetails: Details_EncounterDetails Details/plugins/Details_ErrorReport: Details_ErrorReport + Details/plugins/Details_EncounterDetails: Details_EncounterDetails Details/plugins/Details_RaidInfo-ThroneOfThunder: Details_RaidInfo-ThroneOfThunder + Details/plugins/Details_RaidInfo-SiegeOfOrgrimmar: Details_RaidInfo-SiegeOfOrgrimmar Details/plugins/Details_SaveData: Details_SaveData Details/plugins/Details_SpellDetails: Details_SpellDetails Details/plugins/Details_TimeAttack: Details_TimeAttack diff --git a/Details.toc b/Details.toc index dd2f8eef..338af568 100644 --- a/Details.toc +++ b/Details.toc @@ -1,4 +1,4 @@ -## Interface: 50300 +## Interface: 50400 ## Title: Details ## Notes: Computes detailed infos about combats. ## SavedVariables: _detalhes_global @@ -54,6 +54,7 @@ gumps\janela_info.lua gumps\janela_report.lua gumps\janela_principal.lua gumps\janela_custom.lua +gumps\janela_welcome.lua gumps\fw_mods.lua gumps\switch.lua gumps\toolbar_button.xml diff --git a/Libs/NickTag-1.0/NickTag-1.0.lua b/Libs/NickTag-1.0/NickTag-1.0.lua index 24928645..e3f6c643 100644 --- a/Libs/NickTag-1.0/NickTag-1.0.lua +++ b/Libs/NickTag-1.0/NickTag-1.0.lua @@ -4,12 +4,21 @@ -- NickTag:SetNickname (name) -> set the player nick name, after set nicktag will broadcast the nick over addon guild channel. -- -local major, minor = "NickTag-1.0", 2 +local major, minor = "NickTag-1.0", 3 local NickTag, oldminor = LibStub:NewLibrary (major, minor) if (not NickTag) then return end + +--> fix for old nicktag version +if (_G.NickTag) then + if (_G.NickTag.OnEvent) then + _G.NickTag:UnregisterComm ("NickTag") + _G.NickTag.OnEvent = nil + end +end + ------------------------------------------------------------------------------------------------------------------------------------------------------ --> constants @@ -32,6 +41,13 @@ end _G.NickTag = NickTag --> nicktag object over global container local pool = {default = true} --> pointer to the cache pool and the default pool if no cache + local queue_request = {} + local queue_send = {} + local last_queue = 0 + local is_updating = false + NickTag.debug = false + + local GetGuildRosterInfo = GetGuildRosterInfo LibStub:GetLibrary ("AceComm-3.0"):Embed (NickTag) LibStub:GetLibrary ("AceSerializer-3.0"):Embed (NickTag) @@ -58,6 +74,10 @@ end return target end + function NickTag:Msg (text) + print ("|cFFFFFF00NickTag:|r",text) + end + local enUS = LibStub("AceLocale-3.0"):NewLocale ("NickTag-1.0", "enUS", true) if (enUS) then enUS ["STRING_ERROR_1"] = "Your nickname is too long, max of 12 characters is allowed." @@ -204,9 +224,17 @@ end --> 0x2: received a revision version from a guy which logon in the game elseif (_type == CONST_COMM_LOGONREVISION) then + if (UnitName ("player") == name) then + return + end + local receivedRevision = arg3 local storedPersona = NickTag:GetNicknameTable (serial) + if (NickTag.debug) then + NickTag:Msg ("LOGONREVISION from: " .. name .. " rev: " .. receivedRevision) + end + if (type (version) ~= "number" or version ~= minor) then return end @@ -216,7 +244,17 @@ end if (realm ~= GetRealmName()) then name = name .. "-" .. realm end - NickTag:ScheduleTimer ("RequestPersona", math.random (1, 20), name) + + --> put in queue our request for receive a updated persona + NickTag:ScheduleTimer ("QueueRequest", math.random (10, 60), name) + + if (NickTag.debug) then + NickTag:Msg ("LOGONREVISION from: " .. name .. " |cFFFF0000is out of date|r, queueing a request persona.") + end + else + if (NickTag.debug) then + NickTag:Msg ("LOGONREVISION from: " .. name .. " |cFF00FF00is up to date.") + end end --> 0x3: someone requested my persona, so i need to send to him @@ -230,15 +268,149 @@ end if (realm ~= GetRealmName()) then name = name .. "-" .. realm end - NickTag:SendPersona (name) + + --> queue to send our persona for requested person + if (NickTag.debug) then + NickTag:Msg ("REQUESTPERSONA from: " .. name .. ", the request has been placed in queue.") + end + + NickTag:QueueSend (name) end end NickTag:RegisterComm ("NickTag", "OnReceiveComm") + + function NickTag:UpdateRoster() + --> do not update roster if is in combat + if (not UnitAffectingCombat ("player")) then + GuildRoster() + end + end + + function NickTag:IsOnline (name) + + local isShownOffline = GetGuildRosterShowOffline() + if (isShownOffline) then + SetGuildRosterShowOffline (false) + end + + local _, numOnlineMembers = GetNumGuildMembers() + for i = 1, numOnlineMembers do + local player_name = GetGuildRosterInfo (i) + if (player_name == name) then + if (isShownOffline) then + SetGuildRosterShowOffline (true) + end + return true + end + end + if (isShownOffline) then + SetGuildRosterShowOffline (true) + end + return false + end + + local event_frame = CreateFrame ("frame", nil, UIParent) + event_frame:Hide() + event_frame:SetScript ("OnEvent", function (_, _, local_update) + if (not local_update) then + + --> roster was been updated + if (last_queue < time()) then + last_queue = time()+11 + else + return + end + + --> do not share if we are in combat + if (UnitAffectingCombat ("player")) then + return + end + + --> start with send requested personas + if (#queue_send > 0) then + + local name = queue_send [1] + table.remove (queue_send, 1) + + if (NickTag.debug) then + NickTag:Msg ("QUEUE -> ready to send persona to " .. name) + end + + --> check if the player is online + if (NickTag:IsOnline (name)) then + NickTag:SendPersona (name) + end + + if (#queue_send == 0 and #queue_request == 0) then + NickTag:StopRosterUpdates() + end + + elseif (#queue_request > 0) then + + local name = queue_request [1] + table.remove (queue_request, 1) + + if (NickTag.debug) then + NickTag:Msg ("QUEUE -> ready to request the persona of " .. name) + end + + --> check if the player is online + if (NickTag:IsOnline (name)) then + NickTag:RequestPersona (name) + end + + if (#queue_request == 0 and #queue_request == 0) then + NickTag:StopRosterUpdates() + end + + else + NickTag:StopRosterUpdates() + end + end + end) + + function NickTag:StopRosterUpdates() + if (NickTag.debug) then + NickTag:Msg ("ROSTER -> updates has been stopped") + end + if (NickTag.UpdateRosterTimer) then + NickTag:CancelTimer (NickTag.UpdateRosterTimer) + end + NickTag.UpdateRosterTimer = nil + event_frame:UnregisterEvent ("GUILD_ROSTER_UPDATE") + is_updating = false + end + + function NickTag:StartRosterUpdates() + if (NickTag.debug) then + NickTag:Msg ("ROSTER -> updates has been actived") + end + event_frame:RegisterEvent ("GUILD_ROSTER_UPDATE") + if (not NickTag.UpdateRosterTimer) then + NickTag.UpdateRosterTimer = NickTag:ScheduleRepeatingTimer ("UpdateRoster", 12) + end + is_updating = true + end + + --> we queue data for roster update and also check for combat + function NickTag:QueueRequest (name) + table.insert (queue_request, name) + if (not is_updating) then + NickTag:StartRosterUpdates() + end + end + function NickTag:QueueSend (name) + table.insert (queue_send, name) + if (not is_updating) then + NickTag:StartRosterUpdates() + end + end --> after logon, we send our revision, who needs update my persona will send 0x3 (request persona) to me and i send back 0x1 (send persona) function NickTag:SendRevision() + local battlegroup_serial = NickTag:GetSerial() if (not battlegroup_serial) then return @@ -246,17 +418,28 @@ end local myPersona = NickTag:GetNicknameTable (battlegroup_serial) if (myPersona) then + if (NickTag.debug) then + NickTag:Msg ("SendRevision() -> SENT") + end NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_LOGONREVISION, battlegroup_serial, myPersona [CONST_INDEX_REVISION], UnitName ("player"), GetRealmName(), minor), "GUILD") end end --> i received 0x2 and his persona is out of date here, so i need to send 0x3 to him and him will send 0x1. function NickTag:RequestPersona (target) + if (NickTag.debug) then + NickTag:Msg ("RequestPersona() -> requesting of " .. target) + end NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_REQUESTPERSONA, 0, 0, UnitName ("player"), GetRealmName(), minor), "WHISPER", target) end --> this broadcast my persona to entire guild when i update my persona or send my persona to someone who doesn't have it or need to update. function NickTag:SendPersona (target) + if (target) then + if (NickTag.debug) then + NickTag:Msg ("SendPersona() -> sent to " .. target) + end + end local battlegroup_serial = NickTag:GetSerial() if (not battlegroup_serial) then return diff --git a/boot.lua b/boot.lua index 8decbffe..9c53bd8a 100644 --- a/boot.lua +++ b/boot.lua @@ -6,20 +6,11 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - --> fix for old nicktag version - if (_G.NickTag) then - if (_G.NickTag.OnEvent) then - _G.NickTag:UnregisterComm ("NickTag") - end - end - _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.userversion = "v1.3.1" - _detalhes.version = "Alpha 005" - _detalhes.realversion = 5 + _detalhes.userversion = "v1.4.0" + _detalhes.version = "Alpha 006" + _detalhes.realversion = 6 - --_detalhes:NickTagSetCache (_detalhes.NickTagCache) - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> initialization stuff diff --git a/classes/classe_combate.lua b/classes/classe_combate.lua index e5c4db77..0e648eff 100644 --- a/classes/classe_combate.lua +++ b/classes/classe_combate.lua @@ -79,13 +79,13 @@ function combate:NovaTabela (iniciada, _tabela_overall, combatId, ...) --> start/end time (duration) esta_tabela.data_fim = 0 esta_tabela.data_inicio = 0 - --esta_tabela.last_event = 0 --> record last event before dead esta_tabela.last_events_tables = {} - --> record damage data - --esta_tabela.DpsGraphic = {max = 0} + --> frags + esta_tabela.frags = {} + esta_tabela.frags_need_refresh = false --> time data container esta_tabela.TimeData = _detalhes.timeContainer:CreateTimeTable() @@ -168,18 +168,29 @@ end function combate:TravarTempos() --é necessário travar o tempo em todos os atributos do combate. - for index, container in _ipairs (self) do -- aqui ele lista os tipos de atributo listado na lista acima - if (index < 3) then --> 3 é e_energy, não possui tempo // 4 é misc tbm não possui tempo - for _, jogador in _ipairs (container._ActorTable) do - if (jogador:Iniciar()) then -- retorna se ele esta com o dps ativo - jogador:TerminarTempo() - jogador:Iniciar (false) --trava o dps do jogador - --jogador.last_events_table = _detalhes:CreateActorLastEventTable() - end + + if (self [1]) then + for _, jogador in _ipairs (self [1]._ActorTable) do --> damage + if (jogador:Iniciar()) then -- retorna se ele esta com o dps ativo + jogador:TerminarTempo() + jogador:Iniciar (false) --trava o dps do jogador + --jogador.last_events_table = _detalhes:CreateActorLastEventTable() end - else - break end + else + --print ("combat [1] doesn't exist.") + end + if (self [2]) then + for _, jogador in _ipairs (self [2]._ActorTable) do --> healing + if (jogador:Iniciar()) then -- retorna se ele esta com o dps ativo + jogador:TerminarTempo() + jogador:Iniciar (false) --trava o dps do jogador + --print ("travando o tempo de",jogador.nome, jogador.end_time) + --jogador.last_events_table = _detalhes:CreateActorLastEventTable() + end + end + else + --print ("combat [2] doesn't exist.") end end @@ -458,7 +469,6 @@ combate.__sub = function (overall, combate) overall.totals[4].dead = overall.totals[4].dead - combate.totals[4].dead overall.totals[4].cooldowns_defensive = overall.totals[4].cooldowns_defensive - combate.totals[4].cooldowns_defensive - overall.totals_grupo[1] = overall.totals_grupo[1] - combate.totals_grupo[1] overall.totals_grupo[2] = overall.totals_grupo[2] - combate.totals_grupo[2] @@ -474,6 +484,13 @@ combate.__sub = function (overall, combate) overall.totals_grupo[4].dead = overall.totals_grupo[4].dead - combate.totals_grupo[4].dead overall.totals_grupo[4].cooldowns_defensive = overall.totals_grupo[4].cooldowns_defensive - combate.totals_grupo[4].cooldowns_defensive + for fragName, fragAmount in pairs (combate.frags) do + if (fragAmount and overall.frags [fragName]) then --> not sure why + overall.frags [fragName] = overall.frags [fragName] - fragAmount + end + end + overall.frags_need_refresh = true + return overall end diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index 340ecea8..72e8688c 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -7,6 +7,7 @@ local _table_sort = table.sort local _table_insert = table.insert local _table_size = table.getn local _setmetatable = setmetatable +local _getmetatable = getmetatable local _ipairs = ipairs local _pairs = pairs local _rawget= rawget @@ -165,6 +166,150 @@ end return false end +function _detalhes:ToolTipFrags (instancia, frag, esta_barra) + + --vardump (frag) + + local name = frag [1] + local GameCooltip = GameCooltip + + GameCooltip:Reset() + GameCooltip:SetType ("tooltip") + GameCooltip:SetOwner (esta_barra) + GameCooltip:SetOption ("LeftBorderSize", -5) + GameCooltip:SetOption ("RightBorderSize", 5) + GameCooltip:SetOption ("StatusBarTexture", [[Interface\WorldStateFrame\WORLDSTATEFINALSCORE-HIGHLIGHT]]) + + --> mantendo a função o mais low level possível + local damage_container = instancia.showing [1] + + local frag_actor = damage_container._ActorTable [damage_container._NameIndexTable [ name ]] + + if (frag_actor) then + + local damage_taken_table = {} + + local took_damage_from = frag_actor.damage_from + local total_damage_taken = frag_actor.damage_taken + + for aggressor, _ in _pairs (took_damage_from) do + + local damager_actor = damage_container._ActorTable[damage_container._NameIndexTable [ aggressor ]] + + if (damager_actor) then --> checagem por causa do total e do garbage collector que não limpa os names que deram dano + + local targets = damager_actor.targets + + local specific_target = targets._ActorTable [targets._NameIndexTable [ name ]] --> é ele mesmo + if (specific_target) then + damage_taken_table [#damage_taken_table+1] = {aggressor, specific_target.total, damager_actor.classe} + end + end + end + + if (#damage_taken_table > 0) then + + _table_sort (damage_taken_table, _detalhes.Sort2) + + GameCooltip:AddLine (Loc ["STRING_FROM"], nil, nil, headerColor, nil, 12) + GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.126953125, 0.1796875, 0, 0.0546875) + GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha) + + for i = 1, math.min (6, #damage_taken_table) do + + local t = damage_taken_table [i] + + GameCooltip:AddLine (t [1], _detalhes:comma_value (t [2])) + local classe = t [3] + if (not classe) then + classe = "UNKNOW" + end + if (classe == "UNKNOW") then + GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) + else + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, _unpack (_detalhes.class_coords [classe])) + end + GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3) + end + + GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, "white") + GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625) + GameCooltip:ShowCooltip() + + end + end + +end + +local function RefreshBarraFrags (tabela, barra, instancia) + atributo_damage:AtualizarFrags (tabela, tabela.minha_barra, barra.colocacao, instancia) +end + +function atributo_damage:ReportSingleFragsLine (frag, instancia) + local barra = instancia.barras [frag.minha_barra] + + local reportar = {"Details! " .. Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"].. ": " .. frag [1]} --> localize-me + for i = 1, GameCooltip:GetNumLines() do + local texto_left, texto_right = GameCooltip:GetText (i) + if (texto_left and texto_right) then + texto_left = texto_left:gsub (("|T(.*)|t "), "") + reportar [#reportar+1] = ""..texto_left.." "..texto_right.."" + end + end + + return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true}) +end + +function atributo_damage:AtualizarFrags (tabela, qual_barra, colocacao, instancia) + + tabela ["frags"] = true --> marca que esta tabela é uma tabela de frags, usado no controla na hora de montar o tooltip + local esta_barra = instancia.barras [qual_barra] --> pega a referência da barra na janela + + if (not esta_barra) then + print ("DEBUG: problema com "..qual_barra.." "..lugar) + return + end + + local tabela_anterior = esta_barra.minha_tabela + + esta_barra.minha_tabela = tabela + + tabela.nome = tabela [1] --> evita dar erro ao redimencionar a janela + tabela.minha_barra = qual_barra + esta_barra.colocacao = colocacao + + if (not _getmetatable (tabela)) then + _setmetatable (tabela, {__call = RefreshBarraFrags}) + tabela._custom = true + end + + esta_barra.texto_esquerdo:SetText (colocacao .. ". " .. tabela [1]) + esta_barra.texto_direita:SetText (tabela [2]) + + if (colocacao == 1) then + esta_barra.statusbar:SetValue (100) + else + esta_barra.statusbar:SetValue (tabela [2] / instancia.top * 100) + end + + if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then + gump:Fade (esta_barra, "out") + end + + --> ele nao come o texto quando a instância esta muito pequena + + esta_barra.textura:SetVertexColor (1, 1, 1) + esta_barra.icone_classe:SetTexture ("Interface\\LFGFRAME\\LFGROLE_BW") + esta_barra.icone_classe:SetTexCoord (.25, .5, 0, 1) + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + + if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip + --gump:UpdateTooltip (qual_barra, esta_barra, instancia) + end + +end + +local ntable = {} function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, exportar) local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable @@ -199,6 +344,8 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex keyName = "damage_taken" elseif (sub_atributo == 4) then --> FRIENDLY FIRE keyName = "friendlyfire_total" + elseif (sub_atributo == 5) then --> FRAGS + keyName = "frags" end else keyName = exportar.key @@ -216,88 +363,154 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex keyName = "damage_taken" elseif (sub_atributo == 4) then --> FRIENDLY FIRE keyName = "friendlyfire_total" + elseif (sub_atributo == 5) then --> FRAGS + keyName = "frags" end end - if (instancia.atributo == 5) then --> custom - --> faz o sort da categoria e retorna o amount corrigido - amount = _detalhes:ContainerSort (conteudo, amount, keyName) - - --> grava o total - instancia.top = conteudo[1][keyName] - - elseif (modo == modo_ALL) then --> mostrando ALL + if (keyName == "frags") then - --> faz o sort da categoria e retorna o amount corrigido - amount = _detalhes:ContainerSort (conteudo, amount, keyName) + local frags = instancia.showing.frags + local index = 0 - --> pega o total ja aplicado na tabela do combate - total = tabela_do_combate.totals [class_type] + for fragName, fragAmount in _pairs (frags) do - --> grava o total - instancia.top = conteudo[1][keyName] - - elseif (modo == modo_GROUP) then --> mostrando GROUP - - --> organiza as tabelas + index = index + 1 - if (_detalhes.in_combat) then - using_cache = true - end - - if (using_cache) then - conteudo = _detalhes.cache_damage_group - - _table_sort (conteudo, _detalhes.SortKeySimple) - - if (conteudo[1][keyName] < 1) then - amount = 0 + if (ntable [index]) then + ntable [index] [1] = fragName + ntable [index] [2] = fragAmount else - instancia.top = conteudo[1][keyName] - amount = #conteudo + ntable [index] = {fragName, fragAmount} end - - for i = 1, amount do - total = total + conteudo[i][keyName] - end - else - _table_sort (conteudo, _detalhes.SortKeyGroup) + end - -- - --[[ - _table_sort (conteudo, function (a, b) - if (a.grupo and b.grupo) then - return a[keyName] > b[keyName] - elseif (a.grupo and not b.grupo) then - return true - elseif (not a.grupo and b.grupo) then - return false + local tsize = #ntable + if (index < tsize) then + for i = index+1, tsize do + ntable [i][2] = 0 + end + end + + if (tsize > 0) then + --_table_sort (ntable, function (t1, t2) + -- return (t1 [2] > t2 [2]) + --end) + _table_sort (ntable, _detalhes.Sort2) + instancia.top = ntable [1][2] + end + + total = index + + if (exportar) then + local export = {} + for i = 1, index do + export [i] = {ntable[i][1], ntable[i][2]} + end + return export + end + + if (total < 1) then + instancia:EsconderScrollBar() + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + end + + --estra mostrando ALL então posso seguir o padrão correto? primeiro, atualiza a scroll bar... + instancia:AtualizarScrollBar (total) + + --depois faz a atualização normal dele através dos iterators + local qual_barra = 1 + local barras_container = instancia.barras + + for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado + atributo_damage:AtualizarFrags (ntable[i], qual_barra, i, instancia) + qual_barra = qual_barra+1 + end + + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh + else + + if (instancia.atributo == 5) then --> custom + --> faz o sort da categoria e retorna o amount corrigido + amount = _detalhes:ContainerSort (conteudo, amount, keyName) + + --> grava o total + instancia.top = conteudo[1][keyName] + + elseif (modo == modo_ALL) then --> mostrando ALL + + --> faz o sort da categoria e retorna o amount corrigido + amount = _detalhes:ContainerSort (conteudo, amount, keyName) + + --> pega o total ja aplicado na tabela do combate + total = tabela_do_combate.totals [class_type] + + --> grava o total + instancia.top = conteudo[1][keyName] + + elseif (modo == modo_GROUP) then --> mostrando GROUP + + --> organiza as tabelas + + if (_detalhes.in_combat) then + using_cache = true + end + + if (using_cache and instancia.segmento == 0) then + conteudo = _detalhes.cache_damage_group + + _table_sort (conteudo, _detalhes.SortKeySimple) + + if (conteudo[1][keyName] < 1) then + amount = 0 else - return a[keyName] > b[keyName] + instancia.top = conteudo[1][keyName] + amount = #conteudo end - end) - --]] - - if (not using_cache) then - for index, player in _ipairs (conteudo) do - if (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo - if (player[keyName] < 1) then --> dano menor que 1, interromper o loop - amount = index - 1 - break - elseif (index == 1) then --> esse IF aqui, precisa mesmo ser aqui? não daria pra pega-lo com uma chave [1] nad grupo == true? - instancia.top = conteudo[1][keyName] + + for i = 1, amount do + total = total + conteudo[i][keyName] + end + else + _table_sort (conteudo, _detalhes.SortKeyGroup) + end + -- + + --[[ + _table_sort (conteudo, function (a, b) + if (a.grupo and b.grupo) then + return a[keyName] > b[keyName] + elseif (a.grupo and not b.grupo) then + return true + elseif (not a.grupo and b.grupo) then + return false + else + return a[keyName] > b[keyName] + end + end) + --]] + + if (not using_cache) then + for index, player in _ipairs (conteudo) do + if (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo + if (player[keyName] < 1) then --> dano menor que 1, interromper o loop + amount = index - 1 + break + elseif (index == 1) then --> esse IF aqui, precisa mesmo ser aqui? não daria pra pega-lo com uma chave [1] nad grupo == true? + instancia.top = conteudo[1][keyName] + end + + total = total + player[keyName] + else + amount = index-1 + break end - - total = total + player[keyName] - else - amount = index-1 - break end end end end - + --> refaz o mapa do container if (not using_cache) then showing:remapear() diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 6e0dd05e..8368e73e 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -209,7 +209,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo using_cache = true end - if (using_cache) then + if (using_cache and instancia.segmento == 0) then conteudo = _detalhes.cache_healing_group _detalhes:ContainerSort (conteudo, nil, keyName) @@ -1395,6 +1395,7 @@ atributo_heal.__add = function (shadow, tabela2) end shadow.totalover = shadow.totalover + tabela2.totalover + shadow.totalabsorb = shadow.totalabsorb + tabela2.totalabsorb shadow.heal_enemy_amt = shadow.heal_enemy_amt + tabela2.heal_enemy_amt shadow.total_without_pet = shadow.total_without_pet + tabela2.total_without_pet @@ -1455,6 +1456,7 @@ end atributo_heal.__sub = function (tabela1, tabela2) tabela1.total = tabela1.total - tabela2.total tabela1.totalover = tabela1.totalover - tabela2.totalover + tabela1.totalabsorb = tabela1.totalabsorb - tabela2.totalabsorb tabela1.heal_enemy_amt = tabela1.heal_enemy_amt - tabela2.heal_enemy_amt tabela1.total_without_pet = tabela1.total_without_pet - tabela2.total_without_pet diff --git a/classes/classe_heal_habilidade.lua b/classes/classe_heal_habilidade.lua index 51407f32..57ba426f 100644 --- a/classes/classe_heal_habilidade.lua +++ b/classes/classe_heal_habilidade.lua @@ -136,6 +136,7 @@ end habilidade_cura.__sub = function (tabela1, tabela2) tabela1.total = tabela1.total - tabela2.total + tabela1.totalabsorb = tabela1.totalabsorb - tabela2.totalabsorb tabela1.counter = tabela1.counter - tabela2.counter tabela1.n_min = tabela1.n_min - tabela2.n_min diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index dbe3d8de..4fdc30d9 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -1555,7 +1555,18 @@ function _detalhes:monta_relatorio (este_relatorio, custom) local container = self.showing [atributo]._ActorTable if (atributo == 1) then --> damage - total, keyName, first = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) + if (self.sub_atributo == 5) then --> frags + local frags = self.showing.frags + local reportarFrags = {} + for name, amount in pairs (frags) do + --> string para imprimir direto sem calculos + reportarFrags [#reportarFrags+1] = {frag = tostring (amount), nome = name} + end + container = reportarFrags + keyName = "frag" + else + total, keyName, first = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) + end elseif (atributo == 2) then --> heal total, keyName, first = _detalhes.atributo_heal:RefreshWindow (self, self.showing, true, true) elseif (atributo == 3) then --> energy @@ -1618,32 +1629,61 @@ function _detalhes:monta_relatorio (este_relatorio, custom) local total, keyName, first local atributo = self.atributo + local container = self.showing [atributo]._ActorTable + local quantidade = 0 + if (atributo == 1) then --> damage - total, keyName, first = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) + if (self.sub_atributo == 5) then --> frags + local frags = self.showing.frags + local reportarFrags = {} + for name, amount in pairs (frags) do + --> string para imprimir direto sem calculos + reportarFrags [#reportarFrags+1] = {frag = tostring (amount), nome = name} + end + container = reportarFrags + keyName = "frag" + else + total, keyName, first = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) + end elseif (atributo == 2) then --> heal total, keyName, first = _detalhes.atributo_heal:RefreshWindow (self, self.showing, true, true) elseif (atributo == 3) then --> energy total, keyName, first = _detalhes.atributo_energy:RefreshWindow (self, self.showing, true, true) elseif (atributo == 4) then --> misc - total, keyName, first = _detalhes.atributo_misc:RefreshWindow (self, self.showing, true, true) + if (self.sub_atributo == 5) then --> mortes + local mortes = self.showing.last_events_tables + local reportarMortes = {} + for index, morte in ipairs (mortes) do + reportarMortes [#reportarMortes+1] = {dead = morte [6], nome = morte [3]:gsub (("%-.*"), "")} + end + container = reportarMortes + keyName = "dead" + else + total, keyName, first = _detalhes.atributo_misc:RefreshWindow (self, self.showing, true, true) + end elseif (atributo == 5) then --> custom total, keyName, first = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, {key = "custom"}) total = self.showing.totals [self.customName] atributo = _detalhes.custom [self.sub_atributo].attribute end - local container = self.showing [atributo]._ActorTable - local quantidade = 0 - for i = #container, 1, -1 do + local _thisActor = container [i] local amount = _thisActor [keyName] - if (amount > 0) then - report_lines [#report_lines+1] = i..".".. _thisActor.nome.." ".. _detalhes:comma_value ( _math_floor (amount) ).." (".._cstr ("%.1f", amount/total*100).."%)" - quantidade = quantidade + 1 - if (quantidade == amt) then - break + + if (_type (amount) == "number") then + if (amount > 0) then + report_lines [#report_lines+1] = i..".".. _thisActor.nome.." ".. _detalhes:comma_value ( _math_floor (amount) ).." (".._cstr ("%.1f", amount/total*100).."%)" + quantidade = quantidade + 1 + if (quantidade == amt) then + break + end end + elseif (_type (amount) == "string") then + report_lines [#report_lines+1] = i..".".. _thisActor.nome.." ".. amount + else + break end end diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 972afff4..7d4328cf 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -76,8 +76,6 @@ function _detalhes:ToolTipDead (instancia, morte, esta_barra) local hora_da_morte = morte [2] local hp_max = morte [5] - local linhas = {} - local battleress = false local GameCooltip = GameCooltip @@ -180,7 +178,7 @@ end function atributo_misc:DeadAtualizarBarra (morte, qual_barra, colocacao, instancia) - morte ["dead"] = true --> temporario (testes) + morte ["dead"] = true --> marca que esta tabela é uma tabela de mortes, usado no controla na hora de montar o tooltip local esta_barra = instancia.barras[qual_barra] --> pega a referência da barra na janela if (not esta_barra) then diff --git a/core/control.lua b/core/control.lua index 6f181026..23c843d9 100644 --- a/core/control.lua +++ b/core/control.lua @@ -80,7 +80,13 @@ if (BossIndex) then + if (_detalhes.debug) then + _detalhes:Msg ("(debug) boss found:",_detalhes:GetBossName (ZoneMapID, BossIndex)) + end + if (_detalhes.in_combat) then + + --> catch boss function if any local bossFunction, bossFunctionType = _detalhes:GetBossFunction (ZoneMapID, BossIndex) if (bossFunction) then if (_bit_band (bossFunctionType, 0x1) ~= 0) then --realtime @@ -89,6 +95,34 @@ combat.bossFunction = _detalhes:ScheduleTimer ("bossFunction", 1) end end + + --> catch boss end if any + local endType, endData = _detalhes:GetEncounterEnd (ZoneMapID, BossIndex) + if (endType and endData) then + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) setting boss end type to:", endType) + end + + _detalhes.encounter.type = endType + _detalhes.encounter.killed = {} + _detalhes.encounter.data = {} + + if (type (endData) == "table") then + if (_detalhes.debug) then + _detalhes:Msg ("(debug) boss type is table:", endType) + end + if (endType == 1 or endType == 2) then + for _, npcID in ipairs (endData) do + _detalhes.encounter.data [npcID] = false + end + end + else + if (endType == 1 or endType == 2) then + _detalhes.encounter.data [endData] = false + end + end + end end _detalhes.tabela_vigente.is_boss = { @@ -166,6 +200,8 @@ _detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos) --> atualiza o showing end + table.wipe (_detalhes.encounter) + --> conta o tempo na tabela overall -- start time at overall table if (_detalhes.tabela_overall.end_time) then _detalhes.tabela_overall.start_time = _tempo - (_detalhes.tabela_overall.end_time - _detalhes.tabela_overall.start_time) @@ -465,7 +501,7 @@ end end - function _detalhes:EqualizeActorsSchedule (host_of) + function _detalhes:EqualizePets() --> check for pets without owner for _, actor in _ipairs (_detalhes.tabela_vigente[1]._ActorTable) do --> have flag and the flag tell us he is a pet @@ -476,14 +512,32 @@ end end end + end + + function _detalhes:EqualizeActorsSchedule (host_of) + + --> store pets sent through 'needpetowner' + _detalhes.sent_pets = _detalhes.sent_pets or {n = time()} + if (_detalhes.sent_pets.n+20 < time()) then + _table_wipe (_detalhes.sent_pets) + _detalhes.sent_pets.n = time() + end + + --> pet equilize disabled on details 1.4.0 + --_detalhes:ScheduleTimer ("EqualizePets", 1+math.random()) + --> do not equilize if there is any disabled capture if (_detalhes:CaptureIsAllEnabled()) then - _detalhes:ScheduleTimer ("EqualizeActors", 2, host_of) + _detalhes:ScheduleTimer ("EqualizeActors", 2+math.random()+math.random() , host_of) end end function _detalhes:EqualizeActors (host_of) + if (_detalhes.debug) then + _detalhes:Msg ("(debug) sending equilize actor data") + end + local damage, heal, energy, misc if (host_of) then @@ -518,6 +572,7 @@ local data = {damage, heal, energy, misc} + --> envia os dados do proprio host pra ele antes if (host_of) then _detalhes:SendCustomRaidData ("equalize_actors", host_of, nil, data) _detalhes:EqualizeActors() @@ -598,6 +653,8 @@ --verifica por tooltips especiais: if (objeto.dead) then --> é uma barra de dead return _detalhes:ToolTipDead (self, objeto, esta_barra) --> instância, [morte], barra + elseif (objeto.frags) then + return _detalhes:ToolTipFrags (self, objeto, esta_barra) end local t = objeto:ToolTip (self, qual_barra, esta_barra) --> instância, nº barra, objeto barra @@ -606,11 +663,15 @@ if (esta_barra.minha_tabela.serial and esta_barra.minha_tabela.serial ~= "") then local avatar = NickTag:GetNicknameTable (esta_barra.minha_tabela.serial) if (avatar) then - GameCooltip:SetBannerImage (1, avatar [2], 80, 40, avatarPoint, nil, nil) --> overlay [2] avatar path - --local l, r, t, b = unpack (avatar [5]) - --local r, g, b = unpack (avatar [6]) - GameCooltip:SetBannerImage (2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --> background - GameCooltip:SetBannerText (1, avatar [1], textPoint) --> text [1] nickname + if (avatar [2]) then + GameCooltip:SetBannerImage (1, avatar [2], 80, 40, avatarPoint, nil, nil) --> overlay [2] avatar path + end + if (avatar [4]) then + GameCooltip:SetBannerImage (2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --> background + end + if (avatar [1]) then + GameCooltip:SetBannerText (1, avatar [1], textPoint) --> text [1] nickname + end end end diff --git a/core/meta.lua b/core/meta.lua index 345428bc..106c8bf7 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -439,6 +439,9 @@ local conteudo = _tabela._ActorTable --> Limpa tabelas que não estejam em grupo + + _detalhes.clear_ungrouped = true + if (_detalhes.clear_ungrouped) then local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index diff --git a/core/network.lua b/core/network.lua index 831fde91..262eff05 100644 --- a/core/network.lua +++ b/core/network.lua @@ -39,7 +39,7 @@ local type, player, realm, dversion, arg6, arg7 = select (2, _detalhes:Deserialize (data)) if (_detalhes.debug) then - _detalhes:Msg ("(debug) network received command", type) + _detalhes:Msg ("(debug) network received:", type, "length:",string.len (data)) end if (type == "highfive") then @@ -48,16 +48,34 @@ end elseif (type == "petowner") then - local serial = player - local nome = realm - local owner_table = dversion + + dversion, serial, nome, owner_table = player, realm, dversion, arg6 + + if (dversion ~= _detalhes.realversion) then + return + end + + --> check for miss timing when combat finishes + if (not _detalhes.sent_pets) then + _detalhes.sent_pets = {n = time()} + else + if (_detalhes.sent_pets.n+20 < time()) then + _table_wipe (_detalhes.sent_pets) + _detalhes.sent_pets.n = time() + end + end + + _detalhes.sent_pets [serial] = true if (not _detalhes.tabela_pets.pets [serial]) then _detalhes.tabela_pets.pets [serial] = owner_table local petActor = _detalhes.tabela_vigente[1]:PegarCombatente (_, nome) if (petActor) then + local ownerActor = _detalhes.tabela_vigente[1]:PegarCombatente (owner_table[2], owner_table[1], owner_table[3], true) ownerActor.total = ownerActor.total + petActor.total + ownerActor.pets [#ownerActor.pets+1] = nome + if (_detalhes.debug) then _detalhes:Msg ("(debug) received owner for pet ",nome, "assigned to", owner_table[1]) end @@ -75,16 +93,34 @@ local petserial = arg6 local petnome = arg7 + + --> check for miss timing on combat finishes + if (not _detalhes.sent_pets) then + _detalhes.sent_pets = {n = time()} + else + if (_detalhes.sent_pets.n+20 < time()) then + _table_wipe (_detalhes.sent_pets) + _detalhes.sent_pets.n = time() + end + end + + --> already sent + if (_detalhes.sent_pets [petserial]) then + return + else + _detalhes.sent_pets [petserial] = true + end + local owner_table = _detalhes.tabela_pets.pets [petserial] if (owner_table) then - if (realm ~= GetRealmName()) then - player = player .."-"..realm - end + if (_detalhes.debug) then _detalhes:Msg ("(debug) received pet owner request, sending owner") end - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("petowner", petserial, petnome, owner_table), "WHISPER", player) + + _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("petowner", _detalhes.realversion, petserial, petnome, owner_table), "RAID") + --_detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("petowner", petserial, petnome, owner_table), "WHISPER", player) end elseif (type == "clouddatareceived") then diff --git a/core/parser.lua b/core/parser.lua index 333d7e1c..0e8dd427 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -1604,7 +1604,7 @@ ------------------------------------------------------------------------------------------------ --> early checks and fixes - + if (not alvo_name) then return end @@ -1612,7 +1612,61 @@ ------------------------------------------------------------------------------------------------ --> build dead - if (not _UnitIsFeignDeath (alvo_name)) then + --> frags + if (alvo_flags and _bit_band (alvo_flags, 0x00000008) ~= 0 and _in_combat) then + --> outsider death while in combat + + if (not _current_combat.frags [alvo_name]) then + _current_combat.frags [alvo_name] = 1 + else + _current_combat.frags [alvo_name] = _current_combat.frags [alvo_name] + 1 + end + + if (not _overall_combat.frags [alvo_name]) then + _overall_combat.frags [alvo_name] = 1 + else + _overall_combat.frags [alvo_name] = _overall_combat.frags [alvo_name] + 1 + end + + _current_combat.frags_need_refresh = true + _overall_combat.frags_need_refresh = true + + local encounter_type = _detalhes.encounter.type + if (encounter_type) then + if (encounter_type == 1 or encounter_type == 2) then + + local npcTable = _detalhes.encounter.data + local serial = tonumber (alvo_serial:sub (6, 10), 16) + + --vardump (npcTable) + + if (npcTable [serial] ~= nil) then --> ~= default false + + _detalhes.encounter.data [serial] = true + + --> check if it's done + local its_done = true + for _, killed in pairs (_detalhes.encounter.data) do + if (not killed) then + its_done = false + break + end + end + + --> combat finished + if (its_done) then + if (_detalhes.debug) then + _detalhes:Msg ("(debug) combat finished: encounter objective is completed") + end + _detalhes:SairDoCombate() + end + end + + end + end + + --> player death + elseif (not _UnitIsFeignDeath (alvo_name)) then if ( --> player in your group _bit_band (alvo_flags, AFFILIATION_GROUP) ~= 0 and @@ -1837,6 +1891,7 @@ token_list ["SPELL_INTERRUPT"] = nil -- dead token_list ["UNIT_DIED"] = nil + token_list ["UNIT_DESTROYED"] = nil end end @@ -1883,6 +1938,7 @@ token_list ["SPELL_INTERRUPT"] = parser.interrupt -- dead token_list ["UNIT_DIED"] = parser.dead + token_list ["UNIT_DESTROYED"] = parser.dead end end diff --git a/framework/label.lua b/framework/label.lua index d7101180..f7896612 100644 --- a/framework/label.lua +++ b/framework/label.lua @@ -248,7 +248,8 @@ function gump:NewLabel (parent, container, name, member, text, font, size, color end if (color) then - LabelObject.label:SetTextColor (unpack (color)) + local r, g, b, a = gump:ParseColors (color) + LabelObject.label:SetTextColor (r, g, b, a) end LabelObject.label:SetJustifyH ("LEFT") diff --git a/functions/attributes.lua b/functions/attributes.lua index ed6d6880..fe5b9fdc 100644 --- a/functions/attributes.lua +++ b/functions/attributes.lua @@ -18,7 +18,7 @@ do --[[ DAMAGE ]] dano = 1, --> identifier - [1] = 4, --> sub attributes + [1] = 5, --> sub attributes --[[ HEALING ]] cura = 2, --> identifier @@ -55,19 +55,22 @@ do dps = 2, damage_taken = 3, friendly_fire = 4, + frags = 5, lista = { --[[ String Names ]] Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"], Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"], Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"], - Loc ["STRING_ATTRIBUTE_DAMAGE_FRIENDLYFIRE"] + Loc ["STRING_ATTRIBUTE_DAMAGE_FRIENDLYFIRE"], + Loc ["STRING_ATTRIBUTE_DAMAGE_FRAGS"] }, icones = { {"Interface\\AddOns\\Details\\images\\atributos_icones_damage", {0, .125, 0, 1}}, {"Interface\\AddOns\\Details\\images\\atributos_icones_damage", {.125, .25, 0, 1}}, {"Interface\\AddOns\\Details\\images\\atributos_icones_damage", {.25, .375, 0, 1}}, - {"Interface\\AddOns\\Details\\images\\atributos_icones_damage", {.375, .5, 0, 1}} + {"Interface\\AddOns\\Details\\images\\atributos_icones_damage", {.375, .5, 0, 1}}, + {"Interface\\AddOns\\Details\\images\\atributos_icones_damage", {.5, 0.625, 0, 1}} }, - internal = {"total", "last_dps", "damage_taken", "friendlyfire_total"} + internal = {"total", "last_dps", "damage_taken", "friendlyfire_total", "total"} }, { diff --git a/functions/boss.lua b/functions/boss.lua index 7c7cff0b..5a17dea4 100644 --- a/functions/boss.lua +++ b/functions/boss.lua @@ -18,6 +18,18 @@ do end end + --> return the function for the boss + function _detalhes:GetEncounterEnd (mapid, bossindex) + local t = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] + if (t) then + local _end = t.combat_end + if (_end) then + return unpack (_end) + end + end + return + end + --> return the function for the boss function _detalhes:GetBossFunction (mapid, bossindex) local func = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex] and _detalhes.EncounterInformation [mapid].encounters [bossindex].func diff --git a/functions/savedata.lua b/functions/savedata.lua index 84c79aba..c33f16b9 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -80,11 +80,15 @@ function _detalhes:SaveDataOnLogout() --> precisa pegar o nome do plugin if (_detalhes.SoloTables.Mode) then _detalhes_database.SoloTables.Mode = _detalhes.SoloTables.Mode - _detalhes_database.SoloTables.LastSelected = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].real_name + if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode]) then + _detalhes_database.SoloTables.LastSelected = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].real_name + end end if (_detalhes.RaidTables.Mode) then _detalhes_database.RaidTables.Mode = _detalhes.RaidTables.Mode - _detalhes_database.RaidTables.LastSelected = _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].real_name + if (_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode]) then + _detalhes_database.RaidTables.LastSelected = _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].real_name + end end --> buff data _detalhes.Buffs:SaveBuffs() @@ -99,6 +103,7 @@ function _detalhes:SaveDataOnLogout() _detalhes_global = _detalhes_global or {} _detalhes_global.savedStyles = _detalhes.savedStyles + _detalhes_global.got_first_run = true --max segments _detalhes_global.segments_amount = _detalhes.segments_amount _detalhes_global.segments_amount_to_save = _detalhes.segments_amount_to_save @@ -286,8 +291,11 @@ end --]] if (_detalhes_global) then --saved styles - vardump (_detalhes_global.savedStyles) + --vardump (_detalhes_global.savedStyles) _detalhes.savedStyles = _detalhes_global.savedStyles or _detalhes.savedStyles + 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 diff --git a/functions/slash.lua b/functions/slash.lua index dc5181a4..b321604d 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -143,8 +143,6 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "alert") then local instancia = _detalhes.tabela_instancias [1] - --instancia:InstanceAlert ("Teste do alerta da instancia", [[Interface\Buttons\UI-GroupLoot-Pass-Down]], 5, clickfunc) - --instancia:InstanceAlert ("Teste do alerta da instancia", [[Interface\Buttons\UI-GroupLoot-Pass-Down]], 5, clickfunc) local f = function() print ("teste") end instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, 5, {f, "param1", "param2"}) @@ -161,7 +159,8 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "teste") then - print (time()) + local a, b = _detalhes:GetEncounterEnd (1098, 3) + print (a, unpack (b)) elseif (msg == "yesno") then --_detalhes:Show() diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 5b8ed286..e82b72fa 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -62,7 +62,7 @@ function _detalhes:OpenOptionsWindow (instance) window.panicModeSlider.tooltip = "If enabled, when you are in a raid encounter\nand get dropped from the game, a disconnect for intance,\nDetails! immediately erase all segments\nmaking the disconnect process faster." --------------- Animate Rows - g:NewLabel (window, _, "$parentAnimateLabel", "animateLabel", "animate rows") + g:NewLabel (window, _, "$parentAnimateLabel", "animateLabel", "dance bars") window.animateLabel:SetPoint (10, -80) -- g:NewSwitch (window, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations) -- ltext, rtext, defaultv @@ -122,7 +122,7 @@ function _detalhes:OpenOptionsWindow (instance) g:NewLabel (window, _, "$parentUpdateSpeedLabel", "updatespeedLabel", "update speed") window.updatespeedLabel:SetPoint (10, -125) -- - g:NewSlider (window, _, "$parentSliderUpdateSpeed", "updatespeedSlider", 160, 20, 0.3, 2, 0.1, _detalhes.update_speed, true) --parent, container, name, member, w, h, min, max, step, defaultv + g:NewSlider (window, _, "$parentSliderUpdateSpeed", "updatespeedSlider", 160, 20, 0.3, 3, 0.1, _detalhes.update_speed, true) --parent, container, name, member, w, h, min, max, step, defaultv window.updatespeedSlider:SetPoint ("left", window.updatespeedLabel, "right") window.updatespeedSlider:SetThumbSize (50) window.updatespeedSlider.useDecimals = true @@ -130,7 +130,7 @@ function _detalhes:OpenOptionsWindow (instance) if (value < 1) then slider.amt:SetTextColor (1, value, 0) elseif (value > 1) then - slider.amt:SetTextColor (-(value-2), 1, 0) + slider.amt:SetTextColor (-(value-3), 1, 0) else slider.amt:SetTextColor (1, 1, 0) end diff --git a/gumps/janela_welcome.lua b/gumps/janela_welcome.lua new file mode 100644 index 00000000..4f63f8b5 --- /dev/null +++ b/gumps/janela_welcome.lua @@ -0,0 +1,590 @@ +local _detalhes = _G._detalhes +local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + +local g = _detalhes.gump + +function _detalhes:OpenWelcomeWindow () + + GameCooltip:Close() + local window = _G.DetailsWelcomeWindow + + if (not window) then + + local index = 1 + local pages = {} + + window = CreateFrame ("frame", "DetailsWelcomeWindow", UIParent) + window:SetPoint ("center", UIParent, "center", 0, 0) + window:SetWidth (512) + window:SetHeight (256) + window:SetMovable (true) + window:SetScript ("OnMouseDown", function() window:StartMoving() end) + window:SetScript ("OnMouseUp", function() window:StopMovingOrSizing() end) + + local background = window:CreateTexture (nil, "background") + background:SetPoint ("topleft", window, "topleft") + background:SetPoint ("bottomright", window, "bottomright") + background:SetTexture ([[Interface\AddOns\Details\images\welcome]]) + + local rodape_bg = window:CreateTexture (nil, "artwork") + rodape_bg:SetPoint ("bottomleft", window, "bottomleft", 11, 12) + rodape_bg:SetPoint ("bottomright", window, "bottomright", -11, 12) + rodape_bg:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) + rodape_bg:SetHeight (25) + rodape_bg:SetVertexColor (0, 0, 0, 1) + + local logotipo = window:CreateTexture (nil, "overlay") + logotipo:SetPoint ("topleft", window, "topleft", 16, -20) + logotipo:SetTexture ([[Interface\Addons\Details\images\logotipo]]) + logotipo:SetTexCoord (0.07421875, 0.73828125, 0.51953125, 0.890625) + logotipo:SetWidth (186) + logotipo:SetHeight (50) + + local cancel = CreateFrame ("Button", nil, window) + cancel:SetWidth (22) + cancel:SetHeight (22) + cancel:SetPoint ("bottomleft", window, "bottomleft", 12, 14) + cancel:SetFrameLevel (window:GetFrameLevel()+1) + cancel:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + cancel:SetHighlightTexture ([[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + cancel:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + cancel:SetScript ("OnClick", function() window:Hide() end) + local cancelText = cancel:CreateFontString (nil, "overlay", "GameFontNormal") + cancelText:SetPoint ("left", cancel, "right", 2, 0) + cancelText:SetText ("Skip") + + local forward = CreateFrame ("button", nil, window) + forward:SetWidth (26) + forward:SetHeight (26) + forward:SetPoint ("bottomright", window, "bottomright", -14, 13) + forward:SetFrameLevel (window:GetFrameLevel()+1) + forward:SetPushedTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Down]]) + forward:SetHighlightTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Up]]) + forward:SetNormalTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Up]]) + forward:SetDisabledTexture ([[Interface\Buttons\UI-SpellbookIcon-NextPage-Disabled]]) + + local backward = CreateFrame ("button", nil, window) + backward:SetWidth (26) + backward:SetHeight (26) + backward:SetPoint ("bottomright", window, "bottomright", -38, 13) + backward:SetPushedTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Down]]) + backward:SetHighlightTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Up]]) + backward:SetNormalTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Up]]) + backward:SetDisabledTexture ([[Interface\Buttons\UI-SpellbookIcon-PrevPage-Disabled]]) + + forward:SetScript ("OnClick", function() + if (index < #pages) then + for _, widget in ipairs (pages [index]) do + widget:Hide() + end + + index = index + 1 + + for _, widget in ipairs (pages [index]) do + widget:Show() + end + + if (index == #pages) then + forward:Disable() + end + backward:Enable() + end + + + + end) + + backward:SetScript ("OnClick", function() + if (index > 1) then + for _, widget in ipairs (pages [index]) do + widget:Hide() + end + + index = index - 1 + + for _, widget in ipairs (pages [index]) do + widget:Show() + end + + if (index == 1) then + backward:Disable() + end + forward:Enable() + end + end) + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 1 + + --> introduction + + local angel = window:CreateTexture (nil, "border") + angel:SetPoint ("bottomright", window, "bottomright") + angel:SetTexture ([[Interface\TUTORIALFRAME\UI-TUTORIALFRAME-SPIRITREZ]]) + angel:SetTexCoord (0.162109375, 0.591796875, 0, 1) + angel:SetWidth (442) + angel:SetHeight (256) + angel:SetAlpha (.2) + + local texto1 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto1:SetPoint ("topleft", window, "topleft", 13, -150) + texto1:SetText ("|cFFFFFFFFWelcome to Details! Quick Setup Wizard\n\n|rThis guide will help you with some important configurations.\nYou can skip this at any time just clicking on 'skip' button.") + texto1:SetJustifyH ("left") + + pages [#pages+1] = {texto1, angel} + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 2 + + --ampulheta:SetTexture ([[Interface\Timer\Challenges-Logo]]) + --[[ + local ampulheta = window:CreateTexture (nil, "overlay") + + ampulheta:SetPoint ("topright", window, "topright", 60, 57) + ampulheta:SetHeight (125*3)--125 + ampulheta:SetWidth (89*3)--82 + ampulheta:SetAlpha (.1) + ampulheta:SetDesaturated (true) + --]] + + local ampulheta = window:CreateTexture (nil, "overlay") + ampulheta:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + ampulheta:SetPoint ("bottomright", window, "bottomright", -10, 10) + ampulheta:SetHeight (125*3)--125 + ampulheta:SetWidth (89*3)--82 + ampulheta:SetAlpha (.1) + ampulheta:SetTexCoord (1, 0, 0, 1) + + g:NewLabel (window, _, "$parentChangeMind2Label", "changemind2Label", "if you change your mind, you can always modify again through options panel", "GameFontNormal", 9, "orange") + window.changemind2Label:SetPoint ("center", window, "center") + window.changemind2Label:SetPoint ("bottom", window, "bottom", 0, 19) + window.changemind2Label.align = "|" + + local texto2 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto2:SetPoint ("topleft", window, "topleft", 20, -80) + texto2:SetText ("Damage & Healing per Second Timing:") + + local chronometer = CreateFrame ("CheckButton", "WelcomeWindowChronometer", window, "ChatConfigCheckButtonTemplate") + chronometer:SetPoint ("topleft", window, "topleft", 40, -110) + local continuous = CreateFrame ("CheckButton", "WelcomeWindowContinuous", window, "ChatConfigCheckButtonTemplate") + continuous:SetPoint ("topleft", window, "topleft", 40, -160) + + _G ["WelcomeWindowChronometerText"]:SetText ("Chronometer"..": ") + _G ["WelcomeWindowContinuousText"]:SetText ("Continuous"..": ") + + local chronometer_text = window:CreateFontString (nil, "overlay", "GameFontNormal") + chronometer_text:SetText ("standard way of measuring time, the timer of each raid member is put on hold if his activity is ceased and back again to count when actor activity is resumed.") + chronometer_text:SetWidth (360) + chronometer_text:SetHeight (40) + chronometer_text:SetJustifyH ("left") + chronometer_text:SetJustifyV ("top") + chronometer_text:SetTextColor (.8, .8, .8, 1) + chronometer_text:SetPoint ("topleft", _G ["WelcomeWindowChronometerText"], "topright", 0, 0) + + local continuous_text = window:CreateFontString (nil, "overlay", "GameFontNormal") + continuous_text:SetText ("also know as 'effective time', this method uses the elapsed combat time for mensure the Dps and Hps of all raid members.") + continuous_text:SetWidth (360) + continuous_text:SetHeight (40) + continuous_text:SetJustifyH ("left") + continuous_text:SetJustifyV ("top") + continuous_text:SetTextColor (.8, .8, .8, 1) + continuous_text:SetPoint ("topleft", _G ["WelcomeWindowContinuousText"], "topright", 0, 0) + + chronometer:SetHitRectInsets (0, -70, 0, 0) + continuous:SetHitRectInsets (0, -70, 0, 0) + + if (_detalhes.time_type == 1) then --> chronometer + chronometer:SetChecked (true) + continuous:SetChecked (false) + elseif (_detalhes.time_type == 1) then --> continuous + chronometer:SetChecked (false) + continuous:SetChecked (true) + end + + chronometer:SetScript ("OnClick", function() continuous:SetChecked (false); _detalhes.time_type = 1 end) + continuous:SetScript ("OnClick", function() chronometer:SetChecked (false); _detalhes.time_type = 2 end) + + pages [#pages+1] = {ampulheta, texto2, chronometer, continuous, chronometer_text, continuous_text, window.changemind2Label} + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 3 + + local mecanica = window:CreateTexture (nil, "overlay") + mecanica:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + mecanica:SetPoint ("bottomright", window, "bottomright", -10, 10) + mecanica:SetHeight (125*3)--125 + mecanica:SetWidth (89*3)--82 + mecanica:SetAlpha (.1) + mecanica:SetTexCoord (1, 0, 0, 1) + + g:NewLabel (window, _, "$parentChangeMind3Label", "changemind3Label", "if you change your mind, you can always modify again through options panel", "GameFontNormal", 9, "orange") + window.changemind3Label:SetPoint ("center", window, "center") + window.changemind3Label:SetPoint ("bottom", window, "bottom", 0, 19) + window.changemind3Label.align = "|" + + local texto3 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto3:SetPoint ("topleft", window, "topleft", 20, -80) + texto3:SetText ("Reading combat data:") + + local data_text = window:CreateFontString (nil, "overlay", "GameFontNormal") + data_text:SetText ("Details! reads and calculate combat data in a very fast way, but if you are unconfortable with you compunter performance, you can drop some types of data which isn't important to you:") + data_text:SetWidth (460) + data_text:SetHeight (40) + data_text:SetJustifyH ("left") + data_text:SetJustifyV ("top") + data_text:SetTextColor (1, 1, 1, 1) + data_text:SetPoint ("topleft", window, "topleft", 30, -105) + + local data_text2 = window:CreateFontString (nil, "overlay", "GameFontNormal") + data_text2:SetText ("Tip: for a best experience, it's recommend leave all turned on.") + data_text2:SetWidth (460) + data_text2:SetHeight (40) + data_text2:SetJustifyH ("left") + data_text2:SetJustifyV ("top") + data_text2:SetTextColor (1, 1, 1, 1) + data_text2:SetPoint ("topleft", window, "topleft", 30, -201) + + --------------- Captures + g:NewImage (window, _, "$parentCaptureDamage", "damageCaptureImage", 20, 20, [[Interface\AddOns\Details\images\atributos_captures]]) + window.damageCaptureImage:SetPoint (35, -155) + window.damageCaptureImage:SetTexCoord (0, 0.125, 0, 1) + + g:NewImage (window, _, "$parentCaptureHeal", "healCaptureImage", 20, 20, [[Interface\AddOns\Details\images\atributos_captures]]) + window.healCaptureImage:SetPoint (170, -155) + window.healCaptureImage:SetTexCoord (0.125, 0.25, 0, 1) + + g:NewImage (window, _, "$parentCaptureEnergy", "energyCaptureImage", 20, 20, [[Interface\AddOns\Details\images\atributos_captures]]) + window.energyCaptureImage:SetPoint (305, -155) + window.energyCaptureImage:SetTexCoord (0.25, 0.375, 0, 1) + + g:NewImage (window, _, "$parentCaptureMisc", "miscCaptureImage", 20, 20, [[Interface\AddOns\Details\images\atributos_captures]]) + window.miscCaptureImage:SetPoint (35, -175) + window.miscCaptureImage:SetTexCoord (0.375, 0.5, 0, 1) + + g:NewImage (window, _, "$parentCaptureAura", "auraCaptureImage", 20, 20, [[Interface\AddOns\Details\images\atributos_captures]]) + window.auraCaptureImage:SetPoint (170, -175) + window.auraCaptureImage:SetTexCoord (0.5, 0.625, 0, 1) + + g:NewLabel (window, _, "$parentCaptureDamageLabel", "damageCaptureLabel", "Damage") + window.damageCaptureLabel:SetPoint ("left", window.damageCaptureImage, "right", 2) + g:NewLabel (window, _, "$parentCaptureDamageLabel", "healCaptureLabel", "Healing") + window.healCaptureLabel:SetPoint ("left", window.healCaptureImage, "right", 2) + g:NewLabel (window, _, "$parentCaptureDamageLabel", "energyCaptureLabel", "Energy") + window.energyCaptureLabel:SetPoint ("left", window.energyCaptureImage, "right", 2) + g:NewLabel (window, _, "$parentCaptureDamageLabel", "miscCaptureLabel", "Misc") + window.miscCaptureLabel:SetPoint ("left", window.miscCaptureImage, "right", 2) + g:NewLabel (window, _, "$parentCaptureDamageLabel", "auraCaptureLabel", "Auras") + window.auraCaptureLabel:SetPoint ("left", window.auraCaptureImage, "right", 2) + + local switch_icon_color = function (icon, on_off) + icon:SetDesaturated (not on_off) + end + + g:NewSwitch (window, _, "$parentCaptureDamageSlider", "damageCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["damage"]) + window.damageCaptureSlider:SetPoint ("left", window.damageCaptureLabel, "right", 2) + window.damageCaptureSlider.tooltip = "Pause or enable capture of:\n- damage done\n- damage per second\n- friendly fire\n- damage taken" + window.damageCaptureSlider.OnSwitch = function (self, _, value) + _detalhes:CaptureSet (value, "damage", true) + switch_icon_color (window.damageCaptureImage, value) + end + switch_icon_color (window.damageCaptureImage, _detalhes.capture_real ["damage"]) + + g:NewSwitch (window, _, "$parentCaptureHealSlider", "healCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["heal"]) + window.healCaptureSlider:SetPoint ("left", window.healCaptureLabel, "right", 2) + window.healCaptureSlider.tooltip = "Pause or enable capture of:\n- healing done (not absorbs)\n- healing per second\n- overheal\n- healing taken\n- enemy healed" + window.healCaptureSlider.OnSwitch = function (self, _, value) + _detalhes:CaptureSet (value, "heal", true) + switch_icon_color (window.healCaptureImage, value) + end + switch_icon_color (window.healCaptureImage, _detalhes.capture_real ["heal"]) + + g:NewSwitch (window, _, "$parentCaptureEnergySlider", "energyCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["energy"]) + window.energyCaptureSlider:SetPoint ("left", window.energyCaptureLabel, "right", 2) + window.energyCaptureSlider.tooltip = "Pause or enable capture of:\n- mana restored\n- rage generated\n- energy generated\n- runic power generated" + window.energyCaptureSlider.OnSwitch = function (self, _, value) + _detalhes:CaptureSet (value, "energy", true) + switch_icon_color (window.energyCaptureImage, value) + end + switch_icon_color (window.energyCaptureImage, _detalhes.capture_real ["energy"]) + + g:NewSwitch (window, _, "$parentCaptureMiscSlider", "miscCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["miscdata"]) + window.miscCaptureSlider:SetPoint ("left", window.miscCaptureLabel, "right", 2) + window.miscCaptureSlider.tooltip = "Pause or enable capture of:\n- cc breaks\n- dispell\n- interrupts\n- ress\n- deaths" + window.miscCaptureSlider.OnSwitch = function (self, _, value) + _detalhes:CaptureSet (value, "miscdata", true) + switch_icon_color (window.miscCaptureImage, value) + end + switch_icon_color (window.miscCaptureImage, _detalhes.capture_real ["miscdata"]) + + g:NewSwitch (window, _, "$parentCaptureAuraSlider", "auraCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["aura"]) + window.auraCaptureSlider:SetPoint ("left", window.auraCaptureLabel, "right", 2) + window.auraCaptureSlider.tooltip = "Pause or enable capture of:\n- buffs and debufs\n- absorbs (heal)\n- cooldowns\n- damage prevented" + window.auraCaptureSlider.OnSwitch = function (self, _, value) + _detalhes:CaptureSet (value, "aura", true) + switch_icon_color (window.auraCaptureImage, value) + end + switch_icon_color (window.auraCaptureImage, _detalhes.capture_real ["aura"]) + + pages [#pages+1] = {mecanica, texto3, data_text, window.damageCaptureImage, window.healCaptureImage, window.energyCaptureImage, window.miscCaptureImage, + window.auraCaptureImage, window.damageCaptureSlider, window.healCaptureSlider, window.energyCaptureSlider, window.miscCaptureSlider, window.auraCaptureSlider, + window.damageCaptureLabel, window.healCaptureLabel, window.energyCaptureLabel, window.miscCaptureLabel, window.auraCaptureLabel, data_text2, window.changemind3Label} + + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 4 + + local bg = window:CreateTexture (nil, "overlay") + bg:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg:SetPoint ("bottomright", window, "bottomright", -10, 10) + bg:SetHeight (125*3)--125 + bg:SetWidth (89*3)--82 + bg:SetAlpha (.1) + bg:SetTexCoord (1, 0, 0, 1) + + g:NewLabel (window, _, "$parentChangeMind4Label", "changemind4Label", "if you change your mind, you can always modify again through options panel", "GameFontNormal", 9, "orange") + window.changemind4Label:SetPoint ("center", window, "center") + window.changemind4Label:SetPoint ("bottom", window, "bottom", 0, 19) + window.changemind4Label.align = "|" + + local texto4 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto4:SetPoint ("topleft", window, "topleft", 20, -80) + texto4:SetText ("Interface Tweaks:") + + local interval_text = window:CreateFontString (nil, "overlay", "GameFontNormal") + interval_text:SetText ("You can also adjust the interval (in seconds) between window updates, high values may save some performance.") + interval_text:SetWidth (460) + interval_text:SetHeight (40) + interval_text:SetJustifyH ("left") + interval_text:SetJustifyV ("top") + interval_text:SetTextColor (1, 1, 1, 1) + interval_text:SetPoint ("topleft", window, "topleft", 30, -110) + + local dance_text = window:CreateFontString (nil, "overlay", "GameFontNormal") + dance_text:SetText ("Keeping 'Dance Bars' disabled may help save performance.") + dance_text:SetWidth (460) + dance_text:SetHeight (40) + dance_text:SetJustifyH ("left") + dance_text:SetJustifyV ("top") + dance_text:SetTextColor (1, 1, 1, 1) + dance_text:SetPoint ("topleft", window, "topleft", 30, -170) + + --------------- Update Speed + g:NewLabel (window, _, "$parentUpdateSpeedLabel", "updatespeedLabel", "Update Speed") + window.updatespeedLabel:SetPoint (31, -150) + -- + g:NewSlider (window, _, "$parentSliderUpdateSpeed", "updatespeedSlider", 160, 20, 0.3, 3, 0.1, _detalhes.update_speed, true) --parent, container, name, member, w, h, min, max, step, defaultv + window.updatespeedSlider:SetPoint ("left", window.updatespeedLabel, "right", 2, 0) + window.updatespeedSlider:SetThumbSize (50) + window.updatespeedSlider.useDecimals = true + local updateColor = function (slider, value) + if (value < 1) then + slider.amt:SetTextColor (1, value, 0) + elseif (value > 1) then + slider.amt:SetTextColor (-(value-3), 1, 0) + else + slider.amt:SetTextColor (1, 1, 0) + end + end + window.updatespeedSlider:SetHook ("OnValueChange", function (self, _, amount) + _detalhes:CancelTimer (_detalhes.atualizador) + _detalhes.update_speed = amount + _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", _detalhes.update_speed, -1) + updateColor (self, amount) + end) + updateColor (window.updatespeedSlider, _detalhes.update_speed) + + window.updatespeedSlider.tooltip = "delay between each update,\ncpu usage may |cFFFF9900increase|r with low values\nand |cFF00FF00slight reduce|r with high values." + + --------------- Animate Rows + g:NewLabel (window, _, "$parentAnimateLabel", "animateLabel", "Dance Bars") + window.animateLabel:SetPoint (31, -195) + -- + g:NewSwitch (window, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations) -- ltext, rtext, defaultv + window.animateSlider:SetPoint ("left",window.animateLabel, "right", 2, 0) + window.animateSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue (false, true) + _detalhes.use_row_animations = value + end + window.animateSlider.tooltip = "dancing bars is a feature which create animations\nto the left and right directions for all bars.\ncpu usage may |cFFFF9900slight increase|r with this turned on." + + pages [#pages+1] = {bg, texto4, interval_text, dance_text, window.updatespeedLabel, window.updatespeedSlider, window.animateLabel, window.animateSlider, window.changemind4Label} + + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 5 + + local bg6 = window:CreateTexture (nil, "overlay") + bg6:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg6:SetPoint ("bottomright", window, "bottomright", -10, 10) + bg6:SetHeight (125*3)--125 + bg6:SetWidth (89*3)--82 + bg6:SetAlpha (.1) + bg6:SetTexCoord (1, 0, 0, 1) + + local texto5 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto5:SetPoint ("topleft", window, "topleft", 20, -80) + texto5:SetText ("Using the Interface: Stretch") + + local texto_stretch = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto_stretch:SetPoint ("topleft", window, "topleft", 181, -105) + texto_stretch:SetText ("- When you have the mouse over a Details! window, a |cFFFFFF00small hook|r will appear over the instance button. |cFFFFFF00Click, hold and pull|r up to |cFFFFFF00stretch|r the window, releasing the mouse click, the window |cFFFFFF00back to original|r size.\n\n- If you miss a |cFFFFBB00scroll bar|r, you can active it on the options panel.") + texto_stretch:SetWidth (310) + texto_stretch:SetHeight (100) + texto_stretch:SetJustifyH ("left") + texto_stretch:SetJustifyV ("top") + texto_stretch:SetTextColor (1, 1, 1, 1) + + local stretch_image = window:CreateTexture (nil, "overlay") + stretch_image:SetTexture ([[Interface\Addons\Details\images\icons]]) + stretch_image:SetPoint ("right", texto_stretch, "left", -12, 0) + stretch_image:SetWidth (144) + stretch_image:SetHeight (61) + stretch_image:SetTexCoord (0.716796875, 1, 0.876953125, 1) + + pages [#pages+1] = {bg6, texto5, stretch_image, texto_stretch} + + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 6 + + local bg6 = window:CreateTexture (nil, "overlay") + bg6:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg6:SetPoint ("bottomright", window, "bottomright", -10, 10) + bg6:SetHeight (125*3)--125 + bg6:SetWidth (89*3)--82 + bg6:SetAlpha (.1) + bg6:SetTexCoord (1, 0, 0, 1) + + local texto6 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto6:SetPoint ("topleft", window, "topleft", 20, -80) + texto6:SetText ("Using the Interface: Instance Button") + + local texto_instance_button = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto_instance_button:SetPoint ("topleft", window, "topleft", 25, -105) + texto_instance_button:SetText ("Instance button basically do three things:\n\n- show |cFFFFFF00what instance|r is it through the |cFFFFFF00#number|r,\n- open a |cFFFFFF00new instance|r window when clicked.\n- show a menu with |cFFFFFF00closed instances|r which can be reopen at any one.") + texto_instance_button:SetWidth (270) + texto_instance_button:SetHeight (100) + texto_instance_button:SetJustifyH ("left") + texto_instance_button:SetJustifyV ("top") + texto_instance_button:SetTextColor (1, 1, 1, 1) + + local instance_button_image = window:CreateTexture (nil, "overlay") + instance_button_image:SetTexture ([[Interface\Addons\Details\images\icons]]) + instance_button_image:SetPoint ("topright", window, "topright", -12, -70) + instance_button_image:SetWidth (204) + instance_button_image:SetHeight (141) + instance_button_image:SetTexCoord (0.31640625, 0.71484375, 0.724609375, 1) + + pages [#pages+1] = {bg6, texto6, instance_button_image, texto_instance_button} + + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 7 + + local bg7 = window:CreateTexture (nil, "overlay") + bg7:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg7:SetPoint ("bottomright", window, "bottomright", -10, 10) + bg7:SetHeight (125*3)--125 + bg7:SetWidth (89*3)--82 + bg7:SetAlpha (.1) + bg7:SetTexCoord (1, 0, 0, 1) + + local texto7 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto7:SetPoint ("topleft", window, "topleft", 20, -80) + texto7:SetText ("Using the Interface: Fast Switch Panel (shortcuts)") + + local texto_shortcut = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto_shortcut:SetPoint ("topleft", window, "topleft", 25, -110) + texto_shortcut:SetText ("- Right clicking |cFFFFFF00over a row|r or in the background opens the |cFFFFFF00shortcut menu|r.\n- You can choose which |cFFFFFF00attribute|r the shortcut will have by |cFFFFFF00right clicking|r his icon.\n- Left click |cFFFFFF00selects|r the shortcut attribute and |cFFFFFF00display|r it on the instance\n- Right click anywhere |cFFFFFF00closes|r the switch panel.") + texto_shortcut:SetWidth (320) + texto_shortcut:SetHeight (90) + texto_shortcut:SetJustifyH ("left") + texto_shortcut:SetJustifyV ("top") + texto_shortcut:SetTextColor (1, 1, 1, 1) + + local shortcut_image1 = window:CreateTexture (nil, "overlay") + shortcut_image1:SetTexture ([[Interface\Addons\Details\images\icons]]) + shortcut_image1:SetPoint ("topright", window, "topright", -12, -20) + shortcut_image1:SetWidth (160) + shortcut_image1:SetHeight (91) + shortcut_image1:SetTexCoord (0, 0.31250, 0.82421875, 1) + + local shortcut_image2 = window:CreateTexture (nil, "overlay") + shortcut_image2:SetTexture ([[Interface\Addons\Details\images\icons]]) + shortcut_image2:SetPoint ("topright", window, "topright", -12, -110) + shortcut_image2:SetWidth (160) + shortcut_image2:SetHeight (106) + shortcut_image2:SetTexCoord (0, 0.31250, 0.59375, 0.80078125) + + pages [#pages+1] = {bg7, texto7, shortcut_image1, shortcut_image2, texto_shortcut} + + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> page 8 + + local bg8 = window:CreateTexture (nil, "overlay") + bg8:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + bg8:SetPoint ("bottomright", window, "bottomright", -10, 10) + bg8:SetHeight (125*3)--125 + bg8:SetWidth (89*3)--82 + bg8:SetAlpha (.1) + bg8:SetTexCoord (1, 0, 0, 1) + + local texto8 = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto8:SetPoint ("topleft", window, "topleft", 20, -80) + texto8:SetText ("Ready to Raid!") + + local texto = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto:SetPoint ("topleft", window, "topleft", 25, -110) + texto:SetText ("Thank you for choosing Details!\n\nFeel free to always send feedbacks and bug reports to us (|cFFBBFFFFuse the fifth button a blue one|r), we appreciate.") + texto:SetWidth (410) + texto:SetHeight (90) + texto:SetJustifyH ("left") + texto:SetJustifyV ("top") + texto:SetTextColor (1, 1, 1, 1) + + local report_image1 = window:CreateTexture (nil, "overlay") + report_image1:SetTexture ([[Interface\Addons\Details\images\icons]]) + report_image1:SetPoint ("topright", window, "topright", -30, -97) + report_image1:SetWidth (144) + report_image1:SetHeight (30) + report_image1:SetTexCoord (0.71875, 1, 0.81640625, 0.875) + + pages [#pages+1] = {bg8, texto8, texto, report_image1} + + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + +------------------------------------------------------------------------------------------------------------------------------ + + --[[ + forward:Click() + forward:Click() + forward:Click() + forward:Click() + forward:Click() + forward:Click() + forward:Click() + --]] + + end + +end \ No newline at end of file diff --git a/images/atributos_icones_damage.tga b/images/atributos_icones_damage.tga index 8b76c8b4..efc7bb6b 100644 Binary files a/images/atributos_icones_damage.tga and b/images/atributos_icones_damage.tga differ diff --git a/images/icons.tga b/images/icons.tga index 26b7e6ad..1fab5292 100644 Binary files a/images/icons.tga and b/images/icons.tga differ diff --git a/images/logotipo.tga b/images/logotipo.tga new file mode 100644 index 00000000..197b3015 Binary files /dev/null and b/images/logotipo.tga differ diff --git a/images/welcome.tga b/images/welcome.tga new file mode 100644 index 00000000..7afd582f Binary files /dev/null and b/images/welcome.tga differ diff --git a/locales/Details-enUS.lua b/locales/Details-enUS.lua index 996187d8..1820fc16 100644 --- a/locales/Details-enUS.lua +++ b/locales/Details-enUS.lua @@ -123,7 +123,7 @@ if not Loc then return end Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"] = "Damage Per Second" Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"] = "Damage Taken" Loc ["STRING_ATTRIBUTE_DAMAGE_FRIENDLYFIRE"] = "Friendly Fire" - + Loc ["STRING_ATTRIBUTE_DAMAGE_FRAGS"] = "Frags" Loc ["STRING_ATTRIBUTE_HEAL"] = "Heal" Loc ["STRING_ATTRIBUTE_HEAL_DONE"] = "Healing Done" diff --git a/locales/Details-ptBR.lua b/locales/Details-ptBR.lua index b1e020c9..1b41c4e0 100644 --- a/locales/Details-ptBR.lua +++ b/locales/Details-ptBR.lua @@ -121,6 +121,7 @@ if not Loc then return end Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"] = "Dano por Segundo" Loc ["STRING_ATTRIBUTE_DAMAGE_TAKEN"] = "Dano Recebido" Loc ["STRING_ATTRIBUTE_DAMAGE_FRIENDLYFIRE"] = "Fogo Amigo" + Loc ["STRING_ATTRIBUTE_DAMAGE_FRAGS"] = "Inimigos Abatidos" Loc ["STRING_ATTRIBUTE_HEAL"] = "Cura" Loc ["STRING_ATTRIBUTE_HEAL_DONE"] = "Cura Feita" @@ -234,6 +235,7 @@ if not Loc then return end Loc ["STRING_REPORT_PREVIOUSFIGHTS"] = "lutas anteriores" Loc ["STRING_REPORT_INVALIDTARGET"] = "O alvo nao pode ser encontrado" Loc ["STRING_NOCLOSED_INSTANCES"] = "Nao ha instancias fechadas,\nclique para abrir uma nova." + --Loc ["STRING_REPORT_FRAG"] = --> report frame diff --git a/plugins/Details_DmgRank/Details_DmgRank.toc b/plugins/Details_DmgRank/Details_DmgRank.toc index 99e69e39..e2f62d34 100644 --- a/plugins/Details_DmgRank/Details_DmgRank.toc +++ b/plugins/Details_DmgRank/Details_DmgRank.toc @@ -1,4 +1,4 @@ -## Interface: 50300 +## Interface: 50400 ## Title: Details DamageRank (plugin) ## Notes: Plugin for Details ## SavedVariablesPerCharacter: _detalhes_databaseDmgRank diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua index df9f5406..2d85708a 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua @@ -229,7 +229,7 @@ end elseif (event[3]) then - local habilidade_school = skillTable [event [2]] --> pegou a tabela com os hex --> aqui 4 + local habilidade_school = skillTable [event [2]] --> pegou a tabela com os hex local _school = "" if (habilidade_school) then @@ -656,7 +656,9 @@ function EncounterDetails:OpenAndRefresh() end barra.icone:SetTexture ("Interface\\AddOns\\Details\\images\\classes_small") - barra.icone:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [jogador.classe])) + if (CLASS_ICON_TCOORDS [jogador.classe]) then + barra.icone:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [jogador.classe])) + end barra:Show() quantidade = quantidade + 1 diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.toc b/plugins/Details_EncounterDetails/Details_EncounterDetails.toc index a28ad87b..60d5523a 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.toc +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.toc @@ -1,4 +1,4 @@ -## Interface: 50300 +## Interface: 50400 ## Title: Details Encounter (plugin) ## Notes: Plugin for Details ## SavedVariablesPerCharacter: _detalhes_databaseEncounterDetails diff --git a/plugins/Details_ErrorReport/Details_ErrorReport.toc b/plugins/Details_ErrorReport/Details_ErrorReport.toc index 081ffbc1..dfa7ca36 100644 --- a/plugins/Details_ErrorReport/Details_ErrorReport.toc +++ b/plugins/Details_ErrorReport/Details_ErrorReport.toc @@ -1,4 +1,4 @@ -## Interface: 50300 +## Interface: 50400 ## Title: Details Error Report ## Notes: This plugin adds a button to Details tooltip where you can report bugs directly to Details Developers. ## RequiredDeps: Details diff --git a/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Details_RaidInfo-SiegeOfOrgrimmar.toc b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Details_RaidInfo-SiegeOfOrgrimmar.toc new file mode 100644 index 00000000..fd808675 --- /dev/null +++ b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Details_RaidInfo-SiegeOfOrgrimmar.toc @@ -0,0 +1,9 @@ +## Interface: 50400 +## Title: Details: Siege of Orgrimmar +## Notes: Plugin for Details +## RequiredDeps: Details + +enUS.lua +ptBR.lua + +SiegeOfOrgrimmar.lua diff --git a/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Libs/AceLocale-3.0/AceLocale-3.0.lua b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Libs/AceLocale-3.0/AceLocale-3.0.lua new file mode 100644 index 00000000..2ecc0cb8 --- /dev/null +++ b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Libs/AceLocale-3.0/AceLocale-3.0.lua @@ -0,0 +1,137 @@ +--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings. +-- @class file +-- @name AceLocale-3.0 +-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $ +local MAJOR,MINOR = "AceLocale-3.0", 6 + +local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR) + +if not AceLocale then return end -- no upgrade needed + +-- Lua APIs +local assert, tostring, error = assert, tostring, error +local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget + +-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded +-- List them here for Mikk's FindGlobals script +-- GLOBALS: GAME_LOCALE, geterrorhandler + +local gameLocale = GetLocale() +if gameLocale == "enGB" then + gameLocale = "enUS" +end + +AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref +AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName" + +-- This metatable is used on all tables returned from GetLocale +local readmeta = { + __index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key + rawset(self, key, key) -- only need to see the warning once, really + geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'") + return key + end +} + +-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys +local readmetasilent = { + __index = function(self, key) -- requesting totally unknown entries: return key + rawset(self, key, key) -- only need to invoke this function once + return key + end +} + +-- Remember the locale table being registered right now (it gets set by :NewLocale()) +-- NOTE: Do never try to register 2 locale tables at once and mix their definition. +local registering + +-- local assert false function +local assertfalse = function() assert(false) end + +-- This metatable proxy is used when registering nondefault locales +local writeproxy = setmetatable({}, { + __newindex = function(self, key, value) + rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string + end, + __index = assertfalse +}) + +-- This metatable proxy is used when registering the default locale. +-- It refuses to overwrite existing values +-- Reason 1: Allows loading locales in any order +-- Reason 2: If 2 modules have the same string, but only the first one to be +-- loaded has a translation for the current locale, the translation +-- doesn't get overwritten. +-- +local writedefaultproxy = setmetatable({}, { + __newindex = function(self, key, value) + if not rawget(registering, key) then + rawset(registering, key, value == true and key or value) + end + end, + __index = assertfalse +}) + +--- Register a new locale (or extend an existing one) for the specified application. +-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players +-- game locale. +-- @paramsig application, locale[, isDefault[, silent]] +-- @param application Unique name of addon / module +-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc. +-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS) +-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used). +-- @usage +-- -- enUS.lua +-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true) +-- L["string1"] = true +-- +-- -- deDE.lua +-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE") +-- if not L then return end +-- L["string1"] = "Zeichenkette1" +-- @return Locale Table to add localizations to, or nil if the current locale is not required. +function AceLocale:NewLocale(application, locale, isDefault, silent) + + -- GAME_LOCALE allows translators to test translations of addons without having that wow client installed + local gameLocale = GAME_LOCALE or gameLocale + + local app = AceLocale.apps[application] + + if silent and app and getmetatable(app) ~= readmetasilent then + geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered") + end + + if not app then + if silent=="raw" then + app = {} + else + app = setmetatable({}, silent and readmetasilent or readmeta) + end + AceLocale.apps[application] = app + AceLocale.appnames[app] = application + end + + if locale ~= gameLocale and not isDefault then + return -- nop, we don't need these translations + end + + registering = app -- remember globally for writeproxy and writedefaultproxy + + if isDefault then + return writedefaultproxy + end + + return writeproxy +end + +--- Returns localizations for the current locale (or default locale if translations are missing). +-- Errors if nothing is registered (spank developer, not just a missing translation) +-- @param application Unique name of addon / module +-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional) +-- @return The locale table for the current language. +function AceLocale:GetLocale(application, silent) + if not silent and not AceLocale.apps[application] then + error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2) + end + return AceLocale.apps[application] +end diff --git a/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Libs/AceLocale-3.0/AceLocale-3.0.xml b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Libs/AceLocale-3.0/AceLocale-3.0.xml new file mode 100644 index 00000000..d69dbb13 --- /dev/null +++ b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/Libs/AceLocale-3.0/AceLocale-3.0.xml @@ -0,0 +1,4 @@ + +