diff --git a/boot.lua b/boot.lua index 00c088e3..9ddb5638 100644 --- a/boot.lua +++ b/boot.lua @@ -3,9 +3,9 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 46 --it's 51 for release - _detalhes.userversion = "v1.24.2" - _detalhes.realversion = 26 + _detalhes.build_counter = 46 --it's 55 for release + _detalhes.userversion = "v1.24.4" + _detalhes.realversion = 27 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -19,6 +19,8 @@ do --[[ |cFFFFFF00a1.24.0 (|cFFFFCC00Ago 27, 2014|r|cFFFFFF00)|r:\n\n + +|cFFFFFF00-|r Added Raid Tools bracket on Options Panel. Raid Tools at the moment have interrupt, cooldown and death announcers implemented.\n\n |cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n |cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n |cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n @@ -28,7 +30,7 @@ do --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00a1.24.2 (|cFFFFCC00Ago 28, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners.\n\n|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells.\n\n|cFFFFFF00-|r Added dwarf racial Stone Form on cooldown list |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Bookmark now are shared between all characters.\n\n|cFFFFFF00-|r Fixed few inconsistencies with trash recognition.\n\n|cFFFFFF00-|r Fixed Cloud Capture where sometimes it wasn't sharing.\n\n|cFFFFFF00-|r Fixed report where it wasn't sharing for guild and raid when the player name box were empty.\n\n|cFFFFFF00-|r Report box now also saves the position and the last channel used to report |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r You Are Not Prepared plugin now have tooltips for spells and its window auto opens after a boss encounter.\n\n|cFFFFFF00-|r Advanced Death Logs plugin got full rewrite (and still are in development).\n\n|cFFFFFF00v1.19.0 - v1.19.1 - v1.19.2 (|cFFFFCC00Jul 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! is now able to be translated by its community for all supported languages through Curse Forge Web Site:\n\n|cFFFFFF00http://wow.curseforge.com/addons/details/localization/|r\n\n|cFFFFFF00-|r Slash commands now are multi language, accepting both english and the localized language.\n\n|cFFFFFF00-|r Added Data Broker for: Combat Time, Player Dps and Player Hps.\n\n|cFFFFFF00-|r Rework on plugins: Timeline, You Are Not Prepared, Tiny Threat, Encounter Details. All those plugins got a options panel and few improvaments.\n\n|cFFFFFF00-|r Trash segments won't be saved anymore.\n\n|cFFFFFF00-|r Added support for plugins options.\n\n|cFFFFFF00-|r Revamp on Deaths report lines, adding links for harmful spells and changing the text order |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Modified the percentage used on Comparison panel |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the Raid Dps and Hps data exported by Data Broker |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00v1.18.4 - v1.18.5 - v1.18.6 (|cFFFFCC00Jul 13, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option to customize the bar left text.\n\n|cFFFFFF00-|r Added option for show or hide bar placement number.\n\n|cFFFFFF00-|r Spell icon is shown in the bar when the enemy character is a environment spell type.\n\n|cFFFFFF00-|r Changed the non-player enemy icon (monsters).\n\n|cFFFFFF00-|r Fixed bug on flex performance profile |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added new version tracker which should alert you when a newer Details! version is found.\n\n|cFFFFFF00-|r Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar (enemies display).\n\n|cFFFFFF00-|r Added import/export for saved skins and custom displays created.\n\n|cFFFFFF00-|r Small changes on ElvUI Frame Style skin (need reaply).\n\n|cFFFFFF00-|r Fixed the death recognition for bosses, now it should show the correct color over segments menu.\n\n|cFFFFFF00-|r Fixed Dps inacuracy when plyaing solo (no party or raid group).\n\n|cFFFFFF00-|r Fixed the duration time of buffs applied before the pull, like pre-potions.\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." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00a1.24.4 (|cFFFFCC00Ago 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Raid Tools bracket on Options Panel. Raid Tools at the moment have interrupt, cooldown and death announcers implemented.\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners.\n\n|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells.\n\n|cFFFFFF00-|r Added dwarf racial Stone Form on cooldown list |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Bookmark now are shared between all characters.\n\n|cFFFFFF00-|r Fixed few inconsistencies with trash recognition.\n\n|cFFFFFF00-|r Fixed Cloud Capture where sometimes it wasn't sharing.\n\n|cFFFFFF00-|r Fixed report where it wasn't sharing for guild and raid when the player name box were empty.\n\n|cFFFFFF00-|r Report box now also saves the position and the last channel used to report |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r You Are Not Prepared plugin now have tooltips for spells and its window auto opens after a boss encounter.\n\n|cFFFFFF00-|r Advanced Death Logs plugin got full rewrite (and still are in development).\n\n|cFFFFFF00v1.19.0 - v1.19.1 - v1.19.2 (|cFFFFCC00Jul 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! is now able to be translated by its community for all supported languages through Curse Forge Web Site:\n\n|cFFFFFF00http://wow.curseforge.com/addons/details/localization/|r\n\n|cFFFFFF00-|r Slash commands now are multi language, accepting both english and the localized language.\n\n|cFFFFFF00-|r Added Data Broker for: Combat Time, Player Dps and Player Hps.\n\n|cFFFFFF00-|r Rework on plugins: Timeline, You Are Not Prepared, Tiny Threat, Encounter Details. All those plugins got a options panel and few improvaments.\n\n|cFFFFFF00-|r Trash segments won't be saved anymore.\n\n|cFFFFFF00-|r Added support for plugins options.\n\n|cFFFFFF00-|r Revamp on Deaths report lines, adding links for harmful spells and changing the text order |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Modified the percentage used on Comparison panel |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the Raid Dps and Hps data exported by Data Broker |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00v1.18.4 - v1.18.5 - v1.18.6 (|cFFFFCC00Jul 13, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option to customize the bar left text.\n\n|cFFFFFF00-|r Added option for show or hide bar placement number.\n\n|cFFFFFF00-|r Spell icon is shown in the bar when the enemy character is a environment spell type.\n\n|cFFFFFF00-|r Changed the non-player enemy icon (monsters).\n\n|cFFFFFF00-|r Fixed bug on flex performance profile |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added new version tracker which should alert you when a newer Details! version is found.\n\n|cFFFFFF00-|r Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar (enemies display).\n\n|cFFFFFF00-|r Added import/export for saved skins and custom displays created.\n\n|cFFFFFF00-|r Small changes on ElvUI Frame Style skin (need reaply).\n\n|cFFFFFF00-|r Fixed the death recognition for bosses, now it should show the correct color over segments menu.\n\n|cFFFFFF00-|r Fixed Dps inacuracy when plyaing solo (no party or raid group).\n\n|cFFFFFF00-|r Fixed the duration time of buffs applied before the pull, like pre-potions.\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." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " --> startup diff --git a/core/parser.lua b/core/parser.lua index 344bb354..a382513e 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -112,13 +112,15 @@ local _hook_cooldowns = false local _hook_deaths = false local _hook_battleress = false - local _hook_buffs = false --[[REMOVED]] + local _hook_interrupt = false + local _hook_cooldowns_container = _detalhes.hooks ["HOOK_COOLDOWN"] local _hook_deaths_container = _detalhes.hooks ["HOOK_DEATH"] local _hook_battleress_container = _detalhes.hooks ["HOOK_BATTLERESS"] - local _hook_buffs_container = _detalhes.hooks ["HOOK_BUFF"] --[[REMOVED]] - + local _hook_interrupt_container = _detalhes.hooks ["HOOK_INTERRUPT"] + local _hook_buffs = false --[[REMOVED]] + local _hook_buffs_container = _detalhes.hooks ["HOOK_BUFF"] --[[REMOVED]] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> internal functions @@ -1714,6 +1716,20 @@ else meu_dono.interrompeu_oque [extraSpellID] = meu_dono.interrompeu_oque [extraSpellID] + 1 end + + --> pet interrupt + if (_hook_interrupt) then + for _, func in _ipairs (_hook_interrupt_container) do + func (nil, token, time, meu_dono.serial, meu_dono.nome, meu_dono.flag_original, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) + end + end + else + --> player interrupt + if (_hook_interrupt) then + for _, func in _ipairs (_hook_interrupt_container) do + func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) + end + end end end @@ -2063,7 +2079,7 @@ func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname) end end - + end --> actor targets @@ -2267,6 +2283,8 @@ t = _current_combat:CreateLastEventsTable (alvo_name) end + --lesses index = older / higher index = newer + local last_index = t.n --or 'next index' if (last_index < 17 and not t[last_index][4]) then for i = 1, last_index-1 do @@ -3199,17 +3217,23 @@ _hook_deaths = false end - if (_detalhes.hooks ["HOOK_BUFF"].enabled) then --[[REMOVED]] - _hook_buffs = true - else - _hook_buffs = false - end - if (_detalhes.hooks ["HOOK_BATTLERESS"].enabled) then _hook_battleress = true else _hook_battleress = false end + + if (_detalhes.hooks ["HOOK_INTERRUPT"].enabled) then + _hook_interrupt = true + else + _hook_interrupt = false + end + + if (_detalhes.hooks ["HOOK_BUFF"].enabled) then --[[REMOVED]] + _hook_buffs = true + else + _hook_buffs = false + end return _detalhes:ClearParserCache() end diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index 159542f1..deb004cf 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -12,9 +12,12 @@ --> local pointers local _math_floor = math.floor --lua local + local _cstr = string.format --lua local local gump = _detalhes.gump --details local + local _GetSpellInfo = _detalhes.getspellinfo --details api + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants @@ -220,3 +223,223 @@ end end + + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> built in announcers + + function _detalhes:SendMsgToChannel (msg, channel, towho) + if (channel == "RAID" or channel == "PARTY") then + if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then + channel = "INSTANCE_CHAT" + end + SendChatMessage (msg, channel) + + elseif (channel == "BNET") then + + if (type (towho) == "number") then + BNSendWhisper (towho, msg) + + elseif (type (towho) == "string") then + local BnetFriends = BNGetNumFriends() + for i = 1, BnetFriends do + local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, broadcastTime, canSoR = BNGetFriendInfo (i) + if ((presenceName == towho or toonName == towho) and isOnline) then + BNSendWhisper (presenceID, msg) + break + end + end + end + + elseif (channel == "CHANNEL") then + SendChatMessage (msg, channel, nil, GetChannelName (towho)) + + elseif (channel == "WHISPER") then + SendChatMessage (msg, channel, nil, towho) + + else + SendChatMessage (msg, channel) + + --elseif (channel == "SAY" or channel == "YELL" or channel == "RAID_WARNING" or channel == "OFFICER" or channel == "GUILD" or channel == "EMOTE") then + + end + end + + --/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) + if (who_name == _detalhes.playername) then -- and _detalhes.announce_interrupts.enabled + local channel = _detalhes.announce_interrupts.channel + local next = _detalhes.announce_interrupts.next + 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}", next) + _detalhes:SendMsgToChannel (custom, channel, _detalhes.announce_interrupts.whisper) + else + local msg = _cstr (Loc ["STRING_OPTIONS_RT_INTERRUPT"], spellname) + if (next ~= "") then + msg = msg .. " " .. _cstr (Loc ["STRING_OPTIONS_RT_INTERRUPT_NEXT"], next) + end + + _detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper) + end + end + end + + 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 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 == _detalhes.playername) then + return + end + if (alvo_name == Loc ["STRING_RAID_WIDE"]) then + channel = "RAID" + end + end + + local spellname + if (spellid > 10) then + spellname = GetSpellLink (spellid) + else + spellname = _GetSpellInfo (spellid) + end + + local custom = _detalhes.announce_cooldowns.custom + + if (custom ~= "") then + custom = custom:gsub ("{spell}", spellname) + custom = custom:gsub ("{target}", alvo_name) + _detalhes:SendMsgToChannel (custom, channel, _detalhes.announce_interrupts.whisper) + else + local msg + + if (alvo_name == Loc ["STRING_RAID_WIDE"]) then + msg = _cstr (Loc ["STRING_OPTIONS_RT_COOLDOWN2"], spellname) + else + msg = _cstr (Loc ["STRING_OPTIONS_RT_COOLDOWN1"], spellname, alvo_name) + end + + _detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper) + end + 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) + --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" + end + elseif (where == 2) then + if (zone ~= "raid") then + return + end + channel = "RAID" + elseif (where == 3) then + if (zone ~= "party") then + return + end + channel = "PARTY" + end + + local only_first = _detalhes.announce_deaths.only_first + --_detalhes:GetCombat ("current"):GetDeaths() is the same thing, but, it's faster without using the API. + if (zone == "raid" and not _detalhes.tabela_vigente.is_boss) then + return + end + if (only_first > 0 and #_detalhes.tabela_vigente.last_events_tables > only_first) then + return + end + + alvo_name = _detalhes:GetOnlyName (alvo_name) + + local msg = _cstr (Loc ["STRING_OPTIONS_RT_DEATH_MSG"], alvo_name) .. ":" + local spells = "" + local last = #death_table + + for i = 1, _detalhes.announce_deaths.last_hits do + for o = last, 1, -1 do + local this_death = death_table [o] + if (type (this_death[1]) == "boolean" and this_death[1] and this_death[4]+5 > time) then + local spelllink + if (this_death [2] > 10) then + spelllink = GetSpellLink (this_death [2]) + else + spelllink = "[" .. _GetSpellInfo (this_death [2]) .. "]" + end + spells = spelllink .. ": " .. _detalhes:ToK2 (_math_floor (this_death [3])) .. " " .. spells + last = o-1 + break + end + end + end + + msg = msg .. " " .. spells + _detalhes:SendMsgToChannel (msg, channel) + --print (msg) + --end + end + + function _detalhes:StartAnnouncers() + if (_detalhes.announce_interrupts.enabled) then + _detalhes:InstallHook (DETAILS_HOOK_INTERRUPT, _detalhes.interrupt_announcer) + end + if (_detalhes.announce_cooldowns.enabled) then + _detalhes:InstallHook (DETAILS_HOOK_COOLDOWN, _detalhes.cooldown_announcer) + end + if (_detalhes.announce_deaths.enabled) then + _detalhes:InstallHook (DETAILS_HOOK_DEATH, _detalhes.death_announcer) + end + end + + function _detalhes:EnableInterruptAnnouncer() + _detalhes.announce_interrupts.enabled = true + _detalhes:InstallHook (DETAILS_HOOK_INTERRUPT, _detalhes.interrupt_announcer) + end + function _detalhes:DisableInterruptAnnouncer() + _detalhes.announce_interrupts.enabled = false + _detalhes:UnInstallHook (DETAILS_HOOK_INTERRUPT, _detalhes.interrupt_announcer) + end + + function _detalhes:EnableCooldownAnnouncer() + _detalhes.announce_cooldowns.enabled = true + _detalhes:InstallHook (DETAILS_HOOK_COOLDOWN, _detalhes.cooldown_announcer) + end + function _detalhes:DisableCooldownAnnouncer() + _detalhes.announce_cooldowns.enabled = false + _detalhes:UnInstallHook (DETAILS_HOOK_COOLDOWN, _detalhes.cooldown_announcer) + end + + function _detalhes:EnableDeathAnnouncer() + _detalhes.announce_deaths.enabled = true + _detalhes:InstallHook (DETAILS_HOOK_DEATH, _detalhes.death_announcer) + end + function _detalhes:DisableDeathAnnouncer() + _detalhes.announce_deaths.enabled = false + _detalhes:UnInstallHook (DETAILS_HOOK_DEATH, _detalhes.death_announcer) + end + + \ No newline at end of file diff --git a/framework/picture.lua b/framework/picture.lua index f8447bc6..e57f694c 100644 --- a/framework/picture.lua +++ b/framework/picture.lua @@ -204,6 +204,10 @@ local ImageMetaFunctions = {} ------------------------------------------------------------------------------------------------------------ --> object constructor +function gump:CreateImage (parent, texture, w, h, layer, coords, member, name) + return gump:NewImage (parent, texture, w, h, layer, coords, member, name) +end + function gump:NewImage (parent, texture, w, h, layer, coords, member, name) if (not parent) then diff --git a/framework/slider.lua b/framework/slider.lua index 958d73b0..8ab105b3 100644 --- a/framework/slider.lua +++ b/framework/slider.lua @@ -16,6 +16,7 @@ local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") local cleanfunction = function() end local APISliderFunctions = false local SliderMetaFunctions = {} +local NameLessSlider = 1 ------------------------------------------------------------------------------------------------------------ --> metatables @@ -807,11 +808,20 @@ local switch_enable = function (self) return _rawset (self, "lockdown", false) end +function gump:CreateSwitch (parent, on_switch, default_value, w, h, ltext, rtext, member, name, color_inverted, switch_func, return_func) + local switch = gump:NewSwitch (parent, parent, name, member, w or 60, h or 20, ltext, rtext, default_value, color_inverted, switch_func, return_func) + if (on_switch) then + switch.OnSwitch = on_switch + end + return switch +end + function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, default_value, color_inverted, switch_func, return_func) --> early checks if (not name) then - return nil + name = "DetailsFrameWorkSlider" .. NameLessSlider + NameLessSlider = NameLessSlider + 1 elseif (not parent) then return nil end diff --git a/functions/events.lua b/functions/events.lua index 10c0df94..c0fa3d07 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -247,3 +247,22 @@ local common_events = { end end end + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> listeners + + local listener_meta = setmetatable ({}, _detalhes) + listener_meta.__index = listener_meta + + function listener_meta:RegisterEvent (event, func) + return _detalhes:RegisterEvent (self, event, func) + end + function listener_meta:UnregisterEvent (event) + return _detalhes:UnregisterEvent (self, event) + end + + function _detalhes:CreateEventListener() + local new = {Enabled = true, __enabled = true} + setmetatable (new, listener_meta) + return new + end \ No newline at end of file diff --git a/functions/hooks.lua b/functions/hooks.lua index 79d1ac65..c008f637 100644 --- a/functions/hooks.lua +++ b/functions/hooks.lua @@ -8,6 +8,7 @@ --[[global]] DETAILS_HOOK_COOLDOWN = "HOOK_COOLDOWN" --[[global]] DETAILS_HOOK_DEATH = "HOOK_DEATH" --[[global]] DETAILS_HOOK_BATTLERESS = "HOOK_BATTLERESS" + --[[global]] DETAILS_HOOK_INTERRUPT = "HOOK_INTERRUPT" --[[global]] DETAILS_HOOK_BUFF = "HOOK_BUFF" --[[REMOVED--]] @@ -18,6 +19,7 @@ _detalhes.hooks ["HOOK_COOLDOWN"] = {} _detalhes.hooks ["HOOK_DEATH"] = {} _detalhes.hooks ["HOOK_BATTLERESS"] = {} + _detalhes.hooks ["HOOK_INTERRUPT"] = {} _detalhes.hooks ["HOOK_BUFF"] = {} --[[REMOVED--]] diff --git a/functions/profiles.lua b/functions/profiles.lua index 72259c12..d39ebf03 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -822,6 +822,31 @@ local default_player_data = { savedStyles = {}, --> instance config local_instances_config = {}, + --> announcements + announce_deaths = { + enabled = false, + only_first = 5, + last_hits = 1, + where = 1, + }, + announce_cooldowns = { + enabled = false, + channel = "RAID", + ignored_cooldowns = {}, + custom = "", + }, + announce_interrupts = { + enabled = false, + channel = "SAY", + whisper = "", + next = "", + custom = "", + }, + announce_prepots = { + enabled = true, + reverse = false, + channel = "SELF", + }, } _detalhes.default_player_data = default_player_data diff --git a/functions/spells.lua b/functions/spells.lua index fa2ea4d9..0c12ecff 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -1050,7 +1050,7 @@ do -- Monk [122470] = {90, 10}, -- Touch of Karma [115213] = {180, 6}, -- Avert Harm - ["MONK"] = {115295, 115203, 122470, 115176, 116849, 115213, 122278, 122783}, + ["MONK"] = {122470, 115213, 115295, 115203, 115176, 116849, 122278, 122783, 115310, 119582, 116844, 115308}, -- Paladin [86659] = {180, 12}, -- Guardian of Ancient Kings @@ -1060,32 +1060,32 @@ do [6940] = {120, 12}, -- Hand of Sacrifice [1022] = {300, 10}, -- Hand of Protection [1038] = {120, 10}, -- Hand of Salvation - ["PALADIN"] = {86659, 31850, 498, 642, 6940, 1022, 1038}, - + ["PALADIN"] = {86659, 31850, 498, 642, 6940, 1022, 1038, 633, 31821}, + -- Priest [15286] = {180, 15}, -- Vampiric Embrace [47788] = {180, 10}, -- Guardian Spirit [47585] = {120, 6}, -- Dispersion [33206] = {180, 8}, -- Pain Suppression - ["PRIEST"] = {15286, 47788, 47585, 33206, 62618, 109964, 64843}, + ["PRIEST"] = {15286, 47788, 47585, 33206, 62618, 109964, 64843, 108968, 142723}, -- Rogue [1966] = {1.5, 5}, -- Feint [31224] = {60, 5}, -- Cloak of Shadows [5277] = {180, 15}, -- Evasion - ["ROGUE"] = {1966, 31224, 5277}, + ["ROGUE"] = {1966, 31224, 5277, 76577}, -- Shaman [30823] = {60, 15}, -- Shamanistic Rage [108271] = {120, 6}, -- Astral Shift - ["SHAMAN"] = {30823, 108271, 108270}, + ["SHAMAN"] = {30823, 108271, 108270, 108280, 98008, 108281}, -- Warlock [104773] = {180, 8}, -- Unending Resolve [108359] = {120, 12}, -- Dark Regeneration [110913] = {180, 8}, -- Dark Bargain ["WARLOCK"] = {104773, 108359, 108416, 110913, 6229}, - + -- Warrior [871] = {180, 12}, -- Shield Wall [12975] = {180, 20}, -- Last Stand @@ -1094,7 +1094,8 @@ do [118038] = {120, 8}, -- Die by the Sword [2565] = {90, 6}, -- Shield Block [112048] = {90, 6}, -- Shield Barrier - ["WARRIOR"] = {871, 12975, 23920, 114030, 118038} + ["WARRIOR"] = {871, 12975, 23920, 114030, 118038, 114203, 114028, 97462} + } _detalhes.HarmfulSpells = { @@ -2009,4 +2010,9 @@ do return _detalhes.spells_school [school] and _detalhes.spells_school [school].formated or "" end + function _detalhes:GetCooldownList (class) + class = class or select (2, UnitClass ("player")) + return _detalhes.DefensiveCooldownSpells [class] + end + end \ No newline at end of file diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index cb49ea69..952943c6 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -11,7 +11,7 @@ 8 - right menu 9 - wallpaper 10 - performance teaks - 11 - captures + 11 - raid tools 12 - plugins 13 - profiles 14 - attribute text @@ -344,7 +344,7 @@ local menus = { --labels nos menus Loc ["STRING_OPTIONSMENU_WINDOW"], Loc ["STRING_OPTIONSMENU_TITLETEXT"], Loc ["STRING_OPTIONSMENU_LEFTMENU"], Loc ["STRING_OPTIONSMENU_RIGHTMENU"], Loc ["STRING_OPTIONSMENU_WALLPAPER"], Loc ["STRING_OPTIONSMENU_MISC"]}, - {Loc ["STRING_OPTIONSMENU_DATACOLLECT"], Loc ["STRING_OPTIONSMENU_PERFORMANCE"], Loc ["STRING_OPTIONSMENU_PLUGINS"], Loc ["STRING_OPTIONSMENU_SPELLS"], + {Loc ["STRING_OPTIONSMENU_RAIDTOOLS"], Loc ["STRING_OPTIONSMENU_PERFORMANCE"], Loc ["STRING_OPTIONSMENU_PLUGINS"], Loc ["STRING_OPTIONSMENU_SPELLS"], Loc ["STRING_OPTIONSMENU_DATACHART"]} } @@ -359,7 +359,7 @@ local menus = { --labels nos menus Loc ["STRING_OPTIONSMENU_RIGHTMENU"], --8 Loc ["STRING_OPTIONSMENU_WALLPAPER"], --9 Loc ["STRING_OPTIONSMENU_PERFORMANCE"],--10 - Loc ["STRING_OPTIONSMENU_DATACOLLECT"], --11 + Loc ["STRING_OPTIONSMENU_RAIDTOOLS"], --11 Loc ["STRING_OPTIONSMENU_PLUGINS"],--12 Loc ["STRING_OPTIONSMENU_PROFILES"], --13 Loc ["STRING_OPTIONSMENU_TITLETEXT"], --14 @@ -6950,12 +6950,390 @@ function window:CreateFrame11() local frame11 = window.options [11][1] - local label = g:NewLabel (frame11, _, "$parentMovedWarningLabel", "MovedWarningLabel", "This sectiong has been moved to Combat, under General Settings bracket.", "GameFontNormal") - local image = g:NewImage (frame11, [[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]]) + --> title + local titulo1 = g:NewLabel (frame11, _, "$parentTituloRaidTools", "RaidToolsLabel", Loc ["STRING_OPTIONS_RT_TITLE"], "GameFontNormal", 16) + local titulo1_desc = g:NewLabel (frame11, _, "$parentTituloRaidToolsDesc", "RaidToolsDescLabel", Loc ["STRING_OPTIONS_RT_TITLE_DESC"], "GameFontNormal", 9, "white") + titulo1_desc.width = 320 - label:SetPoint ("center", frame11, "center", 32, 0) - image:SetPoint ("right", label, "left", -7, 0) + local text_entry_size = 140 + --announcers anchor + g:NewLabel (frame11, _, "$parentAnnouncersAnchor", "AnnouncersAnchor", Loc ["STRING_OPTIONS_RT_ANNOUNCEMENTS"], "GameFontNormal") + + --interrupts + --enable + g:NewLabel (frame11, _, "$parentEnableInterruptsLabel", "EnableInterruptsLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_ONOFF"], "GameFontHighlightLeft") + g:NewSwitch (frame11, _, "$parentEnableInterruptsSlider", "EnableInterruptsSlider", 60, 20, _, _, _detalhes.announce_interrupts.enabled) + + frame11.EnableInterruptsSlider:SetPoint ("left", frame11.EnableInterruptsLabel, "right", 2) + frame11.EnableInterruptsSlider.OnSwitch = function (_, _, value) + if (value) then + _detalhes:EnableInterruptAnnouncer() + else + _detalhes:DisableInterruptAnnouncer() + end + end + + window:CreateLineBackground2 (frame11, "EnableInterruptsSlider", "EnableInterruptsLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_ONOFF_DESC"]) + + --whisper target + g:NewLabel (frame11, _, "$parentInterruptsWhisperLabel", "InterruptsWhisperLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_WHISPER"], "GameFontHighlightLeft") + g:NewTextEntry (frame11, _, "$parentInterruptsWhisperEntry", "InterruptsWhisperEntry", text_entry_size, 20) + frame11.InterruptsWhisperEntry:SetPoint ("left", frame11.InterruptsWhisperLabel, "right", 2, -1) + frame11.InterruptsWhisperEntry:SetText (_detalhes.announce_interrupts.whisper) + + frame11.InterruptsWhisperEntry:SetHook ("OnTextChanged", function (self, byUser) + if (byUser) then + _detalhes.announce_interrupts.whisper = self:GetText() + end + end) + + if (_detalhes.announce_interrupts.channel ~= "WHISPER") then + frame11.InterruptsWhisperEntry:Disable() + frame11.InterruptsWhisperLabel:SetTextColor (1, 1, 1, .4) + end + + --channel + local on_select_channel = function (self, _, channel) + _detalhes.announce_interrupts.channel = channel + if (channel == "WHISPER") then + frame11.InterruptsWhisperEntry:Enable() + frame11.InterruptsWhisperLabel:SetTextColor (1, 1, 1, 1) + else + frame11.InterruptsWhisperEntry:Disable() + frame11.InterruptsWhisperLabel:SetTextColor (1, 1, 1, .4) + end + end + + 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 = "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() + return channel_list + end + + g:NewLabel (frame11, _, "$parentInterruptsChannelLabel", "InterruptsChannelLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CHANNEL"] , "GameFontHighlightLeft") + local d = g:NewDropDown (frame11, _, "$parentInterruptsChannelDropdown", "InterruptsChannelDropdown", DROPDOWN_WIDTH, 20, build_channel_menu, _detalhes.announce_interrupts.channel) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + frame11.InterruptsChannelDropdown:SetPoint ("left", frame11.InterruptsChannelLabel, "right", 2) + window:CreateLineBackground2 (frame11, "InterruptsChannelDropdown", "InterruptsChannelLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CHANNEL_DESC"]) + + --campo para digitar o nome do proximo + g:NewLabel (frame11, _, "$parentInterruptsNextLabel", "InterruptsNextLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_NEXT"], "GameFontHighlightLeft") + g:NewTextEntry (frame11, _, "$parentInterruptsNextEntry", "InterruptsNextEntry", text_entry_size, 20) + frame11.InterruptsNextEntry:SetPoint ("left", frame11.InterruptsNextLabel, "right", 2, -1) + frame11.InterruptsNextEntry:SetText (_detalhes.announce_interrupts.next) + + frame11.InterruptsNextEntry:SetHook ("OnTextChanged", function (self, byUser) + _detalhes.announce_interrupts.next = self:GetText() + end) + window:CreateLineBackground2 (frame11, "InterruptsNextEntry", "InterruptsNextLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_NEXT_DESC"]) + + local reset_next = g:NewButton (frame11.InterruptsNextEntry, _, "$parentResetNextPlayerButton", "ResetNextPlayerButton", 16, 16, function() + frame11.InterruptsNextEntry.text = "" + frame11.InterruptsNextEntry:PressEnter() + end) + reset_next:SetPoint ("left", frame11.InterruptsNextEntry, "right", 0, 0) + reset_next:SetNormalTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + reset_next:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + reset_next:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + reset_next:GetNormalTexture():SetDesaturated (true) + reset_next.tooltip = "Reset to Default" + + --campo para digitar a fala customizada + g:NewLabel (frame11, _, "$parentInterruptsCustomLabel", "InterruptsCustomLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CUSTOM"], "GameFontHighlightLeft") + g:NewTextEntry (frame11, _, "$parentInterruptsCustomEntry", "InterruptsCustomEntry", text_entry_size, 20) + frame11.InterruptsCustomEntry:SetPoint ("left", frame11.InterruptsCustomLabel, "right", 2, -1) + frame11.InterruptsCustomEntry:SetText (_detalhes.announce_interrupts.custom) + + frame11.InterruptsCustomEntry:SetHook ("OnTextChanged", function (self, byUser) + _detalhes.announce_interrupts.custom = self:GetText() + end) + window:CreateLineBackground2 (frame11, "InterruptsCustomEntry", "InterruptsCustomLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CUSTOM_DESC"]) + + local reset_custom = g:NewButton (frame11.InterruptsCustomEntry, _, "$parentResetCustomPhraseButton", "ResetCustomPhraseButton", 16, 16, function() + frame11.InterruptsCustomEntry.text = "" + frame11.InterruptsCustomEntry:PressEnter() + end) + reset_custom:SetPoint ("left", frame11.InterruptsCustomEntry, "right", 0, 0) + reset_custom:SetNormalTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + reset_custom:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + reset_custom:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + reset_custom:GetNormalTexture():SetDesaturated (true) + reset_custom.tooltip = "Reset to Default" + + --cooldowns + + g:NewLabel (frame11, _, "$parentEnableCooldownsLabel", "EnableCooldownsLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_ONOFF"], "GameFontHighlightLeft") + g:NewSwitch (frame11, _, "$parentEnableCooldownsSlider", "EnableCooldownsSlider", 60, 20, _, _, _detalhes.announce_cooldowns.enabled) + + frame11.EnableCooldownsSlider:SetPoint ("left", frame11.EnableCooldownsLabel, "right", 2) + frame11.EnableCooldownsSlider.OnSwitch = function (_, _, value) + if (value) then + _detalhes:EnableCooldownAnnouncer() + else + _detalhes:DisableCooldownAnnouncer() + end + end + + window:CreateLineBackground2 (frame11, "EnableCooldownsSlider", "EnableCooldownsLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_ONOFF_DESC"]) + + --dropdown para escolher o canal + local on_select_channel = function (self, _, channel) + _detalhes.announce_cooldowns.channel = channel + end + + 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 = "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() + return channel_list + end + + g:NewLabel (frame11, _, "$parentCooldownChannelLabel", "CooldownChannelLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_CHANNEL"] , "GameFontHighlightLeft") + local d = g:NewDropDown (frame11, _, "$parentCooldownChannelDropdown", "CooldownChannelDropdown", DROPDOWN_WIDTH, 20, build_channel_menu, _detalhes.announce_cooldowns.channel) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + frame11.CooldownChannelDropdown:SetPoint ("left", frame11.CooldownChannelLabel, "right", 2) + window:CreateLineBackground2 (frame11, "CooldownChannelDropdown", "CooldownChannelLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_CHANNEL_DESC"]) + + --campo para digitar a frase customizada + g:NewLabel (frame11, _, "$parentCooldownCustomLabel", "CooldownCustomLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_CUSTOM"], "GameFontHighlightLeft") + g:NewTextEntry (frame11, _, "$parentCooldownCustomEntry", "CooldownCustomEntry", text_entry_size, 20) + frame11.CooldownCustomEntry:SetPoint ("left", frame11.CooldownCustomLabel, "right", 2, -1) + frame11.CooldownCustomEntry:SetText (_detalhes.announce_cooldowns.custom) + + frame11.CooldownCustomEntry:SetHook ("OnTextChanged", function (self, byUser) + _detalhes.announce_cooldowns.custom = self:GetText() + end) + window:CreateLineBackground2 (frame11, "CooldownCustomEntry", "CooldownCustomLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_CUSTOM_DESC"]) + + local reset_custom = g:NewButton (frame11.CooldownCustomEntry, _, "$parentResetCooldownCustomPhraseButton", "ResetCooldownCustomPhraseButton", 16, 16, function() + frame11.CooldownCustomEntry.text = "" + frame11.CooldownCustomEntry:PressEnter() + end) + reset_custom:SetPoint ("left", frame11.CooldownCustomEntry, "right", 0, 0) + reset_custom:SetNormalTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + reset_custom:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + reset_custom:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + reset_custom:GetNormalTexture():SetDesaturated (true) + reset_custom.tooltip = "Reset to Default" + + --esquema para ativar ou desativar certos cooldowns + --botão que abre um gump estilo welcome, com as spells pegas na lista de cooldowns + + g:NewButton (frame11, _, "$parentCooldownIgnoreButton", "CooldownIgnoreButton", 140, 16, function() + if (not DetailsAnnounceSelectCooldownIgnored) then + DetailsAnnounceSelectCooldownIgnored = CreateFrame ("frame", "DetailsAnnounceSelectCooldownIgnored", UIParent) + local f = DetailsAnnounceSelectCooldownIgnored + f:SetSize (250, 400) + f:SetPoint ("center", UIParent, "center", 0, 0) + local bg = f:CreateTexture (nil, "background") + bg:SetAllPoints (f) + bg:SetTexture ([[Interface\AddOns\Details\images\welcome]]) + f:SetFrameStrata ("FULLSCREEN") + local close = CreateFrame ("button", "DetailsAnnounceSelectCooldownIgnoredClose", f, "UIPanelCloseButton") + close:SetSize (32, 32) + close:SetPoint ("topright", f, "topright", 0, -12) + f:EnableMouse() + f:SetMovable (true) + f:SetScript ("OnMouseDown", function (self, button) + if (button == "RightButton") then + if (f.IsMoving) then + f.IsMoving = false + f:StopMovingOrSizing() + end + f:Hide() + return + end + + f.IsMoving = true + f:StartMoving() + end) + f:SetScript ("OnMouseUp", function (self, button) + if (f.IsMoving) then + f.IsMoving = false + f:StopMovingOrSizing() + end + end) + f.title = g:CreateLabel (f, Loc ["STRING_OPTIONS_RT_IGNORE_TITLE"], 12, nil, "GameFontNormal") + f.title:SetPoint ("top", f, "top", 0, -22) + + f.labels = {} + + local on_switch_func = function (self, spellid, value) + if (not value) then + _detalhes.announce_cooldowns.ignored_cooldowns [spellid] = nil + else + _detalhes.announce_cooldowns.ignored_cooldowns [spellid] = true + end + end + + f:SetScript ("OnHide", function (self) + self:Clear() + end) + + function f:Clear() + for _, label in ipairs (self.labels) do + label.icon:Hide() + label.text:Hide() + label.switch:Hide() + end + end + + function f:CreateLabel() + local L = { + icon = g:CreateImage (f, nil, 16, 16, "overlay", {0.1, 0.9, 0.1, 0.9}), + text = g:CreateLabel (f, "", 10, "white", "GameFontHighlightSmall"), + switch = g:CreateSwitch (f, on_switch_func, false) + } + L.icon:SetPoint ("topleft", f, "topleft", 10, ((#f.labels*20)*-1)-55) + L.text:SetPoint ("left", L.icon, "right", 2, 0) + L.switch:SetPoint ("left", L.text, "right", 2, 0) + tinsert (f.labels, L) + return L + end + + function f:Open() + local _GetSpellInfo = _detalhes.getspellinfo --details api + + for index, spellid in ipairs (_detalhes:GetCooldownList()) do + local label = f.labels [index] or f:CreateLabel() + local name, _, icon = _GetSpellInfo (spellid) + label.icon.texture = icon + label.text.text = name .. ":" + label.switch:SetFixedParameter (spellid) + label.switch:SetValue (_detalhes.announce_cooldowns.ignored_cooldowns [spellid]) + label.icon:Show() + label.text:Show() + label.switch:Show() + end + + f:Show() + end + + end + + DetailsAnnounceSelectCooldownIgnored:Open() + + end, nil, nil, nil, Loc ["STRING_OPTIONS_RT_COOLDOWNS_SELECT"], 1) + + frame11.CooldownIgnoreButton:InstallCustomTexture() + window:CreateLineBackground2 (frame11, "CooldownIgnoreButton", "CooldownIgnoreButton", Loc ["STRING_OPTIONS_RT_COOLDOWNS_SELECT_DESC"], nil, {1, 0.8, 0}, button_color_rgb) + + frame11.CooldownIgnoreButton:SetIcon ([[Interface\COMMON\UI-DropDownRadioChecks]], nil, nil, nil, {0, 0.5, 0, 0.5}) + frame11.CooldownIgnoreButton:SetTextColor (button_color_rgb) + + --deaths + + g:NewLabel (frame11, _, "$parentEnableDeathsLabel", "EnableDeathsLabel", Loc ["STRING_OPTIONS_RT_DEATHS_ONOFF"], "GameFontHighlightLeft") + g:NewSwitch (frame11, _, "$parentEnableDeathsSlider", "EnableDeathsSlider", 60, 20, _, _, _detalhes.announce_deaths.enabled) + + frame11.EnableDeathsSlider:SetPoint ("left", frame11.EnableDeathsLabel, "right", 2) + frame11.EnableDeathsSlider.OnSwitch = function (_, _, value) + if (value) then + _detalhes:EnableDeathAnnouncer() + else + _detalhes:DisableDeathAnnouncer() + end + end + + window:CreateLineBackground2 (frame11, "EnableDeathsSlider", "EnableDeathsLabel", Loc ["STRING_OPTIONS_RT_DEATHS_ONOFF_DESC"]) + + --slider para quantidade de danos a mostrar + g:NewLabel (frame11, _, "$parentDeathsDamageLabel", "DeathsDamageLabel", Loc ["STRING_OPTIONS_RT_DEATHS_HITS"], "GameFontHighlightLeft") + local s = g:NewSlider (frame11, _, "$parentDeathsDamageSlider", "DeathsDamageSlider", SLIDER_WIDTH, 20, 1, 3, 1, _detalhes.announce_deaths.last_hits) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + frame11.DeathsDamageSlider:SetPoint ("left", frame11.DeathsDamageLabel, "right", 2) + frame11.DeathsDamageSlider:SetHook ("OnValueChange", function (self, _, amount) + _detalhes.announce_deaths.last_hits = amount + end) + window:CreateLineBackground2 (frame11, "DeathsDamageSlider", "DeathsDamageLabel", Loc ["STRING_OPTIONS_RT_DEATHS_HITS_DESC"]) + + --slider para limite de mortes para reportar + g:NewLabel (frame11, _, "$parentDeathsAmountLabel", "DeathsAmountLabel", Loc ["STRING_OPTIONS_RT_DEATHS_FIRST"], "GameFontHighlightLeft") + local s = g:NewSlider (frame11, _, "$parentDeathsAmountSlider", "DeathsAmountSlider", SLIDER_WIDTH, 20, 1, 30, 1, _detalhes.announce_deaths.only_first) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + frame11.DeathsAmountSlider:SetPoint ("left", frame11.DeathsAmountLabel, "right", 2) + frame11.DeathsAmountSlider:SetHook ("OnValueChange", function (self, _, amount) + _detalhes.announce_deaths.only_first = amount + end) + window:CreateLineBackground2 (frame11, "DeathsAmountSlider", "DeathsAmountLabel", Loc ["STRING_OPTIONS_RT_DEATHS_FIRST_DESC"]) + + --dropdown para WHERE onde anunciar se só em raid e party + local on_select_channel = function (self, _, channel) + _detalhes.announce_deaths.channel = 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}, + } + 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) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + frame11.DeathChannelDropdown:SetPoint ("left", frame11.DeathChannelLabel, "right", 2) + window:CreateLineBackground2 (frame11, "DeathChannelDropdown", "DeathChannelLabel", Loc ["STRING_OPTIONS_RT_DEATHS_WHERE_DESC"]) + + --> anchors + local x = window.left_start_at + + titulo1:SetPoint (x, -30) + titulo1_desc:SetPoint (x, -50) + + local left_side = { + {"AnnouncersAnchor", 1, true}, + {"EnableInterruptsLabel", 2}, + {"InterruptsChannelLabel", 3}, + {"InterruptsWhisperLabel", 4}, + {"InterruptsNextLabel", 5}, + {"InterruptsCustomLabel", 6}, + {"EnableCooldownsLabel", 7, true}, + {"CooldownChannelLabel", 8}, + {"CooldownCustomLabel", 9}, + {"CooldownIgnoreButton", 10}, + {"EnableDeathsLabel", 11, true}, + {"DeathChannelLabel", 12}, + {"DeathsDamageLabel", 13}, + {"DeathsAmountLabel", 14}, + + } + + window:arrange_menu (frame11, left_side, window.left_start_at, -90) + + local right_side = { + {"AnnouncersAnchor", 1, true}, + } + + --window:arrange_menu (frame11, right_side, window.right_start_at, -90) end diff --git a/startup.lua b/startup.lua index dd2f6de9..dde4869c 100644 --- a/startup.lua +++ b/startup.lua @@ -419,12 +419,18 @@ function _G._detalhes:Start() --BNSendFriendInvite ("tercio#1488") + --> get in the realm chat channel if (not _detalhes.schedule_chat_enter and not _detalhes.schedule_chat_leave) then _detalhes.schedule_chat_enter = _detalhes:ScheduleTimer ("EnterChatChannel", 30) end + --> open profiler _detalhes:OpenProfiler() + --> start announcers + _detalhes:StartAnnouncers() + + --> open welcome if (self.is_first_run) then _detalhes:OpenWelcomeWindow() end