From 668f3e4559d3cb4a037bc3d4dcd0a65e8da8ae7f Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Mon, 30 Aug 2021 19:43:41 -0300 Subject: [PATCH] Separating DK army and apoc pets --- Details-BCC.toc | 137 +++++++++++++++++++++++++++++++++++++++++++++ Libs/DF/fw.lua | 62 +++++++++++++++++++- Libs/DF/panel.lua | 31 ++++++++-- Libs/DF/spells.lua | 4 ++ boot.lua | 8 +-- core/parser.lua | 35 +++++++++++- 6 files changed, 264 insertions(+), 13 deletions(-) create mode 100644 Details-BCC.toc diff --git a/Details-BCC.toc b/Details-BCC.toc new file mode 100644 index 00000000..41b8d619 --- /dev/null +++ b/Details-BCC.toc @@ -0,0 +1,137 @@ +## Interface: 20501 +## Title: Details! Damage Meter +## Notes: Essential tool to impress that chick in your raid. +## SavedVariables: _detalhes_global +## SavedVariablesPerCharacter: _detalhes_database +## OptionalDeps: Ace3, LibSharedMedia-3.0, LibWindow-1.1, LibDBIcon-1.0, NickTag-1.0, LibDataBroker-1.1, LibItemUpgradeInfo-1.0, LibGroupInSpecT-1.1, LibCompress, LibGraph-2.0 +#@no-lib-strip@ +Libs\libs.xml +#@end-no-lib-strip@ + +locales\Details-enUS.lua +locales\Details-deDE.lua +locales\Details-esES.lua +locales\Details-esMX.lua +locales\Details-frFR.lua +locales\Details-itIT.lua +locales\Details-koKR.lua +locales\Details-ptBR.lua +locales\Details-ruRU.lua +locales\Details-zhCN.lua +locales\Details-zhTW.lua + +boot.lua +indent.lua +core\util.lua +API.lua + +functions\profiles.lua +functions\hooks.lua +functions\bossmods.lua +functions\coach.lua +functions\skins.lua +functions\boss.lua +functions\spells.lua +functions\events.lua +functions\classes.lua +functions\buff.lua +functions\spellcache.lua +functions\attributes.lua +functions\savedata.lua +functions\slash.lua +functions\playerclass.lua +functions\timedata.lua +functions\report.lua +functions\rowanimation.lua +functions\raidinfo.lua +functions\dungeon.lua +functions\pack.lua +functions\mythicdungeon.lua +functions\immersion.lua +functions\schedules.lua +functions\autorun.lua +functions\deathrecap.lua +functions\plater.lua +functions\deathmenu.lua +functions\macros.lua +functions\testbars.lua + +core\timemachine.lua + +frames\anime.lua +frames\anime.xml +frames\fw_mods.lua +frames\toolbar_button.xml + +frames\window_copy.lua +frames\window_options2.lua +frames\window_options2_sections.lua +frames\window_api.lua +frames\window_cdtracker.lua +frames\window_playerbreakdown.lua +frames\window_playerbreakdown_list.lua +frames\window_report.lua +frames\window_main.lua +frames\window_custom.lua +frames\window_welcome.lua +frames\window_news.lua +frames\window_wa.lua +frames\window_forge.lua +frames\window_switch.lua +frames\window_scrolldamage.lua +frames\window_dump.lua +frames\window_eventtracker.lua +frames\window_currentdps.lua +frames\window_benchmark.lua +frames\window_runcode.lua +frames\window_plater.lua +frames\window_macros.lua +frames\window_profiler.lua +frames\window_rowtexteditor.lua +frames\window_brokertexteditor.lua +frames\window_bookmark.lua +frames\window_classcolor.lua +frames\window_statistics.lua + +classes\class_error.lua +classes\class_combat.lua +classes\class_damage.lua +classes\class_spelldamage.lua +classes\class_heal.lua +classes\class_spellhealing.lua +classes\class_resources.lua +classes\class_spellresources.lua +classes\class_utility.lua +classes\class_spellutility.lua +classes\include_instance.lua +classes\class_instance.lua + +classes\class_custom.lua +classes\custom_damagedone.lua +classes\custom_healingdone.lua + +core\control.lua + +classes\container_actors.lua +classes\container_spells.lua +classes\container_segments.lua +classes\container_pets.lua + +core\plugins.lua +core\plugins_toolbar.lua +core\plugins_statusbar.lua +core\plugins_raid.lua +core\plugins_solo.lua +core\gears.lua +core\windows.lua +core\meta.lua +core\network.lua + +core\parser.lua +#core\parser_timewalk.lua + +functions\loaddata.lua + +startup.lua + +functions\api2.lua diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 2095eaa3..da5bbe62 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 262 +local dversion = 269 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) @@ -431,6 +431,28 @@ function DF.table.dump (t, s, deep) return s end +--grab a text and split it into lines adding each line to a indexed table +function DF:SplitTextInLines(text) + local lines = {} + local position = 1 + local startScope, endScope = text:find("\n", position, true) + + while (startScope) do + if (startScope ~= 1) then + tinsert(lines, text:sub(position, startScope-1)) + end + position = endScope + 1 + startScope, endScope = text:find("\n", position, true) + end + + if (position <= #text) then + tinsert(lines, text:sub(position)) + end + + return lines +end + + DF.www_icons = { texture = "feedback_sites", wowi = {0, 0.7890625, 0, 37/128}, @@ -590,6 +612,44 @@ function DF:AddClassColorToText (text, class) return text end +function DF:AddClassIconToText(text, playerName, class, useSpec, iconSize) + local size = iconSize or 16 + + local iconToUse, spec + if (useSpec) then + if (Details) then + local guid = UnitGUID(playerName) + if (guid) then + local spec = Details.cached_specs[guid] + if (spec) then + spec = spec + end + end + end + end + + if (spec) then --if spec is valid, the user has Details! installed + local specString = "" + local L, R, T, B = unpack (Details.class_specs_coords[spec]) + if (L) then + specString = "|TInterface\\AddOns\\Details\\images\\spec_icons_normal:" .. size .. ":" .. size .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" + return specString .. " " .. text + end + end + + if (class) then + local classString = "" + local L, R, T, B = unpack (Details.class_coords[class]) + if (L) then + local imageSize = 128 + classString = "|TInterface\\AddOns\\Details\\images\\classes_small:" .. size .. ":" .. size .. ":0:0:" .. imageSize .. ":" .. imageSize .. ":" .. (L * imageSize) .. ":" .. (R * imageSize) .. ":" .. (T * imageSize) .. ":" .. (B * imageSize) .. "|t" + return classString .. " " .. text + end + end + + return text +end + function DF:GetFontSize (fontString) local _, size = fontString:GetFont() return size diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index a9930450..9761be7b 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -1574,7 +1574,7 @@ function DF:IconPick (callback, close_when_select, param1, param2) DF.IconPickFrame.preview:Hide() --serach - DF.IconPickFrame.searchLabel = DF:NewLabel (DF.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:", font, size, color) + DF.IconPickFrame.searchLabel = DF:NewLabel (DF.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:") DF.IconPickFrame.searchLabel:SetPoint ("topleft", DF.IconPickFrame, "topleft", 12, -36) DF.IconPickFrame.searchLabel:SetTemplate (DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) @@ -8128,6 +8128,9 @@ DF.CastFrameFunctions = { if (self.casting) then local name, text, texture, startTime = UnitCastingInfo (self.unit) if (name) then + --[[if not self.spellStartTime then + self:UpdateCastingInfo(self.unit) + end]]-- self.value = GetTime() - self.spellStartTime end @@ -8136,6 +8139,9 @@ DF.CastFrameFunctions = { elseif (self.channeling) then local name, text, texture, endTime = UnitChannelInfo (self.unit) if (name) then + --[[if not self.spellEndTime then + self:UpdateChannelInfo(self.unit) + end]]-- self.value = self.spellEndTime - GetTime() end @@ -8329,10 +8335,12 @@ DF.CastFrameFunctions = { if (isChannel) then self.channeling = true + self:UpdateChannelInfo(unit) return self.unit == arg1 and "UNIT_SPELLCAST_CHANNEL_START" elseif (isRegularCast) then self.casting = true + self:UpdateCastingInfo(unit) return self.unit == arg1 and "UNIT_SPELLCAST_START" else @@ -8346,8 +8354,7 @@ DF.CastFrameFunctions = { end end, - UNIT_SPELLCAST_START = function (self, unit) - + UpdateCastingInfo = function (self, unit) local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID if IS_WOW_PROJECT_MAINLINE then name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo (unit) @@ -8406,10 +8413,16 @@ DF.CastFrameFunctions = { --> update the interrupt cast border self:UpdateInterruptState() + end, + + UNIT_SPELLCAST_START = function (self, unit) + + self:UpdateCastingInfo(unit) + self:RunHooksForWidget ("OnCastStart", self, self.unit, "UNIT_SPELLCAST_START") end, - UNIT_SPELLCAST_CHANNEL_START = function (self, unit, ...) + UpdateChannelInfo = function (self, unit, ...) local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID if IS_WOW_PROJECT_MAINLINE then name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo (unit) @@ -8467,6 +8480,12 @@ DF.CastFrameFunctions = { --> update the interrupt cast border self:UpdateInterruptState() + + end, + + UNIT_SPELLCAST_CHANNEL_START = function (self, unit, ...) + + self:UpdateChannelInfo(unit, ...) self:RunHooksForWidget ("OnCastStart", self, self.unit, "UNIT_SPELLCAST_CHANNEL_START") end, @@ -8537,7 +8556,7 @@ DF.CastFrameFunctions = { UNIT_SPELLCAST_FAILED = function (self, unit, ...) local unitID, castID, spellID = ... - if (self.casting and castID == self.castID and not self.fadeOut) then + if ((self.casting or self.channeling) and castID == self.castID and not self.fadeOut) then self.casting = nil self.channeling = nil self.failed = true @@ -8558,7 +8577,7 @@ DF.CastFrameFunctions = { UNIT_SPELLCAST_INTERRUPTED = function (self, unit, ...) local unitID, castID, spellID = ... - if (self.casting and castID == self.castID and not self.fadeOut) then + if ((self.casting or self.channeling) and castID == self.castID and not self.fadeOut) then self.casting = nil self.channeling = nil self.interrupted = true diff --git a/Libs/DF/spells.lua b/Libs/DF/spells.lua index ca36d781..f8ed7576 100644 --- a/Libs/DF/spells.lua +++ b/Libs/DF/spells.lua @@ -1298,6 +1298,10 @@ DF.FoodIDs = { [327707] = 2, --stamina +20 [327708] = 2, --intellect +20 [327709] = 2, --agility +20 + + [327704] = 2, --intellect +18 + [327701] = 2, --strength +18 + [327705] = 2, --agility +18 } DF.PotionIDs = { diff --git a/boot.lua b/boot.lua index 9c647091..69c94008 100644 --- a/boot.lua +++ b/boot.lua @@ -6,9 +6,9 @@ local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 8782 - _detalhes.alpha_build_counter = 8782 --if this is higher than the regular counter, use it instead - _detalhes.bcc_counter = 26 + _detalhes.build_counter = 8783 + _detalhes.alpha_build_counter = 8783 --if this is higher than the regular counter, use it instead + _detalhes.bcc_counter = 27 _detalhes.dont_open_news = true _detalhes.game_version = version _detalhes.userversion = version .. _detalhes.build_counter @@ -33,7 +33,7 @@ do local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" ) local news = { - {"v9.1.0.8782.144", "August 11th, 2021"}, + {"v9.1.0.8782.145", "August 11th, 2021"}, "Clicking on the minimap while the options panel is open will close it.", "Fixed Raid Check plugin position when the window is anchored at the top of the monitor.", "Shadow priest Void Erruption spells got merged into only one.", diff --git a/core/parser.lua b/core/parser.lua index a7cc1b61..f50a80f4 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -144,6 +144,12 @@ --> anywhere from a few hundred thousand damage to over 50 millons --> filtering it the best course of action as nobody should care about this damage } + + --army od the dead cache + local dk_pets_cache = { + army = {}, + apoc = {}, + } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants @@ -629,6 +635,7 @@ npcId = _tonumber(_select (6, _strsplit ("-", alvo_serial)) or 0) npcid_cache[alvo_serial] = npcId end + if (ignored_npcids[npcId]) then return end @@ -734,8 +741,19 @@ who_name = "Tank Add" end + if (npcId == 24207) then --army of the dead + --check if this is a army or apoc pet + if (dk_pets_cache.army[who_serial]) then + who_name = who_name .. "A" + else + if (dk_pets_cache.apoc[who_serial]) then + who_name = who_name .. "B" + end + end + end + --> avoid doing spellID checks on each iteration - if (special_damage_spells [spellid]) then + --if (special_damage_spells [spellid]) then --remove this IF due to have hit 60 local variables --> stagger if (spellid == SPELLID_MONK_STAGGER) then return parser:MonkStagger_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) @@ -748,7 +766,7 @@ elseif (spellid == SPELLID_PALADIN_LIGHTMARTYR) then -- or spellid == 183998 < healing part return parser:LOTM_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) end - end + --end ------------------------------------------------------------------------------------------------ --> check if need start an combat @@ -1739,6 +1757,14 @@ end -- + --differenciate army and apoc pets for DK + if (spellid == 42651) then --army of the dead + dk_pets_cache.army[alvo_serial] = who_name + + elseif (spellid == 42651) then --apoc + dk_pets_cache.apoc[alvo_serial] = who_name + end + --rename monk's "Storm, Earth, and Fire" adds --desligado pois poderia estar causando problemas if (npcId == 69792) then @@ -4883,6 +4909,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _table_wipe (_detalhes.encounter_table) _table_wipe (bargastBuffs) --remove on 10.0 _table_wipe (necro_cheat_deaths) --remove on 10.0 + _table_wipe (dk_pets_cache.army) + _table_wipe (dk_pets_cache.apoc) --remove on 10.0 spikeball from painsmith spikeball_damage_cache = { @@ -5637,6 +5665,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _table_wipe (reflection_events) _table_wipe (reflection_auras) _table_wipe (reflection_dispels) + + _table_wipe (dk_pets_cache.army) + _table_wipe (dk_pets_cache.apoc) damage_cache = setmetatable ({}, _detalhes.weaktable) damage_cache_pets = setmetatable ({}, _detalhes.weaktable)