[Ohrrpgce] Textboxes and menus

Ralph Versteegen teeemcee at gmail.com
Sat Jun 3 20:28:49 PDT 2017


Showing a textbox and a menu at once is wonky, and I didn't understand at
all how it worked until spending 20 min reading the source, so I think it's
safe to say tahat very few people do.
Keypresses only affect the top-most menu, but they generally are also
interpreted by the textbox, except the textbox is not affected if the menu
suspends gameplay.
(Interestingly, opening a menu is the only way to suspend choicebox cursor
controls)

So, if not suspending gameplay, pressing enter will cause both the textbox
to close and the menu to activate... unless the selected menu item is one
of the builtin menus, in which case the enter keypress will be cleared when
leaving the menu, so that the textbox doesn't close.

Even worse, when showing a textbox with a choice box at the same time as a
menu the arrows keys affect both of them! This clearly should be fixed, but
I think the Enter behaviour is bad too.

Currently you can give the menu sole focus by setting it to suspend
gameplay, and you can give the textbox focus by setting "No player control
of menu", although then you need to use a script to close the menu.

Clearly to change anything we need a backcompat bit, but it's not easy to
see what to change to. I want to simplify, not make it make complicated.
I think we need to track whether the textbox or the menu has focus
(whichever was opened last), and maybe even (virtually) put the textbox in
the menu stack.
So if a menu is opened from a textbox, or a textbox from a menu, then it
takes focus; but we also will want a way to override that; maybe the 'No
controls' menu bit can be repurposed.

Also, maybe we should think ahead to the possible ability to have mutliple
textboxes open at once, on a stack.

(I also think it's strange that ESC doesn't advance textbox, so would like
to add a backcompat or pref bitset for that.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20170604/d2f83c99/attachment.htm>


More information about the Ohrrpgce mailing list