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

Đang mở Phù hợp với người mới
#10,428 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 8 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
79/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại src/Classes/SkillsTab.lua, ở callback thay đổi tên gem quanh dòng 795–829. Sau đó đọc ProcessSocketGroup quanh dòng 1226–1230 để theo dõi thời điểm các yêu cầu được tính toán. Kiểm tra cách cấp cấp độ cho gem và thời điểm xử lý nhóm; công việc hoàn tất khi gem vừa được chọn dùng cấp độ mặc định cho yêu cầu thuộc tính và cảnh báo được hiển thị mà không cần thao tác nào khác. Issue không nêu tệp kiểm thử, vì vậy hãy tìm các kiểm thử SkillsTab hoặc kiểm thử yêu cầu gem có liên quan.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Lua
Star
5.5k
Fork
2.4k
Merge trung bình
6 ngày 14 giờ
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PathOfBuildingCommunity/PathOfBuilding

Tất cả issue của PathOfBuildingCommunity/PathOfBuilding

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.