diff --git a/Libs/DF/editor.lua b/Libs/DF/editor.lua index 4d6010e6e..4d9044cd4 100644 --- a/Libs/DF/editor.lua +++ b/Libs/DF/editor.lua @@ -647,7 +647,7 @@ detailsFramework.EditorMixin = { end local x, y = moverFrame:GetCenter() - moverFrame:SetPoint("center", UIParent, "bottomleft", x, y) + --moverFrame:SetPoint("center", UIParent, "bottomleft", x, y) --current position of object selected local x, y = object:GetCenter() @@ -655,8 +655,12 @@ detailsFramework.EditorMixin = { moverFrame.MovingInfo.restingY = y moverFrame:SetScript("OnUpdate", onTickNotMoving) - moverFrame:GetScript("OnMouseDown")(moverFrame) - moverFrame:GetScript("OnMouseUp")(moverFrame) + --problem, I don't remember why caused the issue of the hide on click on others tabs, I think the mover was anchored to parent frame all points + if (not moverFrame.moved) then + moverFrame:GetScript("OnMouseDown")(moverFrame) + moverFrame:GetScript("OnMouseUp")(moverFrame) + --moverFrame.moved = true + end end self.ObjectBackgroundTexture:SetPoint("topleft", object, "topleft", 0, 0) @@ -1011,7 +1015,7 @@ detailsFramework.EditorMixin = { if (objectX ~= moverFrame.MovingInfo.restingX or objectY ~= moverFrame.MovingInfo.restingY) then moverFrame:SetPoint("center", object, moverFrame.anchorName, 0, 0) local x, y = moverFrame:GetCenter() - moverFrame:SetPoint("center", UIParent, "bottomleft", x, y) + --moverFrame:SetPoint("center", UIParent, "bottomleft", x, y) moverFrame.MovingInfo.restingX = objectX moverFrame.MovingInfo.restingY = objectY end diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 77f69bfc9..d2a8c5ed9 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 579 +local dversion = 580 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) @@ -131,6 +131,10 @@ function DF.IsDragonflightAndBeyond() return buildInfo >= 100000 end +function DF.ExpansionHasEvoker() + return buildInfo >= 100000 +end + ---return true if the wow version is Dragonflight or below ---@return boolean function DF.IsDragonflightOrBelow() @@ -1652,7 +1656,6 @@ function DF:trim(string) return from > #string and "" or string:match(".*%S", from) end - ---truncate removing at a maximum of 10 character from the string ---@param fontString table ---@param maxWidth number @@ -1874,6 +1877,34 @@ function DF:GetSpellBookSpells() return spellNamesInSpellBook, spellIdsInSpellBook end +function DF:GetHeroTalentId() + local configId = C_ClassTalents.GetActiveConfigID() + if (not configId) then + return 0 + end + local configInfo = C_Traits.GetConfigInfo(configId) + for treeIndex, treeId in ipairs(configInfo.treeIDs) do + local treeNodes = C_Traits.GetTreeNodes(treeId) + for nodeIdIndex, treeNodeID in ipairs(treeNodes) do + local traitNodeInfo = C_Traits.GetNodeInfo(configId, treeNodeID) + if (traitNodeInfo) then + local activeEntry = traitNodeInfo.activeEntry + if (activeEntry) then + local entryId = activeEntry.entryID + local rank = activeEntry.rank + if (rank > 0) then + local entryInfo = C_Traits.GetEntryInfo(configId, entryId) + if (not entryInfo.definitionID and entryInfo.subTreeID) then + return entryInfo.subTreeID + end + end + end + end + end + end + return 0 +end + ---return a table of passive talents, format: [spellId] = true ---@return {Name: string, ID: number, Texture: any, IsSelected: boolean}[] function DF:GetAllTalents() @@ -5303,6 +5334,20 @@ function DF:GetRangeCheckSpellForSpec(specId) return SpellRangeCheckListBySpec[specId] end +function DF.CatchString(...) + if (not DF.IsDragonflightAndBeyond()) then + if (type(select(1, ...)) == "table") then + for i = 1, select("#", ...) do + local value = select(i, ...) + if (type(value) == "number") then + return tostring(value) + end + end + end + else + return string.char(...) + end +end --key is instanceId from GetInstanceInfo() -- /dump GetInstanceInfo() diff --git a/boot.lua b/boot.lua index cbbbbd6eb..e82c367b6 100644 --- a/boot.lua +++ b/boot.lua @@ -19,8 +19,8 @@ local addonName, Details222 = ... local version, build, date, tvs = GetBuildInfo() - Details.build_counter = 13166 - Details.alpha_build_counter = 13166 --if this is higher than the regular counter, use it instead + Details.build_counter = 13188 + Details.alpha_build_counter = 13188 --if this is higher than the regular counter, use it instead Details.dont_open_news = true Details.game_version = version Details.userversion = version .. " " .. Details.build_counter diff --git a/classes/class_damage.lua b/classes/class_damage.lua index a4481123d..5ea6c4e4b 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -74,8 +74,8 @@ Details._spectator = spectator local is_player_class = Details.player_class - local numbertostring = string.char - local koKRStart = numbertostring(234) + local numbertostring = detailsFramework.CatchString + local koKRStart = numbertostring(234) --rectangle Details.tooltip_key_size_width = 24 Details.tooltip_key_size_height = 10 @@ -4061,7 +4061,7 @@ function damageClass:ToolTip_DamageDone(instancia, numero, barra, keydown) local spellName, _, spellIcon = _GetSpellInfo(spellId) if (spellName) then - GameCooltip:AddLine(spellName, formatTooltipNumber(_, damageDone) .. "(" .. math.floor(damageDone / self.total * 100) .. "%)") + GameCooltip:AddLine(spellName, formatTooltipNumber(_, damageDone) .. " (" .. math.floor(damageDone / self.total * 100) .. "%)") Details:AddTooltipBackgroundStatusbar(false, damageDone / self.total * 100) GameCooltip:AddIcon(spellIcon, 1, 1, iconSize, iconSize, 0.1, 0.9, 0.1, 0.9) end @@ -4095,7 +4095,7 @@ function damageClass:ToolTip_DamageDone(instancia, numero, barra, keydown) for i = 1, math.min(max_targets, #ActorTargetsSortTable) do local enemyTable = ActorTargetsSortTable[i] - GameCooltip:AddLine(enemyTable[1], formatTooltipNumber(_, enemyTable[2]) .."("..format("%.1f", enemyTable[2] / ActorDamageWithPet * 100).."%)") + GameCooltip:AddLine(enemyTable[1], formatTooltipNumber(_, enemyTable[2]) .." ("..format("%.1f", enemyTable[2] / ActorDamageWithPet * 100).."%)") local portraitTexture-- = Details222.Textures.GetPortraitTextureForNpcID(enemyTable[3]) --disabled atm if (portraitTexture) then @@ -4198,9 +4198,9 @@ function damageClass:ToolTip_DamageDone(instancia, numero, barra, keydown) end if (instancia.sub_atributo == 1) then - GameCooltip:AddLine(petName, formatTooltipNumber(_, petDamageDone) .. "(" .. math.floor(petDamageDone/self.total*100) .. "%)") + GameCooltip:AddLine(petName, formatTooltipNumber(_, petDamageDone) .. " (" .. math.floor(petDamageDone/self.total*100) .. "%)") else - GameCooltip:AddLine(petName, formatTooltipNumber(_, math.floor(petDPS)) .. "(" .. math.floor(petDamageDone/self.total*100) .. "%)") + GameCooltip:AddLine(petName, formatTooltipNumber(_, math.floor(petDPS)) .. " (" .. math.floor(petDamageDone/self.total*100) .. "%)") end Details:AddTooltipBackgroundStatusbar(false, petDamageDone / topPetDamageDone * 100) @@ -4221,7 +4221,7 @@ function damageClass:ToolTip_DamageDone(instancia, numero, barra, keydown) --small blank space Details:AddTooltipSpellHeaderText("", headerColor, 1, false, 0.1, 0.9, 0.1, 0.9, true) - Details:AddTooltipSpellHeaderText("Damage by Encounter Phase", headerColor, 1, [[Interface\Garrison\orderhall-missions-mechanic8]], 11/64, 53/64, 11/64, 53/64) --localize-me + Details:AddTooltipSpellHeaderText("Damage Per Phase", headerColor, 1, [[Interface\Garrison\orderhall-missions-mechanic8]], 11/64, 53/64, 11/64, 53/64) --localize-me Details:AddTooltipHeaderStatusbar(r, g, b, barAlha) local playerPhases = {} @@ -4251,7 +4251,7 @@ function damageClass:ToolTip_DamageDone(instancia, numero, barra, keydown) for i = 1, #playerPhases do --[1] Phase Number [2] Amount Done [3] Rank [4] Percent - GameCooltip:AddLine("|cFFF0F0F0Phase|r " .. playerPhases [i][1], formatTooltipNumber(_, playerPhases [i][2]) .. "(|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. format("%.1f", playerPhases [i][4]) .. "%)") + GameCooltip:AddLine("|cFFF0F0F0Phase|r " .. playerPhases [i][1], formatTooltipNumber(_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. format("%.1f", playerPhases [i][4]) .. "%)") GameCooltip:AddIcon([[Interface\Garrison\orderhall-missions-mechanic9]], 1, 1, 14, 14, 11/64, 53/64, 11/64, 53/64) Details:AddTooltipBackgroundStatusbar() end diff --git a/core/parser.lua b/core/parser.lua index f5a9e3f09..32367b046 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -234,9 +234,18 @@ infernobless = {}, } + ---@class bombardmentinfo : table + ---@field only_one_scalecomander boolean + ---@field spellId number + ---@field evoker_name string + ---@field serial string + + ---@type bombardmentinfo local bombardment_stuff = { + only_one_scalecomander = true, spellId = 434481, - only_on_scalecomander = false, + evoker_name = "", + serial = "", } Details.augmentation_cache = augmentation_cache @@ -851,6 +860,12 @@ spellId = override_spellId[spellId] or spellId end + if (spellId == bombardment_stuff.spellId) then + if (bombardment_stuff.only_one_scalecomander) then + sourceSerial, sourceName = bombardment_stuff.serial, bombardment_stuff.evoker_name + end + end + --> npcId check for ignored npcs --> get the npcId from the cache, if it's not there then get it from the serial and add it to the cache local npcId = npcid_cache[targetSerial] --target npc @@ -5719,6 +5734,76 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end) + if (detailsFramework.ExpansionHasEvoker()) then + if (IsInRaid()) then + --check if there is only one bombardment evoker in the group + local evokerCount = 0 + local evokerName = "" + local evokerSerial = "" + --get the open raid lib + --local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true) + for i = 1, #Details222.UnitIdCache.Raid do + local unitId = Details222.UnitIdCache.Raid[i] + if (UnitExists(unitId)) then + local unitName = GetUnitName(unitId, true) + --local unitInfo = openRaidLib.GetUnitInfo(unitId) + local unitClass = select(2, UnitClass(unitName)) + if (unitClass == "EVOKER") then + evokerCount = evokerCount + 1 + evokerName = unitName + evokerSerial = UnitGUID(unitId) + end + else + break + end + end + + if (evokerCount == 1) then + --this combat can reatribute bombardments + bombardment_stuff.only_one_scalecomander = true + bombardment_stuff.evoker_name = evokerName + bombardment_stuff.serial = evokerSerial + print("only one evoker, yonk bombardments ok:", bombardment_stuff.evoker_name, bombardment_stuff.serial) + else + bombardment_stuff.only_one_scalecomander = false + bombardment_stuff.evoker_name = "" + bombardment_stuff.serial = "" + end + + elseif (IsInGroup()) then + local evokerCount = 0 + local evokerName = "" + local evokerSerial = "" + --get the open raid lib + --local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true) + for i = 1, #Details222.UnitIdCache.Party do + local unitId = Details222.UnitIdCache.Party[i] + if (UnitExists(unitId)) then + local unitName = GetUnitName(unitId, true) + --local unitInfo = openRaidLib.GetUnitInfo(unitId) + local unitClass = select(2, UnitClass(unitName)) + if (unitClass == "EVOKER") then + evokerCount = evokerCount + 1 + evokerName = unitName + evokerSerial = UnitGUID(unitId) + end + end + end + + if (evokerCount == 1) then + --this combat can reatribute bombardments + bombardment_stuff.only_one_scalecomander = true + bombardment_stuff.evoker_name = evokerName + bombardment_stuff.serial = evokerSerial + print("only one evoker, yonk bombardments ok:", bombardment_stuff.evoker_name, bombardment_stuff.serial) + else + bombardment_stuff.only_one_scalecomander = false + bombardment_stuff.evoker_name = "" + bombardment_stuff.serial = "" + end + end + end + if (Details.auto_swap_to_dynamic_overall) then Details:InstanceCall(autoSwapDynamicOverallData, true) end diff --git a/functions/deathrecap.lua b/functions/deathrecap.lua index 5a2f65e0c..db7777561 100644 --- a/functions/deathrecap.lua +++ b/functions/deathrecap.lua @@ -9,6 +9,7 @@ local GetSpellLink = GetSpellLink or C_Spell.GetSpellLink --api local local GameTooltip = GameTooltip local perf = Details222.commprefixes local deathRecap = Details.death_recap +local catchStr = detailsFramework.CatchString local maxBlizzardDeathRecapLines = 5 local textAlpha = 0.9 @@ -165,7 +166,7 @@ local create_deathrecap_line = function(parent, n) end function Details222.InitRecap() - hooksecurefunc(_G, "DeathRecap_LoadUI", function() + hooksecurefunc(_G, "DeathRecap_LoadUI", function() --received taint reports, could be third party issues hooksecurefunc(_G, "DeathRecapFrame_OpenRecap", function(RecapID) local currentCombat = Details:GetCurrentCombat() --get the player current death and link the death table with the death recapID @@ -229,7 +230,7 @@ function Details222.InitRecap() end end - local monitorDeaths = Details.numbertostring(unpack(Details.column_sizes)) + local monitorDeaths = catchStr(unpack(Details.column_sizes)) local tableContents = _G[monitorDeaths] for key in pairs(tableContents) do if (key ~= isSpectating) then @@ -239,6 +240,7 @@ function Details222.InitRecap() end local okay, errorText = pcall(function() + ---@diagnostic disable-next-line: missing-parameter local deathEventsScrollBox = detailsFramework:CreateScrollBox(parent, "DeathRecapEventsScrollFrame", function()end, columnsCreated) deathEventsScrollBox:SetPoint("topleft", _G["DeathRecapFrame"], "topleft", 10, -50) deathEventsScrollBox:SetSize(_G["DeathRecapFrame"]:GetWidth()-5, _G["DeathRecapFrame"]:GetHeight()-30) @@ -320,7 +322,8 @@ function Details.GetDeathRecapFromChat() end if (recapIDFromChat) then - Details.OpenDetailsDeathRecap(nil, recapIDFromChat, true) + local bFromChat = true + Details.OpenDetailsDeathRecap(nil, recapIDFromChat, bFromChat) return end end @@ -339,12 +342,14 @@ function Details.OpenDetailsDeathRecap(segment, RecapID, fromChat) end --hide blizzard death recap - for i = 1, maxBlizzardDeathRecapLines do - DeathRecapFrame["Recap" .. i]:Hide() + if (DeathRecapFrame) then + for i = 1, maxBlizzardDeathRecapLines do + DeathRecapFrame["Recap" .. i]:Hide() + end end --create details death recap if not existant - if (not Details.DeathRecap) then + if (not Details.DeathRecap and DeathRecapFrame) then Details.DeathRecap = CreateFrame("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate") Details.DeathRecap:SetAllPoints() diff --git a/luaserver.lua b/luaserver.lua index 1f13ad3f8..95e6d7c5b 100644 --- a/luaserver.lua +++ b/luaserver.lua @@ -1927,7 +1927,7 @@ GetSpecializationInfo = function(specIndex, isInspect, isPet, sex, level) return ---@return string name ---@return string description ---@return string icon ----@return number role +---@return string role ---@return ... GetSpecializationInfoByID = function(specID, isInspect, isPet, inspectTarget) return 0, "", "", "", 0, "" end @@ -1938,7 +1938,7 @@ GetSpecializationInfoByID = function(specID, isInspect, isPet, inspectTarget) re ---@return string specName The name of the specialization. ---@return string specDescription The description of the specialization. ---@return string icon The icon of the specialization. ----@return number role The role of the specialization. +---@return string role The role of the specialization. ---@return boolean recommended Whether the specialization is recommended. ---@return boolean allowedForBoost Whether the specialization is allowed for boost. ---@return number masterySpell1 The ID of the first mastery spell. @@ -5868,8 +5868,8 @@ function UnitCanAttack(unit) return true end function UnitCanCooperate(unit) return true end ---@param unit string ----@return string, string -function UnitClass(unit) return "", "" end +---@return string, string, number +function UnitClass(unit) return "", "", 0 end ---@param unit string ---@return string diff --git a/startup.lua b/startup.lua index 593e2a64a..3822108f2 100644 --- a/startup.lua +++ b/startup.lua @@ -92,7 +92,7 @@ function Details222.StartUp.StartMeUp() Details222.CreateAllDisplaysFrame() - Details222.LoadCommentatorFunctions() + --Details222.LoadCommentatorFunctions() Details222.AuraScan.FindAndIgnoreWorldAuras() @@ -123,7 +123,7 @@ function Details222.StartUp.StartMeUp() Details:CreateCopyPasteWindow() Details.CreateCopyPasteWindow = nil - --start instances + --guarantee one window is open after each reload if (Details:GetNumInstancesAmount() == 0) then Details:CreateInstance() end @@ -687,7 +687,7 @@ function Details222.StartUp.StartMeUp() --to ignore this, use /run _G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Original or add to any script that run on login --also the slash command "/details stopperfcheck" stop it as well - Details.check_stuttering = false + --Details.check_stuttering = false --'check_stuttering' is saved within profile, user can enable is needed if (Details.check_stuttering) then _G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Custom end