From 5fea5b238dfa3def4c9ea8d2d37f99085cd65871 Mon Sep 17 00:00:00 2001 From: tercio Date: Wed, 2 Jul 2014 20:40:23 -0300 Subject: [PATCH] - Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar. - Implemented code for early tests with new version checker. - Renamed option menu "externals" to "Data Feed". --- boot.lua | 6 +- classes/classe_custom.lua | 50 ++++++++- classes/classe_damage.lua | 7 ++ classes/classe_instancia.lua | 7 +- classes/classe_others.lua | 30 ++++- core/control.lua | 5 + core/network.lua | 210 ++++++++++++++++++++++++++++++++++- functions/slash.lua | 26 +++++ gumps/janela_custom.lua | 174 +---------------------------- gumps/janela_info.lua | 4 +- gumps/janela_options.lua | 8 +- gumps/janela_principal.lua | 40 ++++++- locales/Details-enUS.lua | 10 +- startup.lua | 3 + 14 files changed, 387 insertions(+), 193 deletions(-) diff --git a/boot.lua b/boot.lua index 258709bb..e3ec460f 100644 --- a/boot.lua +++ b/boot.lua @@ -8,8 +8,10 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners") - _detalhes.userversion = "v1.18.0a" - _detalhes.version = "Alpha 020" + + _detalhes.version = "v1.18.1 (core 20)" + _detalhes.userversion = "v1.18.1" + _detalhes.build_counter = 1 _detalhes.realversion = 20 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 6481838d..f9050fec 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -1124,9 +1124,55 @@ end function atributo_custom:IsSpellTarget() return self.spellid and self.target and true end - + + function atributo_custom:RemoveCustom (index) + + if (not _detalhes.tabela_instancias) then + --> do not remove customs while the addon is loading. + return + end + + table.remove (_detalhes.custom, index) + + for _, instance in _ipairs (_detalhes.tabela_instancias) do + if (instance.atributo == 5 and instance.sub_atributo == index) then + instance:ResetAttribute() + elseif (instance.atributo == 5 and instance.sub_atributo > index) then + instance.sub_atributo = instance.sub_atributo - 1 + instance.sub_atributo_last [5] = 1 + else + instance.sub_atributo_last [5] = 1 + end + end + + _detalhes.switch:OnRemoveCustom (index) + end + function _detalhes.refresh:r_atributo_custom() - for _, custom_object in _ipairs (_detalhes.custom) do + + --> check for non used temp displays + if (_detalhes.tabela_instancias) then + for i = #_detalhes.custom, 1, -1 do + local custom_object = _detalhes.custom [i] + if (custom_object.temp) then + --> check if there is a instance showing this custom + local showing = false + + for index, instance in _ipairs (_detalhes.tabela_instancias) do + if (instance.atributo == 5 and instance.sub_atributo == i) then + showing = true + end + end + + if (not showing) then + atributo_custom:RemoveCustom (i) + end + end + end + end + + --> restore metatable and indexes + for index, custom_object in _ipairs (_detalhes.custom) do _setmetatable (custom_object, atributo_custom) custom_object.__index = atributo_custom end diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index ac3b03c5..c3a04717 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -1691,6 +1691,13 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end + --> enemies + if (instancia.sub_atributo == 6) then + GameCooltip:AddLine (" ") + GameCooltip:AddLine ("|cFFFFCC00middle button|r: real-time damage taken") + GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 14/512, 64/512, 127/512, 204/512) + end + return true end diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index b4dbdc3e..9d7f7675 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -2011,7 +2011,12 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:AddMenu (2, _detalhes.OpenCustomDisplayWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], "Interface\\PaperDollInfoFrame\\Character-Plus", true) for index, custom in _ipairs (_detalhes.custom) do - CoolTip:AddLine (custom.name, nil, 2) + if (custom.temp) then + CoolTip:AddLine (custom.name .. Loc ["STRING_CUSTOM_TEMPORARILY"], nil, 2) + else + CoolTip:AddLine (custom.name, nil, 2) + end + CoolTip:AddMenu (2, func, true, 5, index) CoolTip:AddIcon (custom.icon, 2, 1, 16, 16) end diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 4a2a717e..441cdd68 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -1217,10 +1217,23 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (_IsInRaid()) then local pot_usage = {} + local pot_usage_test = {} for raidIndex = 1, _GetNumGroupMembers() do for buffIndex = 1, 41 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("raid"..raidIndex, buffIndex, nil, "HELPFUL") + + if (in_or_out == "BUFF_UPTIME_IN") then + if (_detalhes.PotionList [spellid]) then + print ("Pre Potion Found on raidIndex", raidIndex, unitCaster, spellid) + local playerName, realmName = _UnitName ("raid"..raidIndex) + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + pot_usage_test [playerName] = spellid + end + end + --print (name, unitCaster, "==", "raid"..raidIndex) if (name and unitCaster == "raid"..raidIndex) then @@ -1243,7 +1256,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end end - --> i don't remmember why do we iterate through the player again. + --> unitCaster return player instead of raidIndex for buffIndex = 1, 41 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") if (name and unitCaster == "player") then @@ -1262,17 +1275,24 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end if (in_or_out == "BUFF_UPTIME_IN") then - - local string_output = "pre-potion: " + + local string_output = "pre-potion raw: " + for playername, potspellid in _pairs (pot_usage_test) do + local name, _, icon = _GetSpellInfo (potspellid) + local _, class = UnitClass (playername) + local class_color = RAID_CLASS_COLORS [class].colorStr + string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t " + end + _detalhes.debug_pots1 = string_output + local string_output = "pre-potion: " for playername, potspellid in _pairs (pot_usage) do local name, _, icon = _GetSpellInfo (potspellid) local _, class = UnitClass (playername) local class_color = RAID_CLASS_COLORS [class].colorStr string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t " end - - _detalhes:Msg (string_output) + _detalhes.debug_pots2 = string_output end diff --git a/core/control.lua b/core/control.lua index 82239cba..1a3e73a9 100644 --- a/core/control.lua +++ b/core/control.lua @@ -461,6 +461,11 @@ if (_detalhes.tabela_vigente.instance_type == "raid") then _detalhes.last_encounter2 = _detalhes.last_encounter _detalhes.last_encounter = _detalhes.tabela_vigente.is_boss.name + + --debug + _detalhes:Msg (_detalhes.debug_pots1 or "") + _detalhes:Msg (_detalhes.debug_pots2 or "") + end if (bossKilled) then diff --git a/core/network.lua b/core/network.lua index 80f299ac..809f85fd 100644 --- a/core/network.lua +++ b/core/network.lua @@ -361,4 +361,212 @@ end end end - end \ No newline at end of file + end + + + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> update + + function _detalhes:CheckVersion() + + local room_name = "DetailsVCheck" + + local CONST_VERSION_CHECK = "VCHECK" + local CONST_VERSION = "VERSION" + local CONST_SEND_OWNER = "SOWNER" + local CONST_OWNER_OUTDATE = "OWNEROUT" + + local waiting_version = false + local waiting_owner = false + + --entrar na sala + JoinChannelByName (room_name) + + function _detalhes:GetChannelId() + local list = {GetChannelList()} + for i = 1, #list, 2 do + if (list [i+1] == room_name) then + return list [i] + end + end + return nil + end + + function _detalhes:GetChannelInternalId() + for id = 1, GetNumDisplayChannels() do + local name = GetChannelDisplayInfo (id) + if (name == room_name) then + return id + end + end + end + + function _detalhes:IamOwner() + + local channel_id = _detalhes:GetChannelId() + local channel_id_internal = _detalhes:GetChannelInternalId() + + if (not channel_id or not channel_id_internal) then + return + end + + SetSelectedDisplayChannel (channel_id) + + local name, _, _, _, count = GetChannelDisplayInfo (channel_id_internal) + + if (name ~= room_name) then + return + end + + for i = 1, count do + local name, owner = GetChannelRosterInfo (channel_id_internal, i) + + if (name and name == _detalhes.playername) then + return owner + end + end + end + + function _detalhes:LeaveChannel (force_leave) + if (_detalhes:IamOwner() and not force_leave) then + if (_detalhes.debug) then + _detalhes:Msg ("(debug) fail to leave the channel, we are the owner.") + end + return + end + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) leaving the update channel.") + end + + LeaveChannelByName (room_name) + end + + function _detalhes:CheckVersionChannel() + + local channel_id = _detalhes:GetChannelId() + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) requesting version on update channel: ", channel_id) + end + + if (not channel_id) then + return + end + + waiting_version = true + SendChatMessage (room_name .. CONST_VERSION_CHECK .. " " .. _detalhes.build_counter, "CHANNEL", nil, channel_id) + end + + _detalhes:ScheduleTimer ("CheckVersionChannel", 4) + + self.listener:RegisterEvent ("CHAT_MSG_CHANNEL") + function _detalhes.parser_functions:CHAT_MSG_CHANNEL (...) + + local channel_id = _detalhes:GetChannelId() + + if (not channel_id) then + return + end + + local message, sender, language, channelString, target, flags, unknown, channelNumber, channelName, unknown, counter, guid = ... + + if (channelName == room_name) then + local key, value, extra = message:gsub (room_name, ""):match ("^(%S*)%s*(.-)$") + value, extra = value:match ("^(%S*)%s*(.-)$") + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) update channel received command: ", key, value, extra) + end + + --> send version + if (key == CONST_VERSION_CHECK) then + if (_detalhes:IamOwner()) then + if (IsInRaid() or IsInGroup()) then + SendChatMessage (room_name .. CONST_VERSION .. " " .. _detalhes.build_counter .. " 1", "CHANNEL", nil, channel_id) + waiting_owner = true + if (_detalhes.debug) then + _detalhes:Msg ("(debug) version sent (we need a new owner).") + end + else + SendChatMessage (room_name .. CONST_VERSION .. " " .. _detalhes.build_counter, "CHANNEL", nil, channel_id) + if (_detalhes.debug) then + _detalhes:Msg ("(debug) version sent.") + end + end + end + + elseif (key == CONST_VERSION and waiting_version) then + waiting_version = false + value = tonumber (value) + + if (value > _detalhes.build_counter) then + --> nova versao encontrada + -- avisar o jogador + _detalhes:ScheduleTimer ("LeaveChannel", 5) + + 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 + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) found a new version.") + end + + elseif (value == _detalhes.build_counter) then + --> mesma versao + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) no newer version found.") + end + + if (extra and tonumber (extra)) then + if (not IsInRaid() and not IsInGroup()) then + if (_detalhes.debug) then + _detalhes:Msg ("(debug) owner need to leave, we can be the new owner.") + end + SendChatMessage (room_name .. CONST_SEND_OWNER, "CHANNEL", nil, channel_id) + end + end + + _detalhes:ScheduleTimer ("LeaveChannel", 10) + + elseif (value < _detalhes.build_counter) then + --> a versao do owner esta desatualizada + SendChatMessage (room_name .. CONST_OWNER_OUTDATE, "CHANNEL", nil, channel_id) + if (_detalhes.debug) then + _detalhes:Msg ("(debug) owner have a out date version, warning him.") + end + end + + elseif (key == CONST_SEND_OWNER) then + if (_detalhes:IamOwner() and waiting_owner) then + SetChannelOwner (room_name, sender) + waiting_owner = false + _detalhes:ScheduleTimer ("LeaveChannel", 5) + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) we found a new owner, leaving the channel.") + end + end + + elseif (key == CONST_OWNER_OUTDATE) then + if (_detalhes:IamOwner()) then + _detalhes:ScheduleTimer ("LeaveChannel", 5, true) + if (_detalhes.debug) then + _detalhes:Msg ("(debug) Oh ho, we are owner and our version is old, leaving...") + end + end + + end + + end + end + + end + diff --git a/functions/slash.lua b/functions/slash.lua index 39774269..5327de70 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -79,6 +79,10 @@ function SlashCmdList.DETAILS (msg, editbox) -------- debug --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + elseif (msg == "chatmsg") then + + SendChatMessage("[RCELVA]"..RC.version.."_"..id.."_announce_"..time().."_", "CHANNEL", nil, RC:getChanID(GetChannelList())) + elseif (msg == "chaticon") then _detalhes:Msg ("|TInterface\\AddOns\\Details\\images\\icones_barra:" .. 14 .. ":" .. 14 .. ":0:0:256:32:0:32:0:32|tteste") @@ -245,6 +249,28 @@ function SlashCmdList.DETAILS (msg, editbox) print ("GetTime()", GetTime()) print ("time()", time()) + elseif (msg == "buffs") then + + for buffIndex = 1, 41 do + + --local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("player", buffIndex, nil, "HELPFUL") + --if (name) then + -- print (name, unitCaster, spellid) + --end + + local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("raid1", buffIndex, nil, "HELPFUL") + if (name) then + print (name, unitCaster, spellid) + end + + local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("raid2", buffIndex, nil, "HELPFUL") + if (name) then + print (name, unitCaster, spellid) + end + + end + + elseif (msg == "malkorok") then print ("nome | count | unitCaster | spellId | isBossDebuff | value1 | value2 | value3") diff --git a/gumps/janela_custom.lua b/gumps/janela_custom.lua index 9cadf8c0..5a671178 100644 --- a/gumps/janela_custom.lua +++ b/gumps/janela_custom.lua @@ -1456,176 +1456,4 @@ _G.DetailsCustomPanel:Show() end end - - --[[ ---init: -local combat, instance_container, instance = ... -local total, top, amount = 0, 0, 0 - ---get the misc actor container -local misc_container = combat:GetActorList ( DETAILS_ATTRIBUTE_MISC ) - ---do the loop: -for _, player in ipairs ( misc_container ) do - - --only player in group - if (player:IsGroupPlayer()) then - - local found_potion = false - - --get the spell debuff uptime container - local debuff_uptime_container = player.debuff_uptime and player.debuff_uptime_spell_tables and player.debuff_uptime_spell_tables._ActorTable - if (debuff_uptime_container) then - --potion of focus (can't use as pre-potion, so, its amount is always 1) - local focus_potion = debuff_uptime_container [105701] - if (focus_potion) then - total = total + 1 - found_potion = true - if (top < 1) then - top = 1 - end - --add amount to the player - instance_container:AddValue (player, 1) - end - end - - --get the spell buff uptime container - local buff_uptime_container = player.buff_uptime and player.buff_uptime_spell_tables and player.buff_uptime_spell_tables._ActorTable - if (buff_uptime_container) then - - --potion of the jade serpent - local jade_serpent_potion = buff_uptime_container [105702] - if (jade_serpent_potion) then - local used = jade_serpent_potion.activedamt - if (used > 0) then - total = total + used - found_potion = true - if (used > top) then - top = used - end - --add amount to the player - instance_container:AddValue (player, used) - end - end - - --potion of mogu power - local mogu_power_potion = buff_uptime_container [105706] - if (mogu_power_potion) then - local used = mogu_power_potion.activedamt - if (used > 0) then - total = total + used - found_potion = true - if (used > top) then - top = used - end - --add amount to the player - instance_container:AddValue (player, used) - end - end - - --virmen's bite - local virmens_bite_potion = buff_uptime_container [105697] - if (virmens_bite_potion) then - local used = virmens_bite_potion.activedamt - if (used > 0) then - total = total + used - found_potion = true - if (used > top) then - top = used - end - --add amount to the player - instance_container:AddValue (player, used) - end - end - - --potion of the mountains - local mountains_potion = buff_uptime_container [105698] - if (mountains_potion) then - local used = mountains_potion.activedamt - if (used > 0) then - total = total + used - found_potion = true - if (used > top) then - top = used - end - --add amount to the player - instance_container:AddValue (player, used) - end - end - end - - if (found_potion) then - amount = amount + 1 - end - end -end - ---return: -return total, top, amount - -tooltip = - --init: - local player, combat, instance = ... - - --get the debuff container for potion of focus - local debuff_uptime_container = player.debuff_uptime and player.debuff_uptime_spell_tables and player.debuff_uptime_spell_tables._ActorTable - if (debuff_uptime_container) then - local focus_potion = debuff_uptime_container [105701] - if (focus_potion) then - local name, _, icon = GetSpellInfo (105701) - GameCooltip:AddLine (name, 1) --> can use only 1 focus potion (can't be pre-potion) - _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon (icon, 1, 1, 14, 14) - end - end - - --get the buff container for all the others potions - local buff_uptime_container = player.buff_uptime and player.buff_uptime_spell_tables and player.buff_uptime_spell_tables._ActorTable - if (buff_uptime_container) then - --potion of the jade serpent - local jade_serpent_potion = buff_uptime_container [105702] - if (jade_serpent_potion) then - local name, _, icon = GetSpellInfo (105702) - GameCooltip:AddLine (name, jade_serpent_potion.activedamt) - _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon (icon, 1, 1, 14, 14) - end - - --potion of mogu power - local mogu_power_potion = buff_uptime_container [105706] - if (mogu_power_potion) then - local name, _, icon = GetSpellInfo (105706) - GameCooltip:AddLine (name, mogu_power_potion.activedamt) - _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon (icon, 1, 1, 14, 14) - end - - --virmen's bite - local virmens_bite_potion = buff_uptime_container [105697] - if (virmens_bite_potion) then - local name, _, icon = GetSpellInfo (105697) - GameCooltip:AddLine (name, virmens_bite_potion.activedamt) - _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon (icon, 1, 1, 14, 14) - end - - --potion of the mountains - local mountains_potion = buff_uptime_container [105698] - if (mountains_potion) then - local name, _, icon = GetSpellInfo (105698) - GameCooltip:AddLine (name, mountains_potion.activedamt) - _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon (icon, 1, 1, 14, 14) - end - end - - local spell = actor.spell_tables._ActorTable [15407] - spell.targets:SortByKey ("total") - for _, target in ipairs (spell.targets._ActorTable) do - GameCooltip:AddLine (target.nome, _detalhes.ToKFunctions [_detalhes.tooltip.abbreviation] (_, target.total)) - _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon ("Interface\\FriendsFrame\\StatusIcon-Offline", 1, 1, 14, 14) - end - - - --]] \ No newline at end of file + \ No newline at end of file diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index 3e8e0e94..e346e073 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -2357,7 +2357,7 @@ function gump:CriaJanelaInfo() if (player2_misc) then local spell = player2_misc.debuff_uptime_spell_tables and player2_misc.debuff_uptime_spell_tables._ActorTable and player2_misc.debuff_uptime_spell_tables._ActorTable [spellid] - if (spell) then + if (spell and spell.uptime) then local minutos, segundos = _math_floor (spell.uptime/60), _math_floor (spell.uptime%60) if (player1_uptime > spell.uptime) then local diff = player1_uptime - spell.uptime @@ -2414,7 +2414,7 @@ function gump:CriaJanelaInfo() if (player3_misc) then local spell = player3_misc.debuff_uptime_spell_tables and player3_misc.debuff_uptime_spell_tables._ActorTable and player3_misc.debuff_uptime_spell_tables._ActorTable [spellid] - if (spell) then + if (spell and spell.uptime) then local minutos, segundos = _math_floor (spell.uptime/60), _math_floor (spell.uptime%60) if (player1_uptime > spell.uptime) then local diff = player1_uptime - spell.uptime diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 80b2e128..6aba8c26 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -392,7 +392,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen) --> left panel buttons local menus = { --labels nos menus - {"Display", "Combat", "Tooltips", "Externals", "Profiles"}, + {"Display", "Combat", "Tooltips", "Data Feed", "Profiles"}, {"Skin Selection", "Row Settings", "Row Texts", "Show & Hide Settings", "Window Settings", "Title Text", "Menus: Left Buttons", "Menus: Right Buttons", "Wallpaper", "Miscellaneous"}, {"Data Collector", "Performance Tweaks", "Plugins Management", "Spell Customization", "Data for Charts"} } @@ -416,7 +416,7 @@ local menus = { --labels nos menus "Data for Charts", --16 "Show & Hide Settings", --17 "Miscellaneous", --18 - "Externals", --19 + "Data Feed", --19 "Tooltip", --20 } @@ -600,7 +600,7 @@ local menus = { --labels nos menus [16] = {}, --charts data [17] = {}, --instance settings [18] = {}, --miscellaneous settings - [19] = {}, --externals widgets + [19] = {}, --data feed widgets [20] = {}, --tooltips } --> vai armazenar os frames das opções @@ -1333,7 +1333,7 @@ function window:CreateFrame20() end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Advanced Settings - Externals Widgets ~19 +-- Advanced Settings - Data Feed Widgets ~19 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame19() diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index e47e9151..fa18cdcc 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -1397,9 +1397,47 @@ local function barra_scripts (esta_barra, instancia, i) if (esta_barra.fading_in) then return end - + if (button == "RightButton") then return _detalhes.switch:ShowMe (instancia) + + elseif (button == "MiddleButton") then + --> verifica se é damage taken + if (instancia.atributo == 1 and instancia.sub_atributo == 6) then --> enemies + + local inimigo = esta_barra.minha_tabela.nome + local custom_name = inimigo .. Loc ["STRING_CUSTOM_ENEMY_DT"] + + --> procura se já tem um custom: + for index, CustomObject in _ipairs (_detalhes.custom) do + if (CustomObject:GetName() == custom_name) then + return instancia:TrocaTabela (instancia.segmento, 5, index) + end + end + + --> criar um custom para este actor. + local new_custom_object = { + name = custom_name, + icon = [[Interface\ICONS\Pet_Type_Undead]], + attribute = "damagedone", + author = _detalhes.playername, + desc = inimigo .. " Damage Taken", + source = "[raid]", + target = inimigo, + script = false, + tooltip = false, + temp = true + } + + tinsert (_detalhes.custom, new_custom_object) + setmetatable (new_custom_object, _detalhes.atributo_custom) + new_custom_object.__index = _detalhes.atributo_custom + + instancia:TrocaTabela (instancia.segmento, 5, #_detalhes.custom) + --func, true, 5, index + + end + end esta_barra.texto_direita:SetPoint ("right", esta_barra.statusbar, "right", 1, -1) diff --git a/locales/Details-enUS.lua b/locales/Details-enUS.lua index 7412b6d2..b52e3e3d 100644 --- a/locales/Details-enUS.lua +++ b/locales/Details-enUS.lua @@ -3,9 +3,12 @@ if not Loc then return end -------------------------------------------------------------------------------------------------------------------------------------------- ---|cFFFFFF00v1.18.0 (|cFFFFCC00Jul 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Debug: print in the chat pre-potion found on raid members in the beggining of the combat.\n\n +--|cFFFFFF00v1.18.0 (|cFFFFCC00Jul 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Debug: print in the chat pre-potion found on raid members in the beggining of the combat.\n\n-- |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 +-- |cFFFFFF00-|r Debug: print in the chat pre-potion found on raid members in the beggining of the combat.\n\n +-- |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"] = "|cFFFFFF00v1.18.0 (|cFFFFCC00Jul 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r |cFFFFC000Debug|r: print in the chat pre-potion found on raid members in the beggining of the combat.\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"] = "|cFFFFFF00v1.18.0 (|cFFFFCC00Jul 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Debug: print in the chat pre-potion found on raid members in the beggining of the combat.\n\n|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|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 @@ -141,6 +144,9 @@ if not Loc then return end Loc ["STRING_CUSTOM_EXPORT"] = "Export" Loc ["STRING_CUSTOM_IMPORT"] = "Import" + Loc ["STRING_CUSTOM_ENEMY_DT"] = " Damage Taken" + Loc ["STRING_CUSTOM_TEMPORARILY"] = " (|cFFFFC000temporarily|r)" + --Loc ["STRING_CUSTOM_EDIT_DESC"] = "make changes on a\nalready created display" --Loc ["STRING_CUSTOM_REMOVE_DESC"] = "removes a " --Loc ["STRING_CUSTOM_EXPORT_DESC"] = "Select a display to edit." diff --git a/startup.lua b/startup.lua index ca2a8c98..d8cd948f 100644 --- a/startup.lua +++ b/startup.lua @@ -206,6 +206,9 @@ function _G._detalhes:Start() end end + --> check version + _detalhes:CheckVersion() + --> restore cooltip anchor position DetailsTooltipAnchor:Restore()