Closed fmmaks666 closed 1 year ago
For clarification: is this fix only to work around long descriptions? If so, you could still preserve the name HUD but perform a string length check to then shorten the description to the first line and first (e.g.) 50 characters.
EDIT: In case overlaps with other HUD elements are an issue, it might make sense (in regard to #135) to take other mods into account to place the item name element in a better position.
This change is a small addition to the customization. Well, item names are sometimes useful, so I'll try to implement a fix for them as soon as possible.
// It's not related to #135.
Added option to show only first line of item's description, option to truncate item's description if its too long. Before: After: Before: After (Max length can be changed): Also: Before on Mobile: After on Mobile: Sorry for Image spam...
FYI: \x1B(T@default)
indicates a translation, where default
is the textdomain. If you want to it 100% properly, you could use minetest.get_translated_string
on the item description before cropping it (using a cached per-player language value from minetest.get_player_information(
).
Unfortunately I cannot find any helper function to strip translation marks. Not handling them might however cause visual errors or warnings on the client.
Thanks. Works. Will merge in a few days unless there are objections.
Added option to disable Item Names.
Purpose of change
This change allows players to disable item names, addressing the issue of long item descriptions taking up too much screen space in certain mods (e.g., ranged weapons).
Alternative solution
Show only first line of Item's description