Skip to content

Refactor buy similar to match by stat descriptors #2314

Draft
vaisest wants to merge 6 commits into
PathOfBuildingCommunity:devfrom
vaisest:refactor-buy-similar-matching-again
Draft

Refactor buy similar to match by stat descriptors #2314
vaisest wants to merge 6 commits into
PathOfBuildingCommunity:devfrom
vaisest:refactor-buy-similar-matching-again

Conversation

@vaisest

@vaisest vaisest commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

I don't think my previous approach of looking up mods that would fit the item was really correct. This doesn't have many advantages right now, but I think this is more maintainable (e.g. new mod categories don't need to be paid attention to), makes more sense, and solves some mod matching issues.

Basically, the idea is to convert the {n} pattern of stat descriptors to a Lua pattern, which we can then iterate over to find a match. Local vs global mods are handled similar to EE2 by just adding a count filter with all matched options

Some option-based mods were also fixed that were broken due to casing or incorrect newline handling. Timeless jewel mods are still broken because PoB splits it into two mods, but who cares. This allows for matching mods which can have various forms based on the mod value, and the same descriptors should also include data on whether the value should be negated. This should also fix some mods where the first number in the line is NOT what is entered on the trade site, although this only includes a handful of mods

I'm also going to add tests of some sort

Steps taken to verify a working solution:

  • lol

Link to a build that showcases this PR:

Before screenshot:

After screenshot:

Based on display item buy similar PR for testing purposes (first 3 commits)

@vaisest vaisest changed the title Add "Buy similar" button to display item controls Refactor buy similar to match by stat descriptors Jun 27, 2026
@vaisest vaisest added enhancement New feature, calculation, or mod pob1 Should also be merged into PoB1 Repo bug: behaviour Behavioral differences and removed enhancement New feature, calculation, or mod labels Jun 27, 2026
@vaisest vaisest marked this pull request as draft June 27, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: behaviour Behavioral differences pob1 Should also be merged into PoB1 Repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant