diff --git a/boot.lua b/boot.lua index 1a078729..147e8c10 100644 --- a/boot.lua +++ b/boot.lua @@ -10,8 +10,8 @@ _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners") _detalhes.version = "v1.18.2 (core 20)" - _detalhes.userversion = "v1.18.2" - _detalhes.build_counter = 3 + _detalhes.userversion = "v1.18.3" + _detalhes.build_counter = 5 _detalhes.realversion = 21 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/classes/classe_combate.lua b/classes/classe_combate.lua index f8c3370b..b5624d7f 100644 --- a/classes/classe_combate.lua +++ b/classes/classe_combate.lua @@ -269,7 +269,16 @@ end function combate:seta_tempo_decorrido() - self.end_time = _tempo + if (self.playing_solo) then + local damage_actor = self (1, _detalhes.playername) + if (damage_actor) then + self.end_time = damage_actor.last_event or _tempo + else + self.end_time = _tempo + end + else + self.end_time = _tempo + end end function _detalhes.refresh:r_combate (tabela_combate, shadow) diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index c3a04717..f59f047f 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -223,7 +223,7 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> internals +--> class constructor function atributo_damage:NovaTabela (serial, nome, link) @@ -276,8 +276,6 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> special cases - - -- dps (calculate dps for actors) function atributo_damage:ContainerRefreshDps (container, combat_time) @@ -1503,6 +1501,8 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) meu_tempo = instancia.showing:GetCombatTime() end + --print ("time:", meu_tempo) + --add and sort for _spellid, _skill in _pairs (ActorSkillsContainer) do ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total, _skill.total/meu_tempo} diff --git a/core/control.lua b/core/control.lua index 1a3e73a9..8b14b0d3 100644 --- a/core/control.lua +++ b/core/control.lua @@ -354,6 +354,8 @@ -- ~end function _detalhes:SairDoCombate (bossKilled, from_encounter_end) + --print ("=== Saiu de Combate! ===", _tempo) + if (_detalhes.debug) then _detalhes:Msg ("(debug) ended a combat.") end @@ -829,10 +831,10 @@ --> envia os dados do proprio host pra ele antes if (host_of) then - _detalhes:SendCustomRaidData ("equalize_actors", host_of, nil, data) + _detalhes:SendRaidDataAs (_detalhes.network.ids.CLOUD_EQUALIZE, host_of, nil, data) _detalhes:EqualizeActors() else - _detalhes:SendRaidData ("equalize_actors", data) + _detalhes:SendRaidData (_detalhes.network.ids.CLOUD_EQUALIZE, data) end end diff --git a/core/network.lua b/core/network.lua index 9c0a73e7..af4f6614 100644 --- a/core/network.lua +++ b/core/network.lua @@ -1,321 +1,323 @@ ---File Revision: 1 ---Last Modification: 27/07/2013 --- Change Log: - -- 27/07/2013: Finished alpha version. - +-- + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local _ + + _detalhes.network = {} + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> local pointers + local _UnitName = UnitName local _GetRealmName = GetRealmName local _select = select local _table_wipe = table.wipe local _math_min = math.min local _string_gmatch = string.gmatch - local _ + local _pairs = pairs + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> constants + + local CONST_DETAILS_PREFIX = "DTLS" + + local CONST_HIGHFIVE_REQUEST = "HI" + local CONST_HIGHFIVE_DATA = "HF" + + local CONST_VERSION_CHECK = "CV" + + local CONST_CLOUD_REQUEST = "CR" + local CONST_CLOUD_FOUND = "CF" + local CONST_CLOUD_DATARQ = "CD" + local CONST_CLOUD_DATARC = "CE" + local CONST_CLOUD_EQUALIZE = "EQ" + + _detalhes.network.ids = { + ["HIGHFIVE_REQUEST"] = CONST_HIGHFIVE_REQUEST, + ["HIGHFIVE_DATA"] = CONST_HIGHFIVE_DATA, + ["VERSION_CHECK"] = CONST_VERSION_CHECK, + ["CLOUD_REQUEST"] = CONST_CLOUD_REQUEST, + ["CLOUD_FOUND"] = CONST_CLOUD_FOUND, + ["CLOUD_DATARQ"] = CONST_CLOUD_DATARQ, + ["CLOUD_DATARC"] = CONST_CLOUD_DATARC, + ["CLOUD_EQUALIZE"] = CONST_CLOUD_EQUALIZE, + } + + local plugins_registred = {} + + local temp = {} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> local pointers +--> comm functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - - function _detalhes:CheckDetailsUsers() - - if (true) then --> disabled + function _detalhes.network.HighFive_Request() + return _detalhes:SendRaidData (CONST_HIGHFIVE_DATA, _detalhes.userversion) + end + + function _detalhes.network.HighFive_DataReceived (player, realm, core_version, user_version) + if (_detalhes.sent_highfive and _detalhes.sent_highfive + 30 > GetTime()) then + _detalhes.users [#_detalhes.users+1] = {player, realm, (user_version or "") .. " (" .. core_version .. ")"} + end + end + + function _detalhes.network.Update_VersionReceived (player, realm, core_version, build_number) + if (_detalhes.debug) then + _detalhes:Msg ("(debug) received version alert ", build_number) + end + + if (not _detalhes.build_counter or not _detalhes.lastUpdateWarning or not build_number) then return end - if (IsInRaid()) then - for i = 1, GetNumGroupMembers() do - if (_detalhes.details_users [ _UnitName ("raid"..i)]) then + if (build_number > _detalhes.build_counter) then + if (time() > _detalhes.lastUpdateWarning + 72000) then + local lower_instance = _detalhes:GetLowerInstanceNumber() + if (lower_instance) then + lower_instance = _detalhes:GetInstance (lower_instance) + if (lower_instance) then + lower_instance:InstanceAlert ("Update Available!", {[[Interface\GossipFrame\AvailableQuestIcon]], 16, 16, false}, 60, {_detalhes.OpenUpdateWindow}) + end + end + _detalhes.lastUpdateWarning = time() + end + end + end + + function _detalhes.network.Cloud_Request (player, realm, core_version, ...) + if (_detalhes.debug) then + _detalhes:Msg ("(debug)", player, _detalhes.host_of, _detalhes:CaptureIsAllEnabled(), core_version == _detalhes.realversion) + end + if (player ~= _detalhes.playername) then + if (not _detalhes.host_of and _detalhes:CaptureIsAllEnabled() and core_version == _detalhes.realversion) then + if (realm ~= _GetRealmName()) then + player = player .."-"..realm + end + _detalhes.host_of = player + if (_detalhes.debug) then + _detalhes:Msg ("(debug) sent 'okey' answer for a cloud parser request.") + end + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (_detalhes.network.ids.CLOUD_FOUND, _UnitName ("player"), _GetRealmName(), _detalhes.realversion), "WHISPER", player) + end + end + end + + function _detalhes.network.Cloud_Found (player, realm, core_version, ...) + if (_detalhes.host_by) then + return + end + + if (realm ~= _GetRealmName()) then + player = player .."-"..realm + end + _detalhes.host_by = player + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) cloud found for disabled captures.") + end + + _detalhes.cloud_process = _detalhes:ScheduleRepeatingTimer ("RequestCloudData", 10) + _detalhes.last_data_requested = _detalhes._tempo + end + + function _detalhes.network.Cloud_DataRequest (player, realm, core_version, ...) + if (not _detalhes.host_of) then + return + end + + local atributo, subatributo = player, realm + + local data + local atributo_name = _detalhes:GetInternalSubAttributeName (atributo, subatributo) + + if (atributo == 1) then + data = _detalhes.atributo_damage:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) + elseif (atributo == 2) then + data = _detalhes.atributo_heal:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) + elseif (atributo == 3) then + data = _detalhes.atributo_energy:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) + elseif (atributo == 4) then + data = _detalhes.atributo_misc:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) + else + return + end + + if (data) then + local export = temp + local container = _detalhes.tabela_vigente [atributo]._ActorTable + for i = 1, _math_min (6, #container) do + local actor = container [i] + if (actor.grupo) then + export [#export+1] = {actor.nome, actor [atributo_name]} end end - elseif (IsInGroup()) then - for i = 1, GetNumGroupMembers()-1 do - if (_detalhes.details_users [ _UnitName ("party"..i)]) then + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) requesting data from the cloud.") + end + + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_CLOUD_DATARC, atributo, atributo_name, export), "WHISPER", _detalhes.host_of) + _table_wipe (temp) + end + end + + function _detalhes.network.Cloud_DataReceived (player, realm, core_version, ...) + local atributo, atributo_name, data = player, realm, core_version + + local container = _detalhes.tabela_vigente [atributo] + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) received data from the cloud.") + end + + for i = 1, #data do + local _this = data [i] + + local name = _this [1] + local actor = container:PegarCombatente (nil, name) + + if (not actor) then + if (IsInRaid()) then + for i = 1, GetNumGroupMembers() do + if (name:find ("-")) then --> other realm + local nname, server = _UnitName ("raid"..i) + if (server and server ~= "") then + nname = nname.."-"..server + end + if (nname == name) then + actor = container:PegarCombatente (UnitGUID ("raid"..i), name, 0x514, true) + break + end + else + if (_UnitName ("raid"..i) == name) then + actor = container:PegarCombatente (UnitGUID ("raid"..i), name, 0x514, true) + break + end + end + + end + elseif (IsInGroup()) then + for i = 1, GetNumGroupMembers()-1 do + if (name:find ("-")) then --> other realm + local nname, server = _UnitName ("party"..i) + if (server and server ~= "") then + nname = nname.."-"..server + end + if (nname == name) then + actor = container:PegarCombatente (UnitGUID ("party"..i), name, 0x514, true) + break + end + else + if (_UnitName ("party"..i) == name or _detalhes.playername == name) then + actor = container:PegarCombatente (UnitGUID ("party"..i), name, 0x514, true) + break + end + end + end + end + end + + if (actor) then + actor [atributo_name] = _this [2] + container.need_refresh = true + else + if (_detalhes.debug) then + _detalhes:Msg ("(debug) actor not found on cloud data received", name, atributo_name) end end end end - - local temp = {} - - function _detalhes:RaidComm (_, data, _, source) - local type, player, realm, dversion, arg6, arg7 = _select (2, _detalhes:Deserialize (data)) + function _detalhes.network.Cloud_Equalize (player, realm, core_version, data) + if (not _detalhes.in_combat) then + if (core_version ~= _detalhes.realversion) then + return + end + _detalhes:MakeEqualizeOnActor (player, realm, data) + end + end + + _detalhes.network.functions = { + [CONST_HIGHFIVE_REQUEST] = _detalhes.network.HighFive_Request, + [CONST_HIGHFIVE_DATA] = _detalhes.network.HighFive_DataReceived, + [CONST_VERSION_CHECK] = _detalhes.network.Update_VersionReceived, + + [CONST_CLOUD_REQUEST] = _detalhes.network.Cloud_Request, + [CONST_CLOUD_FOUND] = _detalhes.network.Cloud_Found, + [CONST_CLOUD_DATARQ] = _detalhes.network.Cloud_DataRequest, + [CONST_CLOUD_DATARC] = _detalhes.network.Cloud_DataReceived, + [CONST_CLOUD_EQUALIZE] = _detalhes.network.Cloud_Equalize, + } + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> register comm + + function _detalhes:CommReceived (_, data, _, source) + local type, player, realm, dversion, arg6, arg7, arg8, arg9 = _select (2, _detalhes:Deserialize (data)) if (_detalhes.debug) then _detalhes:Msg ("(debug) network received:", type, "length:",string.len (data)) end - if (type == "highfive") then - - _detalhes:SendRaidData ("highfive_response", _detalhes.userversion) - - elseif (type == "highfive_response") then - - if (_detalhes.sent_highfive and _detalhes.sent_highfive+30 > GetTime()) then - _detalhes.users [#_detalhes.users+1] = {player, realm, (arg6 or "") .. " (" .. dversion .. ")"} - end - - elseif (type == "check_version") then - - local received_version = tonumber (arg6) - - if (_detalhes.debug) then - _detalhes:Msg ("(debug) received version alert ", arg6) - end - - if (not _detalhes.build_counter or not _detalhes.lastUpdateWarning or not received_version) then - return - end - - if (time() > _detalhes.lastUpdateWarning + 72000) then - --print ("received check_version", received_version) - - if (received_version > _detalhes.build_counter) then - local lower_instance = _detalhes:GetLowerInstanceNumber() - if (lower_instance) then - lower_instance = _detalhes:GetInstance (lower_instance) - if (lower_instance) then - lower_instance:InstanceAlert ("Update Available!", {[[Interface\GossipFrame\AvailableQuestIcon]], 16, 16, false}, 60, {function() _detalhes:Msg ("Check curse client to download the newer version.") end}) - end - end - end - - _detalhes.lastUpdateWarning = time() - end - - elseif (type == "petowner") then - - 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()} + local func = _detalhes.network.functions [type] + if (func) then + func (player, realm, dversion, arg6, arg7, arg8, arg9) + else + local t = plugins_registred [type] + if (t) then + func (player, realm, dversion, t[3], arg6, arg7, arg8, arg9) 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 (nil, 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 - - local combat = _detalhes:GetCombat ("current") - combat[1].need_refresh = true - end - end - - elseif (type == "needpetowner") then - - if (dversion ~= _detalhes.realversion) then - return - end - - 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 (_detalhes.debug) then - _detalhes:Msg ("(debug) received pet owner request, sending owner") - end - - _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 - - --local atributo, atributo_name, data = select (3, _detalhes:Deserialize (data)) - local atributo, atributo_name, data = player, realm, dversion - - local container = _detalhes.tabela_vigente [atributo] - - for i = 1, #data do - local _this = data [i] - - local name = _this [1] - local actor = container:PegarCombatente (nil, name) - - if (not actor) then - if (IsInRaid()) then - for i = 1, GetNumGroupMembers() do - if (name:find ("-")) then --> other realm - local nname, server = _UnitName ("raid"..i) - if (server and server ~= "") then - nname = nname.."-"..server - end - if (nname == name) then - actor = container:PegarCombatente (UnitGUID ("raid"..i), name, 0x514, true) - break - end - else - if (_UnitName ("raid"..i) == name) then - actor = container:PegarCombatente (UnitGUID ("raid"..i), name, 0x514, true) - break - end - end - - end - elseif (IsInGroup()) then - for i = 1, GetNumGroupMembers()-1 do - if (name:find ("-")) then --> other realm - local nname, server = _UnitName ("party"..i) - if (server and server ~= "") then - nname = nname.."-"..server - end - if (nname == name) then - actor = container:PegarCombatente (UnitGUID ("party"..i), name, 0x514, true) - break - end - else - if (_UnitName ("party"..i) == name or _detalhes.playername == name) then - actor = container:PegarCombatente (UnitGUID ("party"..i), name, 0x514, true) - break - end - end - end - end - end - - if (actor) then - actor [atributo_name] = _this [2] - container.need_refresh = true - else - if (_detalhes.debug) then - _detalhes:Msg ("(debug) actor not found on cloud data received", name, atributo_name) - end - end - - end - - elseif (type == "clouddatarequest") then - - if (not _detalhes.host_of) then - --> delayed response - return - end - - local atributo, subatributo = player, realm - - local data - local atributo_name = _detalhes:GetInternalSubAttributeName (atributo, subatributo) - - if (atributo == 1) then - data = _detalhes.atributo_damage:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) - elseif (atributo == 2) then - data = _detalhes.atributo_heal:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) - elseif (atributo == 3) then - data = _detalhes.atributo_energy:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) - elseif (atributo == 4) then - data = _detalhes.atributo_misc:RefreshWindow ({}, _detalhes.tabela_vigente, nil, { key = atributo_name, modo = _detalhes.modos.group }) - else - return - end - - if (data) then - local export = temp - local container = _detalhes.tabela_vigente [atributo]._ActorTable - for i = 1, _math_min (6, #container) do - local actor = container [i] - if (actor.grupo) then - export [#export+1] = {actor.nome, actor [atributo_name]} - end - end - - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("clouddatareceived", atributo, atributo_name, export), "WHISPER", _detalhes.host_of) - _table_wipe (temp) - end - - elseif (type == "foundcloud") then - - if (_detalhes.host_by) then - return - end - - if (realm ~= _GetRealmName()) then - player = player .."-"..realm - end - _detalhes.host_by = player - - if (_detalhes.debug) then - _detalhes:Msg ("(debug) cloud found for disabled captures.") - end - - _detalhes.cloud_process = _detalhes:ScheduleRepeatingTimer ("RequestData", 7) - _detalhes.last_data_requested = _detalhes._tempo - - elseif (type == "needcloud") then - - if (_detalhes.debug) then - print (player, _detalhes.host_of, _detalhes:CaptureIsAllEnabled(), dversion == _detalhes.realversion) - end - if (player ~= _detalhes.playername) then - if (not _detalhes.host_of and _detalhes:CaptureIsAllEnabled() and dversion == _detalhes.realversion) then - _detalhes:SendCloudResponse (player, realm) - end - end - - elseif (type == "custom_broadcast") then - _detalhes:OnReceiveCustom (_select (3, _detalhes:Deserialize (data))) - - elseif (type == "equalize_actors") then - - if (not _detalhes.in_combat) then - - local receivedActor = arg6 - - if (dversion ~= _detalhes.realversion) then - return - end - - _detalhes:MakeEqualizeOnActor (player, realm, receivedActor) + _detalhes:Msg ("comm type not found:", type) end end end - _detalhes:RegisterComm ("details_comm", "RaidComm") + _detalhes:RegisterComm ("DTLS", "CommReceived") - function _detalhes:SendCustomRaidData (type, player, realm, ...) + function _detalhes:RegisterPluginComm (name, prefix, func, version) + assert (type (name) == "string" and string.len (name) > 3, "RegisterPluginComm expects a string with at least 4 characters on #1 argument.") + assert (type (prefix) == "string" and string.len (prefix) == 2, "RegisterPluginComm expects a string with 2 characters on #2 argument.") + assert (type (func) == "function", "RegisterPluginComm expects a function on #3 argument.") + assert (plugins_registred [prefix] == nil, "Prefix " .. prefix .. " already in use.") + + plugins_registred [prefix] = {func, name, version} + end + + function _detalhes:UnregisterPluginComm (name) + local prefix + for p, t in _pairs (plugins_registred) do + if (t [2] == name) then + prefix = p + break + end + end + if (prefix) then + plugins_registred [prefix] = nil + end + end + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> send functions + + function _detalhes:SendPluginCommMessage (name, channel, ...) + local prefix + for p, t in _pairs (plugins_registred) do + if (t [2] == name) then + prefix = p + break + end + end + if (prefix) then + + else + self:Msg ("comm not registred:", name) + end + end + + --> send as + function _detalhes:SendRaidDataAs (type, player, realm, ...) if (not realm) then --> check if realm is already inside player name for _name, _realm in _string_gmatch (player, "(%w+)-(%w+)") do @@ -329,92 +331,82 @@ --> doesn't have realm at all, so we assume the actor is in same realm as player realm = _GetRealmName() end - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize (type, player, realm, _detalhes.realversion, ...), "RAID") + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, player, realm, _detalhes.realversion, ...), "RAID") end function _detalhes:SendRaidData (type, ...) if (IsInGroup (LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT") + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT") else - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "RAID") + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "RAID") end end + function _detalhes:SendPartyData (type, ...) if (IsInGroup (LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT") + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT") else - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "PARTY") + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "PARTY") end end + function _detalhes:SendGuildData (type, ...) - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "GUILD") + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "GUILD") end - function _detalhes:SendHighFive() - if (true) then --> disabled - return - end - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("highfive", _UnitName ("player"), _GetRealmName(), _detalhes.realversion), "RAID") - end - - function _detalhes:SendPetOwnerRequest (petserial, petnome) - if (_detalhes.debug) then - _detalhes:Msg ("(debug) sent request for a pet",petserial, petnome) - end - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("needpetowner", _UnitName ("player"), _GetRealmName(), _detalhes.realversion, petserial, petnome), "RAID") + + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> cloud + + function _detalhes:SendCloudRequest() + _detalhes:SendRaidData (_detalhes.network.ids.CLOUD_REQUEST) end function _detalhes:ScheduleSendCloudRequest() _detalhes:ScheduleTimer ("SendCloudRequest", 1) end - function _detalhes:SendCloudRequest() - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("needcloud", _UnitName ("player"), _GetRealmName(), _detalhes.realversion), "RAID") - end - - function _detalhes:SendCloudResponse (player, realm) - if (realm ~= _GetRealmName()) then - player = player .."-"..realm - end - _detalhes.host_of = player - if (_detalhes.debug) then - _detalhes:Msg ("(debug) sent 'okey' answer for a cloud parser request.") - end - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("foundcloud", _UnitName ("player"), _GetRealmName(), _detalhes.realversion), "WHISPER", player) - end - function _detalhes:RequestData() - + function _detalhes:RequestCloudData() _detalhes.last_data_requested = _detalhes._tempo + + if (not _detalhes.host_by) then + return + end for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] - if (instancia.ativa and _detalhes.host_by) then + if (instancia.ativa) then local atributo = instancia.atributo if (atributo == 1 and not _detalhes:CaptureGet ("damage")) then - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("clouddatarequest", atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_CLOUD_DATARQ, atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) break elseif (atributo == 2 and (not _detalhes:CaptureGet ("heal") or _detalhes:CaptureGet ("aura"))) then - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("clouddatarequest", atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_CLOUD_DATARQ, atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) break elseif (atributo == 3 and not _detalhes:CaptureGet ("energy")) then - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("clouddatarequest", atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_CLOUD_DATARQ, atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) break elseif (atributo == 4 and not _detalhes:CaptureGet ("miscdata")) then - _detalhes:SendCommMessage ("details_comm", _detalhes:Serialize ("clouddatarequest", atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) + _detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (CONST_CLOUD_DATARQ, atributo, instancia.sub_atributo), "WHISPER", _detalhes.host_by) break end end end end - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> update - function _detalhes:CheckVersion() + function _detalhes:CheckVersion (send_to_guild) if (IsInRaid()) then - _detalhes:SendRaidData ("check_version", _detalhes.build_counter) + _detalhes:SendRaidData (_detalhes.network.ids.VERSION_CHECK, _detalhes.build_counter) elseif (IsInGroup()) then - _detalhes:SendPartyData ("check_version", _detalhes.build_counter) + _detalhes:SendPartyData (_detalhes.network.ids.VERSION_CHECK, _detalhes.build_counter) + end + + if (send_to_guild) then + _detalhes:SendGuildData (_detalhes.network.ids.VERSION_CHECK, _detalhes.build_counter) end end diff --git a/core/parser.lua b/core/parser.lua index 2cf0791d..0b0dec4b 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -153,13 +153,15 @@ --> check if need start an combat if (not _in_combat) then - if ( token ~= "SPELL_PERIODIC_DAMAGE" and + if ( token ~= "SPELL_PERIODIC_DAMAGE" and ( (who_flags and _bit_band (who_flags, AFFILIATION_GROUP) ~= 0 and _UnitAffectingCombat (who_name) ) or (alvo_flags and _bit_band (alvo_flags, AFFILIATION_GROUP) ~= 0 and _UnitAffectingCombat (alvo_name) ) - )) then - + or + (not _detalhes.in_group and who_flags and _bit_band (who_flags, AFFILIATION_GROUP) ~= 0) + ) + ) then --> não entra em combate se for DOT _detalhes:EntrarEmCombate (who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) end @@ -192,10 +194,6 @@ end - --if (who_name:find ("Guardian of Ancient Kings")) then --remover - -- print ("PARSER:", who_name, este_jogador.nome, este_jogador.owner, meu_dono.nome) - --end - --> his target local jogador_alvo, alvo_dono = damage_cache [alvo_name] or damage_cache_pets [alvo_serial], damage_cache_petsOwners [alvo_serial] @@ -319,14 +317,14 @@ if (meu_dono.end_time) then meu_dono.end_time = nil else - meu_dono:IniciarTempo (_tempo-3.0, meu_dono.shadow) + meu_dono:IniciarTempo (_tempo-2.5, meu_dono.shadow) end end if (este_jogador.end_time) then este_jogador.end_time = nil else - este_jogador:IniciarTempo (_tempo-3.0, este_jogador.shadow) + este_jogador:IniciarTempo (_tempo-2.5, este_jogador.shadow) end if (este_jogador.nome == _detalhes.playername and token ~= "SPELL_PERIODIC_DAMAGE") then --> iniciando o dps do "PLAYER" @@ -521,24 +519,14 @@ ----------------------------------------------------------------------------------------------------------------------------------------- function parser:summon (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellName) - --if (alvo_name == "Guardian of Ancient Kings") then - -- print ("SUMMON", who_name, alvo_serial) - --end - --> pet summon another pet local sou_pet = _detalhes.tabela_pets.pets [who_serial] if (sou_pet) then --> okey, ja é um pet - --if (alvo_name == "Guardian of Ancient Kings") then - -- print ("SUMMON", "inverteu") - --end who_name, who_serial, who_flags = sou_pet[1], sou_pet[2], sou_pet[3] end local alvo_pet = _detalhes.tabela_pets.pets [alvo_serial] if (alvo_pet) then - --if (alvo_name == "Guardian of Ancient Kings") then - -- print ("SUMMON", "inverteu 2") - --end who_name, who_serial, who_flags = alvo_pet[1], alvo_pet[2], alvo_pet[3] end @@ -761,7 +749,7 @@ ------------------------------------------------------------------------------------------------ --> buff uptime if (_recording_buffs_and_debuffs) then - -- jade spirit doesn't send who_name, that's a shame. --print (spellname, who_name, alvo_name) + -- jade spirit doesn't send who_name, that's a shame. if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then --> call record buffs uptime --[[not tail call, need to fix this]] parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_IN") @@ -2003,7 +1991,7 @@ --> procura a última morte do alvo na tabela do combate: for i = 1, #_current_combat.last_events_tables do if (_current_combat.last_events_tables [i] [3] == alvo_name) then - --print ("Adicionando Bres para "..alvo_name) + local deadLog = _current_combat.last_events_tables [i] [1] local jaTem = false for _, evento in _ipairs (deadLog) do @@ -2165,8 +2153,6 @@ --> frags if (_detalhes.only_pvp_frags and (_bit_band (alvo_flags, 0x00000400) == 0 or (_bit_band (alvo_flags, 0x00000040) == 0 and _bit_band (alvo_flags, 0x00000020) == 0))) then --byte 2 = 4 (HOSTILE) byte 3 = 4 (OBJECT_TYPE_PLAYER) - -- 10528 // 66856 - -- print ("recusando actor ",alvo_name, " flag: ", _detalhes:hex (alvo_flags), " sem hex: ", alvo_flags) return end @@ -2228,7 +2214,6 @@ --> 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 @@ -2239,7 +2224,6 @@ --> adiciona a tabela da morte apenas as CURAS recentes if (cura.last_events_table) then for index, tabela in _ipairs (cura.last_events_table) do - --print ("PARSER 3 cura", unpack (tabela)) if (tabela [4]) then if (tabela [4] + 12 > time) then esta_morte [#esta_morte+1] = tabela @@ -2330,8 +2314,6 @@ local t = {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true} - --print ("A morte teve "..#esta_morte.." eventos") - _table_insert (_current_combat.last_events_tables, #_current_combat.last_events_tables+1, t) --> reseta a pool @@ -2345,11 +2327,6 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> core - --test - --function parser:spell_fail (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, error, msg2, msg3) - -- print (token, who_name, spellid, spellname, spellschool, error, msg2, msg3) - --end - local token_list = { -- neutral ["SPELL_SUMMON"] = parser.summon, @@ -2694,6 +2671,13 @@ end function _detalhes.parser_functions:PLAYER_REGEN_ENABLED (...) + + --> playing alone, just finish the combat right now + if (not _IsInGroup() and not IsInRaid()) then + _detalhes.tabela_vigente.playing_solo = true + _detalhes:SairDoCombate() + end + --> aqui, tentativa de fazer o timer da janela do Solo funcionar corretamente: if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop) then @@ -2728,6 +2712,7 @@ instancia:SetCombatAlpha (nil, nil, true) end end + end function _detalhes.parser_functions:ROLE_CHANGED_INFORM (...) @@ -2768,7 +2753,6 @@ _detalhes:CheckSwitchOnLogon() else _detalhes:SchedulePetUpdate (2) - _detalhes:CheckDetailsUsers() end end diff --git a/functions/slash.lua b/functions/slash.lua index 5327de70..eada5321 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -669,7 +669,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "users") then _detalhes.users = {} _detalhes.sent_highfive = GetTime() - _detalhes:SendRaidData ("highfive") + _detalhes:SendRaidData (_detalhes.network.ids.HIGHFIVE_REQUEST) print (Loc ["STRING_DETAILS1"] .. "highfive sent.") elseif (command == "showusers") then diff --git a/locales/Details-enUS.lua b/locales/Details-enUS.lua index 783cd0bc..7c20b389 100644 --- a/locales/Details-enUS.lua +++ b/locales/Details-enUS.lua @@ -8,7 +8,7 @@ if not Loc then return end -- |cFFFFFF00-|r Debug: added early code for test new version checker.\n\n -- |cFFFFFF00-|r An Enemy Damage Taken now can be shown clicking with middle button over a enemy bar.\n\n - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00a1.18.2 (|cFFFFCC00Jul 03, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Possible fix for pre-potion issue.\n\n|cFFFFFF00-|r Added a version checker, it check if there is a new version once per day asking guild or raid members.\n\n|cFFFFFF00-|r An Enemy Damage Taken now can be shown clicking with middle button over a enemy bar.\n\n|cFFFFFF00v1.17.5 (|cFFFFCC00Jun 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Shortcut panel is now known as Bookmarks and a revamp has done on its panel.\n\n|cFFFFFF00-|r NickTag now doesnt check anymore if a received nickname from other guild member is invalid.\n\n|cFFFFFF00-|r Healthstone now is considered a cooldown.\n\n|cFFFFFF00-|r Few improvements on Default Skin, Minimalistic Skin and ElvUI Frame Style Skin.\n\n|cFFFFFF00-|r Revamp on Image Editor, many bugs solves and now it is usable.\n\n|cFFFFFF00-|r 'Hide' slash command now hides all opened windows; 'Show', open all closed windows and 'New' create a new window.\n\n|cFFFFFF00-|r Added Devotion Aura, Rallying Cry as cooldowns.\n\n|cFFFFFF00-|r Added options for lock, unlock, break snap, close, reopen and create new window.\n\n|cFFFFFF00-|r Added a options panel for HotCorners, access it through options button or slash hotcorner command.\n\n|cFFFFFF00-|r Added 'Logos' and 'Raid & Dungeons' sections for Wallpapers. \n\n|cFFFFFF00-|r Added a option to load a image from the computer to use as wallpaper.\n\n|cFFFFFF00-|r Fixed the percent issue with Healing Done and HPS while in combat.\n\n|cFFFFFF00-|r Fixed non-combat switch by role where changing role wasnt changing the shown attribute.\n\n|cFFFFFF00-|r Fixed 'While in Combat' hiding schema |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed several bugs on Interact Auto Transparency.\n\n|cFFFFFF00-|r Fixed the report window alert when opening the report window and it already is opened |cFF999999(thanks @Rasstapp-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the gap between last row created and the end of the window.\n\n|cFFFFFF00-|r Fixed all tooltips bugs on Wallpaper Section on Options Panel.\n\n|cFFFFFF00a1.17.0 (|cFFFFCC00Jun 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Support for Custom Displays has been rewrited, to access the new panel go to Sword Menu -> Custom -> Create New Display.\n\n|cFFFFFF00-|r Added a custom display for show potion usage.\n\n|cFFFFFF00-|r Fixed a bug where the player pet wasnt being tracked after logon in the game. This bug was affecting directly classes with pets playing out of a raid group.\n\n|cFFFFFF00-|r Fixed the report bug on healing, energy and misc attributes |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00a1.16.0 - a1.16.1 - a1.16.3b (|cFFFFCC00Jun 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed row creation while resizing where sometimes it was broking the last row in the window.\n\n|cFFFFFF00-|r Fixed small involuntary resizes after resizing a window. |cFF999999(thanks @Morimvudu-Nemesis)|r\n\n|cFFFFFF00-|r Fixed frame strata after stretching the window where was setting its strata to Medium.\n\n|cFFFFFF00-|r Fixed Vanguard strata where it wasnt following the strata from its host window.\n\n|cFFFFFF00-|r Mode menu now have a sub menu for raid plugins.\n\n|cFFFFFF00-|r Red and Green colors under comparison frame has been inverted. |cFF999999(thanks @skmzarn-mmochampion forum)|r\n\n|cFFFFFF00-|r Fixed some report issues with dps and hps, also almost all reports now have guide lines. |cFF999999(thanks @sosleapy-mmochampion forum)|r\n\n|cFFFFFF00-|r Pet dispell and interrupt count also for its owner as well. |cFF999999(thanks @skmzarn-mmochampion forum)|r\n\n|cFFFFFF00-|r Few fixes on comparison panel over Player Details Window.\n\n|cFFFFFF00-|r Added option to be able to save the windows size and position within the profile. |cFF999999(thanks @Torchler-mmochampion forum)|r\n\n|cFFFFFF00-|r Added performance profile settings. |cFF999999(thanks @SlippyCheeze-mmochampion forum)|r\n\n|cFFFFFF00-|r Added auto switch based on group roles also a switch for wipe. |cFF999999(thanks @SlippyCheeze-mmochampion forum)|r\n\n|cFFFFFF00-|r Fixed a bug where sometimes all non boss segments was considered boss encounters.\n\n|cFFFFFF00v1.15.4 (|cFFFFCC00Jun 06, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a compare tab under Player Details Window:\nThis new tab showns up when there is too characters with the same class and spec.\nIts useful to compare skills used, uptimes and targets.\n\n|cFFFFFF00-|r Few improvements on Default and ElvUI skins.\n\n|cFFFFFF00-|r Added a button for auto align two windows within right chat window when ElvUI skin is active.\n\n|cFFFFFF00-|r Fixed problem with Damage -> Enemies display.\n\n|cFFFFFF00-|r Fixed report Player Detail Window report buttons.\n\n|cFFFFFF00-|r Fixed some report lines where the numbers wasnt properly formatted.\n\n|cFFFFFF00-|r Fixed a rare bug where the owner of some pets wasnt detected.\n\n|cFFFFFF00-|r Fixed issue in dungeons where capture data get paused after a boss kill.\n\n|cFFFFFF00-|r Fixed issue with Encounter Details showing its icon for dungeons bosses.\n\n|cFFFFFF00-|r Fixed a rare bug where the capture of damage stops after erasing a trash segment.\n\n|cFFFFFF00v1.15.0 - v1.15.3 - v1.15.3b (|cFFFFCC00Jun 03, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Emergencial fix for death logs which sometimes was breaking the addon data capture.\n\n|cFFFFFF00-|r Fixed window alerts which was showing behind the bars.\n\n|cFFFFFF00-|r Fixed death log issue with friendly fire hits.\n\n|cFFFFFF00-|r Fixed a issue where Details! windows wasn't hidden when a pet battle starts.\n\n|cFFFFFF00-|r Fixed a issue with segments menu when a window is placed on the right side of the screen.\n\n|cFFFFFF00-|r Damage -> Enemies now also show neutral creatures.\n\n|cFFFFFF00-|r Added support to dungeons, bosses and trash mobs are now recognized.\n\n|cFFFFFF00-|r Added target information for each spell in Player Detail Window.\n\n|cFFFFFF00-|r Added options for change the location of tooltips.\n\n|cFFFFFF00-|r Added options for change the Overall Data functionality.\n\n|cFFFFFF00-|r Added tooltips for lock and detach buttons.\n\n|cFFFFFF00-|r Added new row texture: Details Vidro.\n\n|cFFFFFF00-|r Revamp on death log tooltips.\n\n|cFFFFFF00-|r Improved the visual effect for the instance which current moving window can snap to.\n\n|cFFFFFF00v1.14.5 - 1.14.6 (|cFFFFCC00May 24, 2014|r|cFFFFFF00):|r\n\n|cFFFFFF00-|r Added option for lock segments display, so, when a segment is chosen, the other windows also change it.\n\n|cFFFFFF00-|r Added option for show the total amount of spells, targets and pets in tooltips.\n\n|cFFFFFF00-|r Finished another revamp on options panel.\n\n|cFFFFFF00-|r Now its possible open more then 1 Raid Plugins at once on diferent windows.\n\n|cFFFFFF00-|r Added a large text editor for make changes on custom texts.\n\n|cFFFFFF00-|r Added new option for enable borders on the bars.\n\n|cFFFFFF00-|r Added Death Barrier as a absorb spell.\n\n|cFFFFFF00-|r Fixed a bug on overheal tooltip where was showing the Hps instead of overheal.\n\n|cFFFFFF00v1.14.0 - v1.14.0b (|cFFFFCC00May 17, 2014|r|cFFFFFF00):\n\n|cFFFFFF00-|r Added a new tab on options panel for tooltip configuration.\n\n|cFFFFFF00-|r Added a new tab on options panel for broker config." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00a1.18.2 (|cFFFFCC00Jul 03, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed dps inacuracy when outside a party or raid group.\n\n|cFFFFFF00-|r Possible fix for pre-potion issue.\n\n|cFFFFFF00-|r Added a version checker, it check if there is a new version once per day.\n\n|cFFFFFF00-|r An Enemy Damage Taken now can be shown clicking with middle button over a enemy bar.\n\n|cFFFFFF00v1.17.5 (|cFFFFCC00Jun 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Shortcut panel is now known as Bookmarks and a revamp has done on its panel.\n\n|cFFFFFF00-|r NickTag now doesnt check anymore if a received nickname from other guild member is invalid.\n\n|cFFFFFF00-|r Healthstone now is considered a cooldown.\n\n|cFFFFFF00-|r Few improvements on Default Skin, Minimalistic Skin and ElvUI Frame Style Skin.\n\n|cFFFFFF00-|r Revamp on Image Editor, many bugs solves and now it is usable.\n\n|cFFFFFF00-|r 'Hide' slash command now hides all opened windows; 'Show', open all closed windows and 'New' create a new window.\n\n|cFFFFFF00-|r Added Devotion Aura, Rallying Cry as cooldowns.\n\n|cFFFFFF00-|r Added options for lock, unlock, break snap, close, reopen and create new window.\n\n|cFFFFFF00-|r Added a options panel for HotCorners, access it through options button or slash hotcorner command.\n\n|cFFFFFF00-|r Added 'Logos' and 'Raid & Dungeons' sections for Wallpapers. \n\n|cFFFFFF00-|r Added a option to load a image from the computer to use as wallpaper.\n\n|cFFFFFF00-|r Fixed the percent issue with Healing Done and HPS while in combat.\n\n|cFFFFFF00-|r Fixed non-combat switch by role where changing role wasnt changing the shown attribute.\n\n|cFFFFFF00-|r Fixed 'While in Combat' hiding schema |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed several bugs on Interact Auto Transparency.\n\n|cFFFFFF00-|r Fixed the report window alert when opening the report window and it already is opened |cFF999999(thanks @Rasstapp-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the gap between last row created and the end of the window.\n\n|cFFFFFF00-|r Fixed all tooltips bugs on Wallpaper Section on Options Panel.\n\n|cFFFFFF00a1.17.0 (|cFFFFCC00Jun 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Support for Custom Displays has been rewrited, to access the new panel go to Sword Menu -> Custom -> Create New Display.\n\n|cFFFFFF00-|r Added a custom display for show potion usage.\n\n|cFFFFFF00-|r Fixed a bug where the player pet wasnt being tracked after logon in the game. This bug was affecting directly classes with pets playing out of a raid group.\n\n|cFFFFFF00-|r Fixed the report bug on healing, energy and misc attributes |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00a1.16.0 - a1.16.1 - a1.16.3b (|cFFFFCC00Jun 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed row creation while resizing where sometimes it was broking the last row in the window.\n\n|cFFFFFF00-|r Fixed small involuntary resizes after resizing a window. |cFF999999(thanks @Morimvudu-Nemesis)|r\n\n|cFFFFFF00-|r Fixed frame strata after stretching the window where was setting its strata to Medium.\n\n|cFFFFFF00-|r Fixed Vanguard strata where it wasnt following the strata from its host window.\n\n|cFFFFFF00-|r Mode menu now have a sub menu for raid plugins.\n\n|cFFFFFF00-|r Red and Green colors under comparison frame has been inverted. |cFF999999(thanks @skmzarn-mmochampion forum)|r\n\n|cFFFFFF00-|r Fixed some report issues with dps and hps, also almost all reports now have guide lines. |cFF999999(thanks @sosleapy-mmochampion forum)|r\n\n|cFFFFFF00-|r Pet dispell and interrupt count also for its owner as well. |cFF999999(thanks @skmzarn-mmochampion forum)|r\n\n|cFFFFFF00-|r Few fixes on comparison panel over Player Details Window.\n\n|cFFFFFF00-|r Added option to be able to save the windows size and position within the profile. |cFF999999(thanks @Torchler-mmochampion forum)|r\n\n|cFFFFFF00-|r Added performance profile settings. |cFF999999(thanks @SlippyCheeze-mmochampion forum)|r\n\n|cFFFFFF00-|r Added auto switch based on group roles also a switch for wipe. |cFF999999(thanks @SlippyCheeze-mmochampion forum)|r\n\n|cFFFFFF00-|r Fixed a bug where sometimes all non boss segments was considered boss encounters.\n\n|cFFFFFF00v1.15.4 (|cFFFFCC00Jun 06, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a compare tab under Player Details Window:\nThis new tab showns up when there is too characters with the same class and spec.\nIts useful to compare skills used, uptimes and targets.\n\n|cFFFFFF00-|r Few improvements on Default and ElvUI skins.\n\n|cFFFFFF00-|r Added a button for auto align two windows within right chat window when ElvUI skin is active.\n\n|cFFFFFF00-|r Fixed problem with Damage -> Enemies display.\n\n|cFFFFFF00-|r Fixed report Player Detail Window report buttons.\n\n|cFFFFFF00-|r Fixed some report lines where the numbers wasnt properly formatted.\n\n|cFFFFFF00-|r Fixed a rare bug where the owner of some pets wasnt detected.\n\n|cFFFFFF00-|r Fixed issue in dungeons where capture data get paused after a boss kill.\n\n|cFFFFFF00-|r Fixed issue with Encounter Details showing its icon for dungeons bosses.\n\n|cFFFFFF00-|r Fixed a rare bug where the capture of damage stops after erasing a trash segment.\n\n|cFFFFFF00v1.15.0 - v1.15.3 - v1.15.3b (|cFFFFCC00Jun 03, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Emergencial fix for death logs which sometimes was breaking the addon data capture.\n\n|cFFFFFF00-|r Fixed window alerts which was showing behind the bars.\n\n|cFFFFFF00-|r Fixed death log issue with friendly fire hits.\n\n|cFFFFFF00-|r Fixed a issue where Details! windows wasn't hidden when a pet battle starts.\n\n|cFFFFFF00-|r Fixed a issue with segments menu when a window is placed on the right side of the screen.\n\n|cFFFFFF00-|r Damage -> Enemies now also show neutral creatures.\n\n|cFFFFFF00-|r Added support to dungeons, bosses and trash mobs are now recognized.\n\n|cFFFFFF00-|r Added target information for each spell in Player Detail Window.\n\n|cFFFFFF00-|r Added options for change the location of tooltips.\n\n|cFFFFFF00-|r Added options for change the Overall Data functionality.\n\n|cFFFFFF00-|r Added tooltips for lock and detach buttons.\n\n|cFFFFFF00-|r Added new row texture: Details Vidro.\n\n|cFFFFFF00-|r Revamp on death log tooltips.\n\n|cFFFFFF00-|r Improved the visual effect for the instance which current moving window can snap to.\n\n|cFFFFFF00v1.14.5 - 1.14.6 (|cFFFFCC00May 24, 2014|r|cFFFFFF00):|r\n\n|cFFFFFF00-|r Added option for lock segments display, so, when a segment is chosen, the other windows also change it.\n\n|cFFFFFF00-|r Added option for show the total amount of spells, targets and pets in tooltips.\n\n|cFFFFFF00-|r Finished another revamp on options panel.\n\n|cFFFFFF00-|r Now its possible open more then 1 Raid Plugins at once on diferent windows.\n\n|cFFFFFF00-|r Added a large text editor for make changes on custom texts.\n\n|cFFFFFF00-|r Added new option for enable borders on the bars.\n\n|cFFFFFF00-|r Added Death Barrier as a absorb spell.\n\n|cFFFFFF00-|r Fixed a bug on overheal tooltip where was showing the Hps instead of overheal.\n\n|cFFFFFF00v1.14.0 - v1.14.0b (|cFFFFCC00May 17, 2014|r|cFFFFFF00):\n\n|cFFFFFF00-|r Added a new tab on options panel for tooltip configuration.\n\n|cFFFFFF00-|r Added a new tab on options panel for broker config." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails:|r " --> color and details name diff --git a/startup.lua b/startup.lua index 4db9298d..bb5e97e8 100644 --- a/startup.lua +++ b/startup.lua @@ -175,8 +175,6 @@ function _G._detalhes:Start() self.details_users = {} self.in_group = IsInGroup() or IsInRaid() - _detalhes:SendGuildData ("check_version", _detalhes.build_counter) - --> done self.initializing = nil @@ -209,7 +207,7 @@ function _G._detalhes:Start() end --> check version - _detalhes:CheckVersion() + _detalhes:CheckVersion (true) --> restore cooltip anchor position DetailsTooltipAnchor:Restore() @@ -251,8 +249,7 @@ function _G._detalhes:Start() feedback_frame.uppertext:SetFont (font, 10, flags) feedback_frame.uppertext:SetTextColor (1, 1, 1, .8) feedback_frame.uppertext:SetWidth (440) - - + local editbox = _detalhes.gump:NewTextEntry (feedback_frame, nil, "$parentTextEntry", "text", 387, 14) editbox:SetPoint (20, -106) editbox:SetAutoFocus (false) @@ -950,5 +947,70 @@ function _G._detalhes:Start() --BNSendFriendInvite ("tercio#1488") + function _detalhes:OpenUpdateWindow() + + if (not _G.DetailsUpdateDialog) then + local updatewindow_frame = CreateFrame ("frame", "DetailsUpdateDialog", UIParent, "ButtonFrameTemplate") + updatewindow_frame:SetFrameStrata ("LOW") + tinsert (UISpecialFrames, "DetailsUpdateDialog") + updatewindow_frame:SetPoint ("center", UIParent, "center") + updatewindow_frame:SetSize (512, 200) + updatewindow_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]]) + + updatewindow_frame.TitleText:SetText ("A New Version Is Available!") + + updatewindow_frame.midtext = updatewindow_frame:CreateFontString (nil, "artwork", "GameFontNormal") + updatewindow_frame.midtext:SetText ("Good news everyone!\nA new version has been forged and is waiting to be looted.") + updatewindow_frame.midtext:SetPoint ("topleft", updatewindow_frame, "topleft", 10, -90) + updatewindow_frame.midtext:SetJustifyH ("center") + updatewindow_frame.midtext:SetWidth (370) + + updatewindow_frame.gnoma = updatewindow_frame:CreateTexture (nil, "artwork") + updatewindow_frame.gnoma:SetPoint ("topright", updatewindow_frame, "topright", -3, -59) + updatewindow_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2") + updatewindow_frame.gnoma:SetSize (105*1.05, 107*1.05) + updatewindow_frame.gnoma:SetTexCoord (0.2021484375, 0, 0.7919921875, 1) + + local editbox = _detalhes.gump:NewTextEntry (updatewindow_frame, nil, "$parentTextEntry", "text", 387, 14) + editbox:SetPoint (20, -136) + editbox:SetAutoFocus (false) + editbox:SetHook ("OnEditFocusGained", function() + editbox.text = "http://www.curse.com/addons/wow/details" + editbox:HighlightText() + end) + editbox:SetHook ("OnEditFocusLost", function() + editbox.text = "http://www.curse.com/addons/wow/details" + editbox:HighlightText() + end) + editbox:SetHook ("OnChar", function() + editbox.text = "http://www.curse.com/addons/wow/details" + editbox:HighlightText() + end) + editbox.text = "http://www.curse.com/addons/wow/details" + + updatewindow_frame.close = CreateFrame ("Button", "DetailsUpdateDialogCloseButton", updatewindow_frame, "OptionsButtonTemplate") + updatewindow_frame.close:SetPoint ("bottomleft", updatewindow_frame, "bottomleft", 8, 4) + updatewindow_frame.close:SetText ("Close") + + updatewindow_frame.close:SetScript ("OnClick", function (self) + DetailsUpdateDialog:Hide() + editbox:ClearFocus() + end) + + updatewindow_frame:SetScript ("OnHide", function() + editbox:ClearFocus() + end) + + function _detalhes:UpdateDialogSetFocus() + DetailsUpdateDialog:Show() + DetailsUpdateDialogTextEntry.MyObject:SetFocus() + DetailsUpdateDialogTextEntry.MyObject:HighlightText() + end + _detalhes:ScheduleTimer ("UpdateDialogSetFocus", 1) + + end + + end + end