Skip to content

Weapon type filter - #2

Open
shimotron wants to merge 2 commits into
ProfetGit:masterfrom
shimotron:weapon-type-filter
Open

Weapon type filter#2
shimotron wants to merge 2 commits into
ProfetGit:masterfrom
shimotron:weapon-type-filter

Conversation

@shimotron

Copy link
Copy Markdown

Adds a "Weapon types considered" section to the General page, mirroring
the existing armor-type filter. Unchecked weapon subtypes stop generating
upgrade arrows, tooltip verdicts, loot alerts, and quest-reward marks.
Useful for hiding weapon kinds you can equip but don't want to gear (e.g.
a caster hiding staff/2H arrows).

Built by mirroring the armor-filter pattern across the same touch points
(storage in 01_profiles, a "wrongweapon" gate in 04_score next to
"wrongarmor", accessors in 09_lootalert, checkboxes in RefactorGearUI,
label in 05_tooltip).

Two bugs found and fixed while building it:

  1. GetItemInfo returns PLURAL subtype strings ("Bows", "Guns", "Staves"),
    not singular, so a hardcoded list never matched. Now queries the
    client's own subclass list.
  2. The weapon item class is not at a fixed index on this client (index 2
    is Armor). Now locates the class by name via GetAuctionItemClasses,
    with a weapon-word safety net so a wrong index can't leak armor names
    onto the page.

Filtering is per character and hide-only. Verified by syntax check and
offline simulation of the addon's own code against the Ascension live
client's subtype/class strings, not in-client, so worth a spot-check
before merging. Credit to a couple of us on the CoA Discord who surfaced
the plural-string bug testing bows and polearms.

Heads-up: the diff looks huge (thousands of lines) due to a line-ending
change on upload, not real edits. The actual change is ~small; the
line-ending noise can be normalized if you'd prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant