Skip to content

Limit visible characters in item names to 56 per line, up to 72 in total - #104

Draft
FiltersBy-Erazure wants to merge 1 commit into
Project-Diablo-2:mainfrom
FiltersBy-Erazure:item-name-line-limit
Draft

FiltersBy-Erazure wants to merge 1 commit into
Project-Diablo-2:mainfrom
FiltersBy-Erazure:item-name-line-limit

Conversation

@FiltersBy-Erazure

Copy link
Copy Markdown

Change: TrimItemText now limits each line of an item name to MAX_ITEM_NAME_LINE_SIZE (56 visible characters per line) and the whole name to MAX_ITEM_NAME_TOTAL_SIZE (72 visible characters in total). The 128-character buffer cap in Item::ItemNamePatch is unchanged.

Why: Loot filters build multi-line item names. For example, a unique item has an item name, a base item name, then a line of tags for variable rolls / corruptions. The current limit of 56 total characters truncates the top line of an item name, eating the item's name from the right side. Limiting characters per line keeps every label within today's maximum width while letting multi-line names avoid truncation.

tyraels-might-name-limit

Compatibility: One-line names are cut exactly as before. Any name that fits today is left as is, and keeping the per line character limit at 56 avoids excessively wide item name boxes.

Buffer: At 72 visible characters, about 17 color codes still fit in the 128-character name buffer. Beyond that, the existing cap cuts the name, as it does today with color-heavy names.

TrimItemText limited a whole item name to 56 visible characters, so a
multi-line name (unique name, base, a line of tags) was cut from the end
of its top line while its widest line was much shorter. Each line now
keeps the 56 limit (MAX_ITEM_NAME_LINE_SIZE), so labels are no wider than
before, and a whole name may hold up to 72 (MAX_ITEM_NAME_TOTAL_SIZE).
Names that fit today are unchanged, one-line names are cut as before,
and shop items keep 512.
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