Newly picked gem keeps its level 1 attribute requirement until the group is reprocessed

未关闭 适合新手
#10,428 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 8 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
79/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
backend

调研方向

从 src/Classes/SkillsTab.lua 中约第795–829行的宝石名称更改回调开始,然后阅读约第1226–1230行的 ProcessSocketGroup,以了解需求何时计算。检查宝石等级如何赋值,以及宝石组何时处理;完成的标志是新选中的宝石无需再次操作,就会以其默认等级显示属性需求和警告。Issue没有指定测试文件,因此请查找相关的SkillsTab测试或宝石需求测试。

由索引模型根据 Issue 内容生成。

描述

What happens

When you pick a gem into an empty gem row, its attribute requirement is worked out at gem level 1. That happens even though the row is then set to the default gem level (for example 20). The wrong requirement stays until something else reprocesses the socket group: selecting another group and coming back, editing the level, or reopening the build.

Steps:

  1. Skills tab, create a new socket group.
  2. In the first gem row, type and pick Arc (default gem level setting: e.g. "Normal maximum", so the row shows level 20).
  3. Look at the Int requirement: the sidebar requirement/warning, Calcs tab > Attributes "Int Requirement", or the gem's requirement in its tooltip.

Expected: the level-20 Arc Int requirement.
Actual: the level-1 Arc Int requirement. Clicking another socket group and then back to this one (or saving and reopening) changes it to the level-20 value with no edit made. A missing "you do not meet the Int requirement" warning can appear or disappear the same way.

Cause

In the gem-name change callback the group is processed before the new gem's level is set:

ProcessSocketGroup works out reqLevel/reqStr/reqDex/reqInt from gemInstance.level, which is still 1 for a new row (the instance is created with level = 1 at #L795-L804):

Then gemInstance.level = self:ProcessGemLevel(...) sets the real level, but nothing works out the requirement again. The rebuild that follows (Build.lua OnFrame -> UpdateSocketGroups -> BuildOutput) does not call ProcessSocketGroup for user groups. So CalcSetup puts the stale values into env.requirementsTableGems:

Possible fix

Call self:ProcessSocketGroup(self.displayGroup) again after gemInstance.level is assigned in the name callback, or compute the level before the first call.

主要语言
Lua
星标
5.5k
派生
2.4k
平均合并
6 天 14 小时
30 天内合并 PR
13

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PathOfBuildingCommunity/PathOfBuilding 的其他 Issue

查看 PathOfBuildingCommunity/PathOfBuilding 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。