From 5c48b8d155e7a3af54c186bf5e483d22b0401a47 Mon Sep 17 00:00:00 2001 From: Jo Barthel Date: Sun, 25 Feb 2024 15:00:12 +0100 Subject: [PATCH] [UI] Show config option as valid if any active skill has valid flags and tags, not just the main skill. Currently a config option is set to show only if the selected main skill has both relevant tags and flags. For instance, when using a projectile skill with Point Blank, the user can change the Projectile distance travelled config and the DPS calculation will be update accordingly. If the user then changes the main skill dropdown to a non-projectile skill, the projectile distance travelled config will then appear as invalid, even when still affecting the DPS calculation. This also happens with similarly tag-limited config like any melee skill supported by Close Combat support. Note that if a skill with the correct tag is selected as main skill, the config will show as valid, even though the the DPS of the selected skill is not affected by the config. For instance, if a Boneshatter gem is linked to Close Combat support, the config will appear valid as long as a melee skill is selectd as main skill, even if that melee skill is not supported by Close Combat (for instance an unlinked leap slam). This is confusing for some users. This commit makes it so as long as any active skill has a corresponding tag, the confg will show as valid. This will not affect DPS calculations as the tagTypesUsed and modsUsed arrays are only checked by the Config Tab UI code. A possible downside is that someone could accidentally link say, Close Combat to Leap Slam, and then get confused why the config tab is appearing but not affecting their actual skill dps. I think this is less potentially confusing for anyone who is familiar with PoE than the current state. --- src/Classes/ConfigTab.lua | 14 ++++++++++---- src/Modules/Calcs.lua | 22 ++++++++++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/Classes/ConfigTab.lua b/src/Classes/ConfigTab.lua index 93b9313d63..772f38fc6b 100644 --- a/src/Classes/ConfigTab.lua +++ b/src/Classes/ConfigTab.lua @@ -417,10 +417,16 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont end if varData.ifFlag then t_insert(shownFuncs, listOrSingleIfOption(varData.ifFlag, function(ifOption) - local skillModList = self.build.calcsTab.mainEnv.player.mainSkill.skillModList - local skillFlags = self.build.calcsTab.mainEnv.player.mainSkill.skillFlags - -- Check both the skill mods for flags and flags that are set via calcPerform - return skillFlags[ifOption] or skillModList:Flag(nil, ifOption) + for _, activeSkill in ipairs(self.build.calcsTab.mainEnv.player.activeSkillList) do + local skillModList = activeSkill.skillModList + local skillFlags = activeSkill.skillFlags + + -- Check both the skill mods for flags and flags that are set via calcPerform + if skillFlags[ifOption] or skillModList:Flag(nil, ifOption) then + return true + end + end + return false end)) end if varData.ifMod then diff --git a/src/Modules/Calcs.lua b/src/Modules/Calcs.lua index a1c8e75d7b..266396a75a 100644 --- a/src/Modules/Calcs.lua +++ b/src/Modules/Calcs.lua @@ -580,15 +580,15 @@ function calcs.buildOutput(build, mode) end end for _, activeSkill in pairs(env.player.activeSkillList) do + local uuid = cacheSkillUUID(activeSkill, env) + if not GlobalCache.cachedData["CACHE"][uuid] then + calcs.buildActiveSkill(env, "CACHE", activeSkill) + end + for _, mod in ipairs(activeSkill.baseSkillModList) do addModTags(env.player, mod) end - for _, mod in ipairs(activeSkill.skillModList) do - addTo(env.modsUsed, mod.name, mod) - for _, tag in ipairs(mod) do - addTo(env.tagTypesUsed, tag.type, mod) - end - end + if activeSkill.minion then for _, activeSkill in pairs(activeSkill.minion.activeSkillList) do for _, mod in ipairs(activeSkill.baseSkillModList) do @@ -596,6 +596,16 @@ function calcs.buildOutput(build, mode) end end end + + if GlobalCache.cachedData["CACHE"][uuid] then + skillModList = GlobalCache.cachedData["CACHE"][uuid].ActiveSkill.skillModList + for _, mod in ipairs(skillModList) do + addTo(env.modsUsed, mod.name, mod) + for _, tag in ipairs(mod) do + addTo(env.tagTypesUsed, tag.type, mod) + end + end + end end for modName, modList in pairs(env.enemyDB.mods) do for _, mod in ipairs(modList) do