This makes several changes to the KEquipMenu plumbing that may not be readily visible until long text is viewed.
Fixes several issues in #152, although only for the Equip menus.
There are three interactive sections of the Equip menu:
Choosing whether to Equip/Remove or auto-Equip/Clear
Choosing the equipment slot (weapon, shield, etc.) to equip to, or remove from
Choosing from the available equipment in the party's bag to equip.
The old logic had 3-4 nested while() loops; this was reduced to a single loop and adds an input handler to transition between 1, 2 and 3 above.
I did find it annoying to press-and-release up/down to go between long lists of equipment, so I added a check for the keyboard-repeat case so the player can just hold down their arrow keys for a more natural navigation feel.
The major amount of plumbing, though, was to display ExtraLongText in the hero's name, those 4 "Equip" ,"Remove", "Optimize" and "Clear" options in section 1, the gettext _("...") localized menu text, and equipment slots with an ellipsis (sorry @z9484 if this ignores your feature/add_ellipsis work! I had started this a few weeks ago and didn't want to push up until it was closer to being finished).
The main difference between z9484's codepoint and this one, is that I decided to use \t (tab) instead, so it's easier to add into Lua scripts in case a user doesn't have that Unicode … character on their system (for whatever reason, Visual Studio adds … as a totally different UTF-16 point than vscode, vim, etc. and so it wasn't mapping properly).
This makes several changes to the KEquipMenu plumbing that may not be readily visible until long text is viewed.
Fixes several issues in #152, although only for the Equip menus.
There are three interactive sections of the Equip menu:
The old logic had 3-4 nested
while()
loops; this was reduced to a single loop and adds an input handler to transition between 1, 2 and 3 above.I did find it annoying to press-and-release up/down to go between long lists of equipment, so I added a check for the keyboard-repeat case so the player can just hold down their arrow keys for a more natural navigation feel.
The major amount of plumbing, though, was to display ExtraLongText in the hero's name, those 4 "Equip" ,"Remove", "Optimize" and "Clear" options in section 1, the gettext
_("...")
localized menu text, and equipment slots with an ellipsis (sorry @z9484 if this ignores your feature/add_ellipsis work! I had started this a few weeks ago and didn't want to push up until it was closer to being finished).The main difference between z9484's codepoint and this one, is that I decided to use
\t
(tab) instead, so it's easier to add into Lua scripts in case a user doesn't have that Unicode…
character on their system (for whatever reason, Visual Studio adds…
as a totally different UTF-16 point than vscode, vim, etc. and so it wasn't mapping properly).