-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add option to allow auto-socketing timeless jewel #10226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LocalIdentity
merged 4 commits into
PathOfBuildingCommunity:dev
from
cupkax:auto-socket-timeless-jewel
Aug 26, 2026
+91
−4
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| describe("TestTimelessJewelSettings", function() | ||
| before_each(function() | ||
| newBuild() | ||
| end) | ||
|
|
||
| -- The finder's "Socket Jewel" toggle lives in timelessData, which only reaches the | ||
| -- build XML through the TimelessData element, so cover the save/load round trip. | ||
| it("round trips socketAllocate through the build XML", function() | ||
| build.timelessData.socketAllocate = true | ||
| local xmlText = build:SaveDB("code") | ||
| assert.is_truthy(xmlText:match('socketAllocate="true"')) | ||
|
|
||
| loadBuildFromXML(xmlText) | ||
| assert.is_true(build.timelessData.socketAllocate) | ||
| end) | ||
|
|
||
| it("omits socketAllocate from the build XML while unticked", function() | ||
| build.timelessData.socketAllocate = false | ||
| local xmlText = build:SaveDB("code") | ||
| assert.is_nil(xmlText:match("socketAllocate")) | ||
|
|
||
| loadBuildFromXML(xmlText) | ||
| assert.is_false(build.timelessData.socketAllocate) | ||
| end) | ||
|
|
||
| it("records the item addition when the target socket is unallocated", function() | ||
| local socketId, socketControl = next(build.itemsTab.sockets) | ||
| local result = { label = "10000:", seed = 10000, total = 1 } | ||
| build.spec.allocNodes[socketId] = nil | ||
| build.timelessData.socketAllocate = true | ||
| build.timelessData.sharedResults = { | ||
| type = { id = 2, label = "Lethal Pride" }, | ||
| conqueror = { id = 1 }, | ||
| socket = { id = socketId, label = "Socket" }, | ||
| desiredNodes = { }, | ||
| } | ||
| build.timelessData.searchResults = { result } | ||
| local control = new("TimelessJewelListControl"):TimelessJewelListControl(nil, { 0, 0, 300, 100 }, build) | ||
| local initialItemCount = #build.itemsTab.itemOrderList | ||
| build.itemsTab:ResetUndo() | ||
| build.itemsTab.modFlag = false | ||
|
|
||
| control:OnSelClick(1, result, true) | ||
|
|
||
| assert.are.equal(initialItemCount + 1, #build.itemsTab.itemOrderList) | ||
| assert.are.equal(0, socketControl.selItemId) | ||
| assert.is_true(build.itemsTab.modFlag) | ||
|
|
||
| build.itemsTab:Undo() | ||
| assert.are.equal(initialItemCount, #build.itemsTab.itemOrderList) | ||
| end) | ||
| end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Persist the auto-socket option and mark its change dirty
Codex reproduced that this checkbox only updates the in-memory
timelessData.socketAllocatevalue.Build:Savedoes not serialize it,Build:Loaddoes not restore it, and this callback does not setself.build.modFlag. Consequently, the option resets after a build reload and changing it alone does not mark the build dirty. The neighboringsocketFilteroption is both persisted and marks the build modified. Could we add this boolean to theTimelessDataload/save attributes, setself.build.modFlag = truehere, and cover the behavior with a save/load round-trip test? If reset-on-reload is intentional for safety, that session-only lifecycle should instead be made explicit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks for catching that, should be fixed now.