diff --git a/boot.lua b/boot.lua index 40814f2c..1c41096b 100644 --- a/boot.lua +++ b/boot.lua @@ -3,8 +3,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 286 --it's 286 for release - _detalhes.userversion = "v3.6.2" + _detalhes.build_counter = 287 --it's 287 for release + _detalhes.userversion = "v3.6.3" _detalhes.realversion = 51 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -18,6 +18,9 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ +|cFFFFFF00v3.6.3 |cFF55FF55(beta)|r (|cFFFFCC00Dec 19, 2014|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Added Observer channel for Raid Tools, it only reports the cooldown/interrupt/death to you in your chat window.\n\n +|cFFFFFF00-|r More updates on the new plugin Raid Check.\n\n |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 @@ -41,7 +44,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.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_VERSION_LOG"] = "|cFFFFFF00v3.6.3 |cFF55FF55(beta)|r (|cFFFFCC00Dec 19, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Observer channel for Raid Tools, it only reports the cooldown/interrupt/death to you at your chat window.\n\n|cFFFFFF00-|r More updates on the new plugin Raid Check.\n\n|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_combate.lua b/classes/classe_combate.lua index c19a5cd4..8a1b27ce 100644 --- a/classes/classe_combate.lua +++ b/classes/classe_combate.lua @@ -17,6 +17,7 @@ local _table_remove = table.remove -- lua local local _rawget = rawget local _math_max = math.max + local _math_floor = math.floor local _GetTime = GetTime ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -106,6 +107,12 @@ end --return the combat time in seconds + function combate:GetFormatedCombatTime() + local time = self:GetCombatTime() + local m, s = _math_floor (time/60), _math_floor (time%60) + return m, s + end + function combate:GetCombatTime() if (self.end_time) then return _math_max (self.end_time - self.start_time, 0.1) diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 0847b115..45c6237d 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -1473,6 +1473,7 @@ end if (not actor.powertype) then --print ("actor without powertype", actor.nome, actor.powertype) + actor.powertype = 1 end shadow.powertype = actor.powertype diff --git a/core/plugins.lua b/core/plugins.lua index 09ff8ad3..055e22fa 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -23,7 +23,7 @@ if (PluginAbsoluteName) then local plugin = _detalhes.plugin_database [PluginAbsoluteName] if (plugin) then - return plugin.__enabled + return plugin.enabled end else return self.__enabled @@ -37,6 +37,22 @@ return self.__description end + function _detalhes:DisablePlugin (AbsoluteName) + local plugin = _detalhes:GetPlugin (AbsoluteName) + + if (plugin) then + local saved_table = _detalhes:GetPluginSavedTable (AbsoluteName) + + saved_table.enabled = false + plugin.__enabled = false + + _detalhes:SendEvent ("PLUGIN_DISABLED", plugin) + + _detalhes:DelayOptionsRefresh() + return true + end + end + function _detalhes:CheckDefaultTable (current, default) for key, value in pairs (default) do if (type (value) == "table") then diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index 0dd50d0c..a313e53c 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -9,11 +9,14 @@ local _math_floor = math.floor --lua local local _cstr = string.format --lua local + local _UnitClass = UnitClass local gump = _detalhes.gump --details local local _GetSpellInfo = _detalhes.getspellinfo --details api + local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants @@ -273,8 +276,10 @@ -- add canal self pras mortes tbm? - if (who_name == _detalhes.playername) then -- and _detalhes.announce_interrupts.enabled - local channel = _detalhes.announce_interrupts.channel + local channel = _detalhes.announce_interrupts.channel + + if (channel ~= "PRINT" and who_name == _detalhes.playername) then + local next = _detalhes.announce_interrupts.next local custom = _detalhes.announce_interrupts.custom @@ -314,18 +319,61 @@ _detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper) end + + elseif (channel == "PRINT") then + + local custom = _detalhes.announce_interrupts.custom + + local spellname + if (spellid > 10) then + spellname = GetSpellLink (extraSpellID) + else + spellname = _GetSpellInfo (extraSpellID) + end + + if (custom ~= "") then + custom = custom:gsub ("{spell}", spellname) + custom = custom:gsub ("{next}", who_name) + _detalhes:SendMsgToChannel (custom, "PRINT") + else + local minute, second = _detalhes:GetCombat():GetFormatedCombatTime() + + local _, class = _UnitClass (who_name) + local class_color = "|cFFFF3333" + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + end + + if (second < 10) then + second = "0" .. second + end + local msg = "|cFFFFFF00[|r".. minute .. ":" .. second .. "|cFFFFFF00]|r Interrupt: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r)" + + _detalhes:SendMsgToChannel (msg, "PRINT") + end + end end + local ignored_self_cooldowns = { + [119582] = true, -- Purifying Brew + [115308] = true, --Elusive Brew + [115203 ] = true, --Fortifying Brew + } + function _detalhes:cooldown_announcer (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname) - if (who_name == _detalhes.playername) then -- and _detalhes.announce_cooldowns.enabled + + local channel = _detalhes.announce_cooldowns.channel + + if (channel ~= "PRINT" and who_name == _detalhes.playername) then + local ignored = _detalhes.announce_cooldowns.ignored_cooldowns if (ignored [spellid]) then return end - - local channel = _detalhes.announce_cooldowns.channel - + if (channel == "WHISPER") then if (alvo_name == Loc ["STRING_RAID_WIDE"]) then channel = "RAID" @@ -373,11 +421,63 @@ _detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper) end + + elseif (channel == "PRINT") then + + local ignored = _detalhes.announce_cooldowns.ignored_cooldowns + if (ignored [spellid]) then + return + end + + if (ignored_self_cooldowns [spellid]) then + return + end + + if (who_name == alvo_name and who_name ~= _detalhes.playername) then + return + end + + local msg + local minute, second = _detalhes:GetCombat():GetFormatedCombatTime() + + local _, class = _UnitClass (who_name) + local class_color = "|cFFFFFFFF" + + local _, class2 = _UnitClass (alvo_name) + local class_color2 = "|cFFFFFFFF" + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + end + + if (class2) then + local coords = CLASS_ICON_TCOORDS [class2] + class_color2 = " -> |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class2].colorStr + alvo_name = _detalhes:GetOnlyName (alvo_name) + else + alvo_name = "" + end + + local spellname + if (spellid > 10) then + spellname = GetSpellLink (spellid) + else + spellname = _GetSpellInfo (spellid) + end + + if (second < 10) then + second = "0" .. second + end + msg = "|cFF8F8FFF[|r".. minute .. ":" .. second .. "|cFF8F8FFF]|r Cooldown: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r" .. class_color2 .. alvo_name .. "|r)" + + _detalhes:SendMsgToChannel (msg, "PRINT") + end 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) - + local where = _detalhes.announce_deaths.where local zone = _detalhes:GetZoneType() local channel = "" @@ -413,6 +513,13 @@ if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then channel = "INSTANCE_CHAT" end + + elseif (where == 4) then --> observer + if (zone ~= "raid" and zone ~= "party") then + return + end + channel = "PRINT" + end local only_first = _detalhes.announce_deaths.only_first @@ -426,7 +533,20 @@ alvo_name = _detalhes:GetOnlyName (alvo_name) - local msg = _cstr (Loc ["STRING_OPTIONS_RT_DEATH_MSG"], alvo_name) .. ":" + local msg + if (where == 4) then --> observer + local _, class = _UnitClass (alvo_name) + local class_color = "|cFFFFFFFF" + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + end + msg = "Death: " .. class_color .. alvo_name .. "|r ->" + else + msg = _cstr (Loc ["STRING_OPTIONS_RT_DEATH_MSG"], alvo_name) .. ":" + end + local spells = "" local last = #death_table @@ -448,6 +568,15 @@ end msg = msg .. " " .. spells + + if (where == 4) then --> observer + local minute, second = _detalhes:GetCombat():GetFormatedCombatTime() + if (second < 10) then + second = "0" .. second + end + msg = "|cFFFF8800[|r".. minute .. ":" .. second .. "|cFFFF8800]|r " .. msg + end + _detalhes:SendMsgToChannel (msg, channel) end diff --git a/functions/skins.lua b/functions/skins.lua index 56fa866a..82a0da3b 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -513,7 +513,7 @@ local _ overlay = {1, 1, 1}, width = 256, texcoord = {49/1024, 305/1024, 646/1024, 774/1024}, - enabled = true, + enabled = false, anchor = "all", height = 128, alpha = 0.8, diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 051e61d5..b9f081ad 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -7502,6 +7502,7 @@ function window:CreateFrame11() end local channel_list = { + {value = "PRINT", icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel}, {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_INSTANCE_CHAT"], onclick = on_select_channel}, @@ -7603,6 +7604,7 @@ function window:CreateFrame11() end local channel_list = { + {value = "PRINT", icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel}, {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_INSTANCE_CHAT"], onclick = on_select_channel}, @@ -7811,20 +7813,21 @@ function window:CreateFrame11() --dropdown para WHERE onde anunciar se só em raid e party local on_select_channel = function (self, _, channel) - _detalhes.announce_deaths.channel = channel + _detalhes.announce_deaths.where = channel end local channel_list = { {value = 1, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE1"], onclick = on_select_channel}, {value = 2, 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_OPTIONS_RT_DEATHS_WHERE2"], onclick = on_select_channel}, {value = 3, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {0.66, 0.65, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE3"], onclick = on_select_channel}, + {value = 4, icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel}, } local build_channel_menu = function() return channel_list end g:NewLabel (frame11, _, "$parentDeathChannelLabel", "DeathChannelLabel", Loc ["STRING_OPTIONS_RT_DEATHS_WHERE"] , "GameFontHighlightLeft") - local d = g:NewDropDown (frame11, _, "$parentDeathChannelDropdown", "DeathChannelDropdown", DROPDOWN_WIDTH, 20, build_channel_menu, _detalhes.announce_deaths.channel) + local d = g:NewDropDown (frame11, _, "$parentDeathChannelDropdown", "DeathChannelDropdown", DROPDOWN_WIDTH, 20, build_channel_menu, _detalhes.announce_deaths.where) d.onenter_backdrop = dropdown_backdrop_onenter d.onleave_backdrop = dropdown_backdrop_onleave d:SetBackdrop (dropdown_backdrop) @@ -7910,6 +7913,7 @@ function window:CreateFrame12() -------- plugins local frame4 = window.options [12][1].gump + window.plugin_widgets = {} local on_enter = function (self) @@ -8005,6 +8009,8 @@ function window:CreateFrame12() local plugin_stable = _detalhes:GetPluginSavedTable (absName) local plugin = _detalhes:GetPlugin (absName) g:NewSwitch (bframe, _, "$parentToolbarSlider"..i, "toolbarPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled) + bframe ["toolbarPluginsSlider"..i].PluginName = absName + tinsert (window.plugin_widgets, bframe ["toolbarPluginsSlider"..i]) bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1) bframe ["toolbarPluginsSlider"..i].OnSwitch = function (self, _, value) plugin_stable.enabled = value @@ -8087,6 +8093,8 @@ function window:CreateFrame12() local plugin_stable = _detalhes:GetPluginSavedTable (absName) local plugin = _detalhes:GetPlugin (absName) g:NewSwitch (bframe, _, "$parentRaidSlider"..i, "raidPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled) + tinsert (window.plugin_widgets, bframe ["raidPluginsSlider"..i]) + bframe ["raidPluginsSlider"..i].PluginName = absName bframe ["raidPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1) bframe ["raidPluginsSlider"..i].OnSwitch = function (self, _, value) plugin_stable.enabled = value @@ -8170,6 +8178,8 @@ function window:CreateFrame12() local plugin_stable = _detalhes:GetPluginSavedTable (absName) local plugin = _detalhes:GetPlugin (absName) g:NewSwitch (bframe, _, "$parentSoloSlider"..i, "soloPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled) + tinsert (window.plugin_widgets, bframe ["soloPluginsSlider"..i]) + bframe ["soloPluginsSlider"..i].PluginName = absName bframe ["soloPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1) bframe ["soloPluginsSlider"..i].OnSwitch = function (self, _, value) plugin_stable.enabled = value @@ -8572,6 +8582,12 @@ end --> if not window --> window 11 + --> window 12 + + for _, slider in ipairs (window.plugin_widgets) do + local plugin_stable = _detalhes:GetPluginSavedTable (slider.PluginName) + slider:SetValue (plugin_stable.enabled) + end --> window 13 _G.DetailsOptionsWindow13SelectProfileDropdown.MyObject:Select (_detalhes:GetCurrentProfileName()) diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index eb1a1161..16cfcf35 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -3,6 +3,8 @@ local _UnitAura = UnitAura local _GetSpellInfo = GetSpellInfo local _UnitClass = UnitClass local _UnitName = UnitName +local _UnitGroupRolesAssigned = UnitGroupRolesAssigned +local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS local flask_list = { [156064] = true, --Greater Draenic Agility Flask @@ -35,8 +37,6 @@ local food_list = { [175223] = true, -- } - - --> localization local Loc = LibStub ("AceLocale-3.0"):GetLocale ("Details") --> create the plugin object @@ -44,8 +44,16 @@ local food_list = { tinsert (UISpecialFrames, "DetailsRaidCheck") DetailsRaidCheck:SetPluginDescription (Loc ["STRING_RAIDCHECK_PLUGIN_DESC"]) + local version = "v0.3" + + local debugmode = false + local CreatePluginFrames = function() + --> localize details functions (localize = it doesn't need to get this through indexed metatable any more) + DetailsRaidCheck.GetOnlyName = DetailsRaidCheck.GetOnlyName + + --> tables DetailsRaidCheck.usedprepot_table = {} DetailsRaidCheck.haveflask_table = {} DetailsRaidCheck.havefood_table = {} @@ -64,7 +72,6 @@ local food_list = { elseif (event == "COMBAT_PREPOTION_UPDATED") then DetailsRaidCheck.usedprepot_table = select (1, ...) - vardump (DetailsRaidCheck.usedprepot_table) elseif (event == "COMBAT_PLAYER_LEAVE") then @@ -75,9 +82,7 @@ local food_list = { elseif (event == "COMBAT_PLAYER_ENTER") then if (DetailsRaidCheck.on_raid) then - DetailsRaidCheck:StopTrackBuffs() - end elseif (event == "DETAILS_STARTED") then @@ -90,7 +95,8 @@ local food_list = { DetailsRaidCheck.tracking_buffs = false DetailsRaidCheck:StopTrackBuffs() - --> HIDE ICON + + DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton) elseif (event == "PLUGIN_ENABLED") then @@ -102,9 +108,6 @@ local food_list = { DetailsRaidCheck.ToolbarButton = _detalhes.ToolBar:NewPluginToolbarButton (DetailsRaidCheck.empty_function, [[Interface\AddOns\Details_RaidCheck\icon]], Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], "", 16, 16, "RAIDCHECK_PLUGIN_BUTTON") 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() @@ -149,31 +152,161 @@ local food_list = { 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:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) show_panel:SetPoint ("bottom", DetailsRaidCheck.ToolbarButton, "top", 0, 10) + --show_panel:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 16, insets = {left = 4, right = 4, top = 2, bottom = 1}}) + show_panel:SetBackdrop ({bgFile = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]], tileSize = 256, edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 16, insets = {left = 4, right = 4, top = 2, bottom = 1}}) + show_panel:SetBackdropColor (1, 1, 1, 0.9) + + -- + + local bottom_gradient = show_panel:CreateTexture (nil, "artwork") + bottom_gradient:SetPoint ("bottomleft", show_panel, "bottomleft", 4, 4) + bottom_gradient:SetPoint ("bottomright", show_panel, "bottomright", -4, 4) + bottom_gradient:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]]) + bottom_gradient:SetTexCoord (485/1024, 737/1024, 377/1024, 418/1024) + bottom_gradient:SetHeight (45) + + -- + + local report_string1 = show_panel:CreateFontString (nil, "overlay", "GameFontNormal") + report_string1:SetPoint ("bottomleft", show_panel, "bottomleft", 10, 10) + report_string1:SetText ("|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:12:12:0:1:512:512:8:70:225:307|t Report No Food/Flask |TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:12:12:0:1:512:512:8:70:328:409|t Report No Pre-Pot |TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:12:12:0:1:512:512:8:70:126:204|t Disable Plugin") + DetailsRaidCheck:SetFontSize (report_string1, 10) + DetailsRaidCheck:SetFontColor (report_string1, "white") + report_string1:SetAlpha (0.6) + -- + + local food_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + food_title:SetJustifyH ("center") + food_title:SetPoint ("topleft", show_panel, "topleft", 17, -20) + food_title:SetText ("No Food") + food_title:SetTextColor (1, 0.8, 0.8) local food_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") food_str:SetJustifyH ("left") - food_str:SetPoint ("topleft", show_panel, "topleft", 15, -20) + food_str:SetPoint ("topleft", food_title, "topleft", -9, -20) + + local food_image = show_panel:CreateTexture (nil, "artwork") + food_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]]) + food_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024) + food_image:SetPoint ("topleft", food_title, "topleft", -11, 3) + food_image:SetSize (food_title:GetStringWidth()+20, 19) --208, 48 + food_image:SetVertexColor (.65, .65, .65) + + -- + + local flask_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + flask_title:SetJustifyH ("center") + flask_title:SetPoint ("topleft", show_panel, "topleft", 110, -20) + flask_title:SetText ("No Flask") + flask_title:SetTextColor (1, 0.8, 0.8) local flask_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") flask_str:SetJustifyH ("left") - flask_str:SetPoint ("topleft", show_panel, "topleft", 150, -20) + flask_str:SetPoint ("topleft", flask_title, "topleft", -9, -20) + + local flask_image = show_panel:CreateTexture (nil, "artwork") + flask_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]]) + flask_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024) + flask_image:SetPoint ("topleft", flask_title, "topleft", -11, 3) + flask_image:SetSize (flask_title:GetStringWidth()+20, 19) --208, 48 + flask_image:SetVertexColor (.65, .65, .65) + + -- + + local prepot_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + prepot_title:SetJustifyH ("center") + prepot_title:SetPoint ("topleft", show_panel, "topleft", 205, -20) + prepot_title:SetText ("Used Pre Pot") + prepot_title:SetTextColor (0.8, 1, 0.8) local prepot_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") prepot_str:SetJustifyH ("left") - prepot_str:SetPoint ("topleft", show_panel, "topleft", 285, -20) + prepot_str:SetPoint ("topleft", prepot_title, "topleft", -11, -20) + + local prepot_image = show_panel:CreateTexture (nil, "artwork") + prepot_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]]) + prepot_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024) + prepot_image:SetPoint ("topleft", prepot_title, "topleft", -11, 3) + prepot_image:SetSize (prepot_title:GetStringWidth()+22, 19) --208, 48 + prepot_image:SetVertexColor (.65, .65, .65) + + -- + + local prepot_title2 = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + prepot_title2:SetJustifyH ("center") + prepot_title2:SetPoint ("topleft", show_panel, "topleft", 315, -20) + prepot_title2:SetText ("No Pre Pot") + prepot_title2:SetTextColor (1, 0.8, 0.8) + + local prepot_str2 = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + prepot_str2:SetJustifyH ("left") + prepot_str2:SetPoint ("topleft", prepot_title2, "topleft", -9, -20) + + local prepot_image2 = show_panel:CreateTexture (nil, "artwork") + prepot_image2:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]]) + prepot_image2:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024) + prepot_image2:SetPoint ("topleft", prepot_title2, "topleft", -11, 3) + prepot_image2:SetSize (prepot_title2:GetStringWidth()+22, 19) --208, 48 + prepot_image2:SetVertexColor (.65, .65, .65) + + -- show_panel:Hide() --> overwrite the default scripts + DetailsRaidCheck.ToolbarButton:RegisterForClicks ("AnyUp") DetailsRaidCheck.ToolbarButton:SetScript ("OnClick", function (self, button) + if (button == "LeftButton") then + --> link no food/flask + local s, added = "No Flask or Food: ", {} + + for i = 1, GetNumGroupMembers(), 1 do + local name = UnitName ("raid" .. i) + if (not DetailsRaidCheck.havefood_table [name]) then + added [name] = true + s = s .. DetailsRaidCheck:GetOnlyName (name) .. " " + end + + if (not DetailsRaidCheck.haveflask_table [name] and not added [name]) then + s = s .. DetailsRaidCheck:GetOnlyName (name) .. " " + end + end + + DetailsRaidCheck:SendMsgToChannel (s, "RAID") + + elseif (button == "RightButton") then + --> link no pre-pot latest segment + + local s = "No Pre-Pot Last Try: " + + 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 + s = s .. DetailsRaidCheck:GetOnlyName (playerName) .. " " + end + end + + DetailsRaidCheck:SendMsgToChannel (s, "RAID") + + elseif (button == "MiddleButton") then + + _detalhes:DisablePlugin ("DETAILS_PLUGIN_RAIDCHECK") + + end + end) local update_panel = function (self) - local s, f, p, n = "No Food:\n\n", "No Flask:\n\n", "Used Pre Pot:\n\n", "Not Used Pre Pot:\n\n" + local amount1, amount2, amount3, amount4 = 0, 0, 0, 0 + local s, f, p, n = "", "", "", "" for i = 1, GetNumGroupMembers(), 1 do @@ -188,7 +321,9 @@ local food_list = { 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" + s = s .. class_color .. DetailsRaidCheck:GetOnlyName (name) .. "|r\n" + + amount1 = amount1 + 1 end if (not DetailsRaidCheck.haveflask_table [name]) then @@ -199,7 +334,9 @@ local food_list = { 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" + f = f .. class_color .. DetailsRaidCheck:GetOnlyName (name) .. "|r\n" + + amount2 = amount2 + 1 end end @@ -207,6 +344,7 @@ local food_list = { food_str:SetText (s) flask_str:SetText (f) + --> used pre pot for player_name, potid in pairs (DetailsRaidCheck.usedprepot_table) do local name, _, icon = _GetSpellInfo (potid) local _, class = _UnitClass (player_name) @@ -216,29 +354,43 @@ local food_list = { 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" + p = p .. "|T" .. icon .. ":12:12:0:-5:64:64:0:64:0:64|t |c" .. class_color .. DetailsRaidCheck:GetOnlyName (player_name) .. "|r\n" + + amount3 = amount3 + 1 end + --> not used pre pot 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 + local role = _UnitGroupRolesAssigned ("raid" .. i) + + if (role == "DAMAGER" or (role == "HEALER" and DetailsRaidCheck.db.pre_pot_healers) or (role == "TANK" and DetailsRaidCheck.db.pre_pot_tanks)) then + 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 = "|cFFFFFFFF" + + 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 .. DetailsRaidCheck:GetOnlyName (playerName) .. "|r\n" + + amount4 = amount4 + 1 end - - n = n .. class_color .. playerName .. "|r\n" end + end - prepot_str:SetText (p .. "\n\n" .. n) + prepot_str:SetText (p) + prepot_str2:SetText (n) + + local bigger = math.max (amount1, amount2, amount3, amount4) + show_panel:SetHeight (100 + (bigger * 10)) end @@ -253,6 +405,19 @@ local food_list = { end) function DetailsRaidCheck:CheckZone (...) + + if (debugmode) then + DetailsRaidCheck:ShowToolbarIcon (DetailsRaidCheck.ToolbarButton, "star") + + DetailsRaidCheck.on_raid = true + + if (not DetailsRaidCheck.in_combat) then + DetailsRaidCheck:StartTrackBuffs() + end + + return + end + zone_type = select (1, ...) if (not zone_type) then @@ -261,18 +426,21 @@ local food_list = { if (zone_type == "raid") then + DetailsRaidCheck:ShowToolbarIcon (DetailsRaidCheck.ToolbarButton, "star") + DetailsRaidCheck.on_raid = true if (not DetailsRaidCheck.in_combat) then DetailsRaidCheck:StartTrackBuffs() - end else + + DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton) + DetailsRaidCheck.on_raid = false if (DetailsRaidCheck.tracking_buffs) then DetailsRaidCheck:StopTrackBuffs() - end end end @@ -286,21 +454,32 @@ local food_list = { DetailsRaidCheck.havefood_table [player_name] = nil end - for i = 1, GetNumGroupMembers(), 1 do - local name = UnitName ("raid" .. i) + local amt_players = GetNumGroupMembers() + local with_flask, with_food = 0, 0 + + for i = 1, amt_players, 1 do + local name = _UnitName ("raid" .. i) for buffIndex = 1, 41 do local bname, _, _, _, _, _, _, _, _, _, spellid = _UnitAura ("raid" .. i, buffIndex, nil, "HELPFUL") if (bname and flask_list [spellid]) then DetailsRaidCheck.haveflask_table [name] = true + with_flask = with_flask + 1 end if (bname and food_list [spellid]) then DetailsRaidCheck.havefood_table [name] = true + with_food = with_food + 1 end end end + if (with_food == amt_players and with_flask == amt_players) then + DetailsRaidCheck:SetGreenIcon() + else + DetailsRaidCheck:SetRedIcon() + end + end -- DETAILS_PLUGIN_RAIDCHECK @@ -343,7 +522,7 @@ local food_list = { end end - + function DetailsRaidCheck:OnEvent (_, event, ...) if (event == "ADDON_LOADED") then @@ -365,7 +544,7 @@ local food_list = { } --> install - local install, saveddata, is_enabled = _G._detalhes:InstallPlugin ("TOOLBAR", Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\AddOns\Details_RaidCheck\icon]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.0", default_settings) + local install, saveddata, is_enabled = _G._detalhes:InstallPlugin ("TOOLBAR", Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\AddOns\Details_RaidCheck\icon]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", version, default_settings) if (type (install) == "table" and install.error) then return print (install.error) end diff --git a/plugins/Details_RaidCheck/icon.tga b/plugins/Details_RaidCheck/icon.tga index 1b49f731..70f2cdfa 100644 Binary files a/plugins/Details_RaidCheck/icon.tga and b/plugins/Details_RaidCheck/icon.tga differ diff --git a/plugins/Details_RaidCheck/icon_red.tga b/plugins/Details_RaidCheck/icon_red.tga index 36251961..7a3976e4 100644 Binary files a/plugins/Details_RaidCheck/icon_red.tga and b/plugins/Details_RaidCheck/icon_red.tga differ diff --git a/plugins/Details_RaidCheck/icon_red_shadow.tga b/plugins/Details_RaidCheck/icon_red_shadow.tga index 6d568cfa..b68f1842 100644 Binary files a/plugins/Details_RaidCheck/icon_red_shadow.tga and b/plugins/Details_RaidCheck/icon_red_shadow.tga differ diff --git a/plugins/Details_RaidCheck/icon_shadow.tga b/plugins/Details_RaidCheck/icon_shadow.tga index 369a9d59..f41ae7ce 100644 Binary files a/plugins/Details_RaidCheck/icon_shadow.tga and b/plugins/Details_RaidCheck/icon_shadow.tga differ