diff --git a/boot.lua b/boot.lua index 72e8c38a..40814f2c 100644 --- a/boot.lua +++ b/boot.lua @@ -1,11 +1,11 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - + _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 285 --it's 285 for release - _detalhes.userversion = "v3.6.1" - _detalhes.realversion = 50 --core version + _detalhes.build_counter = 286 --it's 286 for release + _detalhes.userversion = "v3.6.2" + _detalhes.realversion = 51 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -18,6 +18,11 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ + +|cFFFFFF00v3.6.2 |cFF55FF55(beta)|r (|cFFFFCC00Dec 17, 2014|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Continuing the implementation of RaidCheck, plugin for check food, flasks and pre-pots.\n\n +|cFFFFFF00-|r Fixed bugs on sending messages to chat for Raid Tools.\n\n + |cFFFFFF00v3.6.1 (|cFFFFCC00Dec 17, 2014|r|cFFFFFF00)|r:\n\n |cFFFFFF00-|r Started coding the new plugin for check flasks, food, pre potion.\n\n |cFFFFFF00-|r Death time seems to be bugged due to Combat elapsed time change.\n\n @@ -36,7 +41,7 @@ This change makes fun things, now we can make Dps and Hps update really quick an |cFFFFFF00-|r Clicking on report button when the report window is already open, make it close.\n\n --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.6.1 |cFF55FF55(beta)|r (|cFFFFCC00Dec 17, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Started coding the new plugin for check flasks, food, pre potion.\n\n|cFFFFFF00-|r Death time seems to be bugged due to Combat elapsed time change.\n\n|cFFFFFF00v3.6.0 |cFF55FF55(beta)|r (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Elapsed combat time now uses Float numbers instead of Integer, this might bug something, be aware of anomalies.\nThis change makes fun things, now we can make Dps and Hps update really quick and also increase the accuracy with warcraftlogs.\n\n|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color.\n\n|cFFFFFF00-|r Multistrike doesn't count any more for spell's Minimal Damage.\n\n|cFFFFFF00-|r Resource display got an tooltip which shows what resource is and resource gained per minute.\n\n|cFFFFFF00-|r Clicking on report button when the report window is already open, make it close.\n\n|cFFFFFF00v3.4.7 (|cFFFFCC00Dec 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs plugin got updates on Endurance Player Value and few bug fixes.\n\n|cFFFFFF00-|r Max Window Amount options can new be set to 1, before the minimum was 3.\n\n|cFFFFFF00-|r Fixed a problem with friendly fire tooltip where sometimes it wasn't showing up.\n\n|cFFFFFF00-|r Fixed cooldowns tooltip which wasn't showing rounded numbers (49.99 instead of 50).\n\n|cFFFFFF00-|r Fixed Warrior's Shield Block which wasn't being count as a cooldown.\n\n|cFFFFFF00-|r Fixed a problem where sometimes when a hunter pull and reset the boss right after, was causing segments to merge.\n\n|cFFFFFF00v3.4.4 (|cFFFFCC00Dec 05, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a issue with Ko'Ragh boss on Highmaul raid.\n\n|cFFFFFF00-|r Few changes on Bookmark panel.\n\n|cFFFFFF00v3.4.3 (|cFFFFCC00Dec 02, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Removed 'Simple Gray' skin.\n\n|cFFFFFF00-|r Addde new skin: 'Forced Square'.\n\n|cFFFFFF00-|r 'Default Skin' got renamed to 'WoW Interface'.\n\n|cFFFFFF00v3.4.2 (|cFFFFCC00Dec 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug with menu desaturation where erase and close buttons stay colored after clicking on it.\n\n|cFFFFFF00-|r Fixed stretch where sometimes after release the window, all exceeded bars shows up and fade in again.\n\n|cFFFFFF00-|r Fixed a bug with the +- buttons on the window's scale option.\n\n|cFFFFFF00-|r Fixed the border for sub menus on mode menu.\n\n|cFFFFFF00v3.4.0 (|cFFFFCC00Nov 29, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed custom displays ignoring 'target' setted.\n\n|cFFFFFF00-|r Fixed plugins showing its icon even when auto hide menus is enabled.\n\n|cFFFFFF00-|r .Updates slash command 'worldboss' now it shows Draenor bosses.\n\n|cFFFFFF00v3.3.0 (|cFFFFCC00Nov 25, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 3D models for the bars in the window. The options are at Appearance -> Rows: Advanced.\n\n|cFFFFFF00-|r Now when showing custom displays, clicking on a bar report what is shown on bar's tooltip.\n\n|cFFFFFF00-|r More fixes for dungeon bosses identification.\n\n|cFFFFFF00-|r Fixed a tooltip bug with Debuff Uptime and Aura & Voidzone displays.\n\n|cFFFFFF00-|r Fixed Player Details Window for friendly fire and damage taken.\n\n|cFFFFFF00-|r Fixed Molten Core Raid Finder version where all bosses was considered trash segments.\n\n|cFFFFFF00v3.2.4 (|cFFFFCC00Nov 19, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r More fixes for dungeon bosses recognition.\n\n|cFFFFFF00-|r Fixes for few errors during combat parser.\n\n|cFFFFFF00v3.2.3 (|cFFFFCC00Nov 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk's Stagger ability which was counting as damage done.\n\n|cFFFFFF00-|r Added WoD dungeon information, this fixes dungeon bosses being assigned as 'trash cleanup'.\n\n|cFFFFFF00-|r Added more information on API.txt document (is in Details! root folder).\n\n|cFFFFFF00v3.2.1 (|cFFFFCC00Nov 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Custom Displays updated to track WoD potions.\n\n|cFFFFFF00-|r Added Feedback panel at options panel.\n\n|cFFFFFF00v3.2.0 (|cFFFFCC00Nov 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major changes on the way Details! store information, these changes saves up to 40% memory and 4% cpu usage.\n\n|cFFFFFF00-|r Fixed problem with pet's healing messing with the owner activity time.\n\n|cFFFFFF00-|r Added Energy -> Resources.\n\n|cFFFFFF00-|r Fixed combat initialization when the player start casting a Dot spell.\n\n|cFFFFFF00-|r Added new custom display: Damage Taken By Spell.\n\n|cFFFFFF00v2.2.3 (|cFFFFCC00Oct 26, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the healing done problem with Priest's Spirit of Redemption.\n\n|cFFFFFF00-|r Fixed avoidance by absorb when the hit missed was a multistrike hit.\n\n|cFFFFFF00-|r Fixed a script time out problem when erasing data while in combat.\n\n|cFFFFFF00-|r Fixed bug with interrupt tooltip when the player have a pet.\n\n|cFFFFFF00v2.2.1 (|cFFFFCC00Oct 22, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the gap between the button and its menu which sometimes traveling the mouse between them was activating tooltips from window's bars.\n\n|cFFFFFF00-|r Fixed an annoying menu blink when the window was near the right side of the screen.\n\n|cFFFFFF00-|r Fixed the stretch grab which was over other windows even with the 'stretch always on top' option disabled.\n\n|cFFFFFF00-|r Few fixes on healing done from absorbs.\n\n|cFFFFFF00v2.1.6 (|cFFFFCC00Oct 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed death's tooltip which wasn't respecting tooltip's configuration set on options panel.\n\n|cFFFFFF00-|r Now when the window is close to the top of the screen, menus will anchor on bottom side of the menu icons.\n\n|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.6.2 |cFF55FF55(beta)|r (|cFFFFCC00Dec 17, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Continuing the implementation of RaidCheck, plugin for check food, flasks and pre-pots.\n\n|cFFFFFF00-|r Fixed bugs on sending messages to chat for Raid Tools.\n\n|cFFFFFF00v3.6.1 |cFF55FF55(beta)|r (|cFFFFCC00Dec 17, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Started coding the new plugin for check flasks, food, pre potion.\n\n|cFFFFFF00-|r Death time seems to be bugged due to Combat elapsed time change.\n\n|cFFFFFF00v3.6.0 |cFF55FF55(beta)|r (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Elapsed combat time now uses Float numbers instead of Integer, this might bug something, be aware of anomalies.\nThis change makes fun things, now we can make Dps and Hps update really quick and also increase the accuracy with warcraftlogs.\n\n|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color.\n\n|cFFFFFF00-|r Multistrike doesn't count any more for spell's Minimal Damage.\n\n|cFFFFFF00-|r Resource display got an tooltip which shows what resource is and resource gained per minute.\n\n|cFFFFFF00-|r Clicking on report button when the report window is already open, make it close.\n\n|cFFFFFF00v3.4.7 (|cFFFFCC00Dec 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs plugin got updates on Endurance Player Value and few bug fixes.\n\n|cFFFFFF00-|r Max Window Amount options can new be set to 1, before the minimum was 3.\n\n|cFFFFFF00-|r Fixed a problem with friendly fire tooltip where sometimes it wasn't showing up.\n\n|cFFFFFF00-|r Fixed cooldowns tooltip which wasn't showing rounded numbers (49.99 instead of 50).\n\n|cFFFFFF00-|r Fixed Warrior's Shield Block which wasn't being count as a cooldown.\n\n|cFFFFFF00-|r Fixed a problem where sometimes when a hunter pull and reset the boss right after, was causing segments to merge.\n\n|cFFFFFF00v3.4.4 (|cFFFFCC00Dec 05, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a issue with Ko'Ragh boss on Highmaul raid.\n\n|cFFFFFF00-|r Few changes on Bookmark panel.\n\n|cFFFFFF00v3.4.3 (|cFFFFCC00Dec 02, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Removed 'Simple Gray' skin.\n\n|cFFFFFF00-|r Addde new skin: 'Forced Square'.\n\n|cFFFFFF00-|r 'Default Skin' got renamed to 'WoW Interface'.\n\n|cFFFFFF00v3.4.2 (|cFFFFCC00Dec 01, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug with menu desaturation where erase and close buttons stay colored after clicking on it.\n\n|cFFFFFF00-|r Fixed stretch where sometimes after release the window, all exceeded bars shows up and fade in again.\n\n|cFFFFFF00-|r Fixed a bug with the +- buttons on the window's scale option.\n\n|cFFFFFF00-|r Fixed the border for sub menus on mode menu.\n\n|cFFFFFF00v3.4.0 (|cFFFFCC00Nov 29, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed custom displays ignoring 'target' setted.\n\n|cFFFFFF00-|r Fixed plugins showing its icon even when auto hide menus is enabled.\n\n|cFFFFFF00-|r .Updates slash command 'worldboss' now it shows Draenor bosses.\n\n|cFFFFFF00v3.3.0 (|cFFFFCC00Nov 25, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 3D models for the bars in the window. The options are at Appearance -> Rows: Advanced.\n\n|cFFFFFF00-|r Now when showing custom displays, clicking on a bar report what is shown on bar's tooltip.\n\n|cFFFFFF00-|r More fixes for dungeon bosses identification.\n\n|cFFFFFF00-|r Fixed a tooltip bug with Debuff Uptime and Aura & Voidzone displays.\n\n|cFFFFFF00-|r Fixed Player Details Window for friendly fire and damage taken.\n\n|cFFFFFF00-|r Fixed Molten Core Raid Finder version where all bosses was considered trash segments.\n\n|cFFFFFF00v3.2.4 (|cFFFFCC00Nov 19, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r More fixes for dungeon bosses recognition.\n\n|cFFFFFF00-|r Fixes for few errors during combat parser.\n\n|cFFFFFF00v3.2.3 (|cFFFFCC00Nov 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk's Stagger ability which was counting as damage done.\n\n|cFFFFFF00-|r Added WoD dungeon information, this fixes dungeon bosses being assigned as 'trash cleanup'.\n\n|cFFFFFF00-|r Added more information on API.txt document (is in Details! root folder).\n\n|cFFFFFF00v3.2.1 (|cFFFFCC00Nov 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Custom Displays updated to track WoD potions.\n\n|cFFFFFF00-|r Added Feedback panel at options panel.\n\n|cFFFFFF00v3.2.0 (|cFFFFCC00Nov 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major changes on the way Details! store information, these changes saves up to 40% memory and 4% cpu usage.\n\n|cFFFFFF00-|r Fixed problem with pet's healing messing with the owner activity time.\n\n|cFFFFFF00-|r Added Energy -> Resources.\n\n|cFFFFFF00-|r Fixed combat initialization when the player start casting a Dot spell.\n\n|cFFFFFF00-|r Added new custom display: Damage Taken By Spell.\n\n|cFFFFFF00v2.2.3 (|cFFFFCC00Oct 26, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the healing done problem with Priest's Spirit of Redemption.\n\n|cFFFFFF00-|r Fixed avoidance by absorb when the hit missed was a multistrike hit.\n\n|cFFFFFF00-|r Fixed a script time out problem when erasing data while in combat.\n\n|cFFFFFF00-|r Fixed bug with interrupt tooltip when the player have a pet.\n\n|cFFFFFF00v2.2.1 (|cFFFFCC00Oct 22, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the gap between the button and its menu which sometimes traveling the mouse between them was activating tooltips from window's bars.\n\n|cFFFFFF00-|r Fixed an annoying menu blink when the window was near the right side of the screen.\n\n|cFFFFFF00-|r Fixed the stretch grab which was over other windows even with the 'stretch always on top' option disabled.\n\n|cFFFFFF00-|r Few fixes on healing done from absorbs.\n\n|cFFFFFF00v2.1.6 (|cFFFFCC00Oct 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed death's tooltip which wasn't respecting tooltip's configuration set on options panel.\n\n|cFFFFFF00-|r Now when the window is close to the top of the screen, menus will anchor on bottom side of the menu icons.\n\n|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_others.lua b/classes/classe_others.lua index e64e7c8b..79da286c 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -1407,16 +1407,23 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (in_or_out == "BUFF_UPTIME_IN") then local string_output = "pre-potion: " --> localize-me + 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.pre_pot_used = string_output + + _detalhes:SendEvent ("COMBAT_PREPOTION_UPDATED", nil, pot_usage) end elseif (_IsInGroup()) then + + local pot_usage = {} + for groupIndex = 1, _GetNumGroupMembers()-1 do for buffIndex = 1, 41 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("party"..groupIndex, buffIndex, nil, "HELPFUL") @@ -1429,6 +1436,12 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (realmName and realmName ~= "") then playerName = playerName .. "-" .. realmName end + + if (in_or_out == "BUFF_UPTIME_IN") then + if (_detalhes.PotionList [spellid]) then + pot_usage [playerName] = spellid + end + end _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out) end @@ -1442,11 +1455,31 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local playerName = _UnitName ("player") local playerGUID = _UnitGUID ("player") if (playerGUID) then + if (in_or_out == "BUFF_UPTIME_IN") then + if (_detalhes.PotionList [spellid]) then + pot_usage [playerName] = spellid + end + end + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out) end end end + if (in_or_out == "BUFF_UPTIME_IN") then + 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.pre_pot_used = string_output + _detalhes:SendEvent ("COMBAT_PREPOTION_UPDATED", nil, pot_usage) + end + else local pot_usage = {} @@ -1469,15 +1502,23 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end end - 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 " + --[ + if (in_or_out == "BUFF_UPTIME_IN") then + 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.pre_pot_used = string_output + _detalhes:SendEvent ("COMBAT_PREPOTION_UPDATED", nil, pot_usage) + end + --]] -- _detalhes:Msg (string_output) end diff --git a/core/gears.lua b/core/gears.lua index 6311b3b7..f56a7fbd 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -229,6 +229,7 @@ function _detalhes:StoreEncounter (combat) local boss_info = combat:GetBossInfo() local encounter_id = boss_info and boss_info.id + if (not encounter_id) then return end @@ -236,7 +237,7 @@ function _detalhes:StoreEncounter (combat) local diff = combat:GetDifficulty() --> check for heroic mode - if (diff == 5 or diff == 6 or diff == 15) then + if (diff == 5 or diff == 6 or diff == 15) then --test on raid finder or diff == 7 or diff == 17 local role = UnitGroupRolesAssigned ("player") if (role ~= "DAMAGER" and role ~= "HEALER") then @@ -262,7 +263,7 @@ function _detalhes:StoreEncounter (combat) elseif (not db) then return end - + local self_database = db.SELF_STORAGE if (not self_database) then @@ -291,7 +292,9 @@ function _detalhes:StoreEncounter (combat) } if (role == "DAMAGER") then - local player = combat (1, _detalhes.player_name) + + local player = combat (1, _detalhes.playername) + if (player) then t.total = player.total for spellid, spell in pairs (player.spells._ActorTable) do @@ -300,7 +303,7 @@ function _detalhes:StoreEncounter (combat) end elseif (role == "HEALER") then - local player = combat (2, _detalhes.player_name) + local player = combat (2, _detalhes.playername) if (player) then t.total = player.total for spellid, spell in pairs (player.spells._ActorTable) do @@ -377,7 +380,7 @@ function _detalhes:StoreEncounter (combat) } if (role == "DAMAGER") then - local player = combat (1, _detalhes.player_name) + local player = combat (1, _detalhes.playername) if (player) then t.total = player.total for spellid, spell in pairs (player.spells._ActorTable) do @@ -386,7 +389,7 @@ function _detalhes:StoreEncounter (combat) end elseif (role == "HEALER") then - local player = combat (2, _detalhes.player_name) + local player = combat (2, _detalhes.playername) if (player) then t.total = player.total for spellid, spell in pairs (player.spells._ActorTable) do diff --git a/core/parser.lua b/core/parser.lua index bb2af47b..7e2dc2f2 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -2207,7 +2207,7 @@ if (_hook_deaths) then --> send event to registred functions - local death_at = _tempo - _current_combat:GetStartTime() + local death_at = _GetTime() - _current_combat:GetStartTime() local max_health = _UnitHealthMax (alvo_name) for _, func in _ipairs (_hook_deaths_container) do @@ -2242,7 +2242,7 @@ esta_morte [#esta_morte+1] = t end - local decorrido = _tempo - _current_combat:GetStartTime() + local decorrido = _GetTime() - _current_combat:GetStartTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) local t = {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true, ["last_cooldown"] = este_jogador.last_cooldown, ["dead_at"] = decorrido} @@ -2627,14 +2627,14 @@ end _detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0 - if (_detalhes.latest_ENCOUNTER_END + 15 > _detalhes._tempo) then + if (_detalhes.latest_ENCOUNTER_END + 15 > _GetTime()) then return end --_detalhes.latest_ENCOUNTER_END = _detalhes._tempo _detalhes.latest_ENCOUNTER_END = _GetTime() --_detalhes.encounter_table ["end"] = time() - 0.4 - _detalhes.encounter_table ["end"] = _GetTime() - 0.4 + _detalhes.encounter_table ["end"] = _GetTime() -- - 0.4 --0.4 para o antigo metodo de tempo local _, _, _, _, _, _, _, zoneMapID = _GetInstanceInfo() diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index 14529756..0dd50d0c 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -1,7 +1,3 @@ ---File Revision: 1 ---Last Modification: 27/07/2013 --- Change Log: - -- 27/07/2013: Finished alpha version. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -271,6 +267,12 @@ --/run local s="teste {spell}"; s=s:gsub("{spell}", "tercio");print(s) function _detalhes:interrupt_announcer (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) + + -- add novo canal Self. + -- no canal self ele mostra todos os interrupts além do meu. + + -- add canal self pras mortes tbm? + if (who_name == _detalhes.playername) then -- and _detalhes.announce_interrupts.enabled local channel = _detalhes.announce_interrupts.channel local next = _detalhes.announce_interrupts.next @@ -283,6 +285,23 @@ spellname = _GetSpellInfo (extraSpellID) end + if (channel == "RAID") then + local zone = _detalhes:GetZoneType() + + if (zone ~= "party" and zone ~= "raid") then + return + end + + if (zone == "raid") then + channel = "RAID" + elseif (zone == "party") then + channel = "PARTY" + end + if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then + channel = "INSTANCE_CHAT" + end + end + if (custom ~= "") then custom = custom:gsub ("{spell}", spellname) custom = custom:gsub ("{next}", next) @@ -308,13 +327,27 @@ local channel = _detalhes.announce_cooldowns.channel if (channel == "WHISPER") then - if (alvo_name == _detalhes.playername) then - return - end if (alvo_name == Loc ["STRING_RAID_WIDE"]) then channel = "RAID" end end + + if (channel == "RAID") then + local zone = _detalhes:GetZoneType() + + if (zone ~= "party" and zone ~= "raid") then + return + end + + if (zone == "raid") then + channel = "RAID" + elseif (zone == "party") then + channel = "PARTY" + end + if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then + channel = "INSTANCE_CHAT" + end + end local spellname if (spellid > 10) then @@ -322,7 +355,7 @@ else spellname = _GetSpellInfo (spellid) end - + local custom = _detalhes.announce_cooldowns.custom if (custom ~= "") then @@ -344,28 +377,42 @@ end function _detalhes:death_announcer (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, death_table, last_cooldown, death_at, max_health) - --if (_detalhes.announce_deaths.enabled) then local where = _detalhes.announce_deaths.where local zone = _detalhes:GetZoneType() local channel = "" + if (where == 1) then if (zone ~= "party" and zone ~= "raid") then return end + if (zone == "raid") then channel = "RAID" + elseif (zone == "party") then + channel = "PARTY" end + if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then + channel = "INSTANCE_CHAT" + end + elseif (where == 2) then if (zone ~= "raid") then return end channel = "RAID" + if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then + channel = "INSTANCE_CHAT" + end + elseif (where == 3) then if (zone ~= "party") then return end channel = "PARTY" + if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then + channel = "INSTANCE_CHAT" + end end local only_first = _detalhes.announce_deaths.only_first @@ -402,8 +449,7 @@ msg = msg .. " " .. spells _detalhes:SendMsgToChannel (msg, channel) - --print (msg) - --end + end function _detalhes:StartAnnouncers() diff --git a/functions/events.lua b/functions/events.lua index c4594c01..5f77bb38 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -33,6 +33,7 @@ ["COMBAT_PLAYER_TIMESTARTED"] = {}, ["COMBAT_BOSS_FOUND"] = {}, ["COMBAT_INVALID"] = {}, + ["COMBAT_PREPOTION_UPDATED"] = {}, --> area ["ZONE_TYPE_CHANGED"] = {}, @@ -78,6 +79,7 @@ local common_events = { ["COMBAT_PLAYER_TIMESTARTED"] = true, ["COMBAT_BOSS_FOUND"] = true, ["COMBAT_INVALID"] = true, + ["COMBAT_PREPOTION_UPDATED"] = true, ["GROUP_ONENTER"] = true, ["GROUP_ONLEAVE"] = true, ["ZONE_TYPE_CHANGED"] = true, diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index ebb0797d..051e61d5 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -7504,7 +7504,7 @@ function window:CreateFrame11() local channel_list = { {value = "SAY", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, label = Loc ["STRING_CHANNEL_SAY"], onclick = on_select_channel}, {value = "YELL", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, iconcolor = {1, 0.3, 0, 1}, label = Loc ["STRING_CHANNEL_YELL"], onclick = on_select_channel}, - {value = "RAID", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_CHANNEL_RAID"], onclick = on_select_channel}, + {value = "RAID", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_INSTANCE_CHAT"], onclick = on_select_channel}, {value = "WHISPER", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 1}, iconsize = {14, 14}, texcoord = {0.0546875, 0.1953125, 0.625, 0.890625}, label = Loc ["STRING_CHANNEL_WHISPER"], onclick = on_select_channel}, } local build_channel_menu = function() @@ -7605,7 +7605,7 @@ function window:CreateFrame11() local channel_list = { {value = "SAY", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, label = Loc ["STRING_CHANNEL_SAY"], onclick = on_select_channel}, {value = "YELL", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, iconcolor = {1, 0.3, 0, 1}, label = Loc ["STRING_CHANNEL_YELL"], onclick = on_select_channel}, - {value = "RAID", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_CHANNEL_RAID"], onclick = on_select_channel}, + {value = "RAID", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_INSTANCE_CHAT"], onclick = on_select_channel}, {value = "WHISPER", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 1}, iconsize = {14, 14}, texcoord = {0.0546875, 0.1953125, 0.625, 0.890625}, label = Loc ["STRING_CHANNEL_WHISPER_TARGET_COOLDOWN"], onclick = on_select_channel}, } local build_channel_menu = function() diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index eb9cb711..eb1a1161 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -1,5 +1,8 @@ local _UnitAura = UnitAura +local _GetSpellInfo = GetSpellInfo +local _UnitClass = UnitClass +local _UnitName = UnitName local flask_list = { [156064] = true, --Greater Draenic Agility Flask @@ -12,20 +15,6 @@ local flask_list = { [156084] = true, --Greater Draenic Stamina Flask } --- 175790, --shiftness potion (70% speed) --- 175817, --living action potion (remove stun) --- 156445, --rejuvenation potion (restore 70k hp) --- 156436, --mana potion --- 156432, --channeled mana potion - -local pre_potions_list = { - [156426] = true, --draenic intellect potion - [156430] = true, --draenic armor potion - [156423] = true, --draenic agility potion - [156428] = true, --draenic strength potion - [175821] = true, --draenic pure rage potion -} - local food_list = { [160600] = true, -- [160724] = true, -- @@ -54,8 +43,7 @@ local food_list = { local DetailsRaidCheck = _detalhes:NewPluginObject ("DetailsRaidCheck", DETAILSPLUGIN_ALWAYSENABLED) tinsert (UISpecialFrames, "DetailsRaidCheck") DetailsRaidCheck:SetPluginDescription (Loc ["STRING_RAIDCHECK_PLUGIN_DESC"]) - - + local CreatePluginFrames = function() DetailsRaidCheck.usedprepot_table = {} @@ -73,14 +61,14 @@ local food_list = { DetailsRaidCheck:CheckZone (...) + elseif (event == "COMBAT_PREPOTION_UPDATED") then + + DetailsRaidCheck.usedprepot_table = select (1, ...) + vardump (DetailsRaidCheck.usedprepot_table) + elseif (event == "COMBAT_PLAYER_LEAVE") then if (DetailsRaidCheck.on_raid) then - - --> GET PRE POTION LIST - table.wipe (DetailsRaidCheck.usedprepot_table or empty_table) - DetailsRaidCheck.usedprepot_table = DetailsRaidCheck:FormatTable (DetailsRaidCheck.last_combat_pre_pot_used or "") - DetailsRaidCheck:StartTrackBuffs() end @@ -116,18 +104,64 @@ local food_list = { DetailsRaidCheck.ToolbarButton.shadow = true --> loads icon_shadow.tga when the instance is showing icons with shadows DetailsRaidCheck:ShowToolbarIcon (DetailsRaidCheck.ToolbarButton, "star") + --DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton) + + function DetailsRaidCheck:SetGreenIcon() + local lower_instance = _detalhes:GetLowerInstanceNumber() + if (not lower_instance) then + return + end + local instance = _detalhes:GetInstance (lower_instance) + + if (instance.menu_icons.shadow) then + DetailsRaidCheck.ToolbarButton:SetNormalTexture ([[Interface\AddOns\Details_RaidCheck\icon_shadow]]) + DetailsRaidCheck.ToolbarButton:SetPushedTexture ([[Interface\AddOns\Details_RaidCheck\icon_shadow]]) + DetailsRaidCheck.ToolbarButton:SetDisabledTexture ([[Interface\AddOns\Details_RaidCheck\icon_shadow]]) + DetailsRaidCheck.ToolbarButton:SetHighlightTexture ([[Interface\AddOns\Details_RaidCheck\icon_shadow]], "ADD") + else + DetailsRaidCheck.ToolbarButton:SetNormalTexture ([[Interface\AddOns\Details_RaidCheck\icon]]) + DetailsRaidCheck.ToolbarButton:SetPushedTexture ([[Interface\AddOns\Details_RaidCheck\icon]]) + DetailsRaidCheck.ToolbarButton:SetDisabledTexture ([[Interface\AddOns\Details_RaidCheck\icon]]) + DetailsRaidCheck.ToolbarButton:SetHighlightTexture ([[Interface\AddOns\Details_RaidCheck\icon]], "ADD") + end + end + + function DetailsRaidCheck:SetRedIcon() + local lower_instance = _detalhes:GetLowerInstanceNumber() + if (not lower_instance) then + return + end + local instance = _detalhes:GetInstance (lower_instance) + + if (instance.menu_icons.shadow) then + DetailsRaidCheck.ToolbarButton:SetNormalTexture ([[Interface\AddOns\Details_RaidCheck\icon_red_shadow]]) + DetailsRaidCheck.ToolbarButton:SetPushedTexture ([[Interface\AddOns\Details_RaidCheck\icon_red_shadow]]) + DetailsRaidCheck.ToolbarButton:SetDisabledTexture ([[Interface\AddOns\Details_RaidCheck\icon_red_shadow]]) + DetailsRaidCheck.ToolbarButton:SetHighlightTexture ([[Interface\AddOns\Details_RaidCheck\icon_red_shadow]], "ADD") + else + DetailsRaidCheck.ToolbarButton:SetNormalTexture ([[Interface\AddOns\Details_RaidCheck\icon_red]]) + DetailsRaidCheck.ToolbarButton:SetPushedTexture ([[Interface\AddOns\Details_RaidCheck\icon_red]]) + DetailsRaidCheck.ToolbarButton:SetDisabledTexture ([[Interface\AddOns\Details_RaidCheck\icon_red]]) + DetailsRaidCheck.ToolbarButton:SetHighlightTexture ([[Interface\AddOns\Details_RaidCheck\icon_red]], "ADD") + end + end + + local show_panel = CreateFrame ("frame", nil, UIParent) show_panel:SetSize (400, 300) show_panel:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) show_panel:SetPoint ("bottom", DetailsRaidCheck.ToolbarButton, "top", 0, 10) local food_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + food_str:SetJustifyH ("left") food_str:SetPoint ("topleft", show_panel, "topleft", 15, -20) local flask_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + flask_str:SetJustifyH ("left") flask_str:SetPoint ("topleft", show_panel, "topleft", 150, -20) local prepot_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + prepot_str:SetJustifyH ("left") prepot_str:SetPoint ("topleft", show_panel, "topleft", 285, -20) show_panel:Hide() @@ -139,18 +173,33 @@ local food_list = { local update_panel = function (self) - local s, f = "No Food:\n\n", "No Flask:\n\n" + local s, f, p, n = "No Food:\n\n", "No Flask:\n\n", "Used Pre Pot:\n\n", "Not Used Pre Pot:\n\n" for i = 1, GetNumGroupMembers(), 1 do local name = UnitName ("raid" .. i) if (not DetailsRaidCheck.havefood_table [name]) then - s = s .. name .. "\n" + local _, class = _UnitClass (name) + local class_color = "FFFFFFFF" + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + end + + s = s .. class_color .. name .. "|r\n" end if (not DetailsRaidCheck.haveflask_table [name]) then - f = f .. name .. "\n" + local _, class = _UnitClass (name) + local class_color = "FFFFFFFF" + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + end + f = f .. class_color .. name .. "|r\n" end end @@ -158,6 +207,39 @@ local food_list = { food_str:SetText (s) flask_str:SetText (f) + for player_name, potid in pairs (DetailsRaidCheck.usedprepot_table) do + local name, _, icon = _GetSpellInfo (potid) + local _, class = _UnitClass (player_name) + local class_color = "FFFFFFFF" + + if (class) then + class_color = RAID_CLASS_COLORS [class].colorStr + end + + p = p .. "|T" .. icon .. ":12:12:0:-5:64:64:0:64:0:64|t |c" .. class_color .. player_name .. "|r\n" + end + + for i = 1, GetNumGroupMembers(), 1 do + local playerName, realmName = _UnitName ("raid" .. i) + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + + if (not DetailsRaidCheck.usedprepot_table [playerName]) then + local _, class = _UnitClass (playerName) + local class_color = "FFFFFFFF" + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + end + + n = n .. class_color .. playerName .. "|r\n" + end + end + + prepot_str:SetText (p .. "\n\n" .. n) + end DetailsRaidCheck.ToolbarButton:SetScript ("OnEnter", function (self) @@ -221,14 +303,6 @@ local food_list = { end - function DetailsRaidCheck:FormatTable (t) - - for k, v in ipairs ({strsplit ( "|c", t )}) do - tinsert (DetailsRaidCheck.usedprepot_table, "|c" .. v) - end - - end - -- DETAILS_PLUGIN_RAIDCHECK -- /run vardump (DETAILS_PLUGIN_RAIDCHECK.havefood_table) -- DETAILS_PLUGIN_RAIDCHECK.tracking_buffs @@ -300,6 +374,7 @@ local food_list = { _G._detalhes:RegisterEvent (DetailsRaidCheck, "COMBAT_PLAYER_LEAVE") _G._detalhes:RegisterEvent (DetailsRaidCheck, "COMBAT_PLAYER_ENTER") + _G._detalhes:RegisterEvent (DetailsRaidCheck, "COMBAT_PREPOTION_UPDATED") _G._detalhes:RegisterEvent (DetailsRaidCheck, "ZONE_TYPE_CHANGED") end diff --git a/plugins/Details_RaidCheck/icon_red_shadow.tga b/plugins/Details_RaidCheck/icon_red_shadow.tga new file mode 100644 index 00000000..6d568cfa Binary files /dev/null and b/plugins/Details_RaidCheck/icon_red_shadow.tga differ diff --git a/startup.lua b/startup.lua index aa35d313..89603143 100644 --- a/startup.lua +++ b/startup.lua @@ -496,8 +496,9 @@ function _G._detalhes:Start() local actor = row.minha_tabela if (actor) then local dps_text = row.ps_text + if (dps_text) then - local new_dps = math.floor (actor.total / actor:Tempo()) + local new_dps = math.floor (actor.total / (GetTime() - instance.showing.start_time_float)) local formated_dps = _detalhes.ToKFunctions [_detalhes.ps_abbreviation] (_, new_dps) row.texto_direita:SetText (row.texto_direita:GetText():gsub (dps_text, formated_dps))