The font module kept a global "currently selected font" set by
font_select() and implicitly used when drawing. Make it stateless by
introducing a FontSpec {type, weight, size} that font_render_text() /
font_draw_text() and gfx_drawString() take directly.
Make FontWeight a two-valued enum and normalize the 1-9 weight to it
in commandZB().
Removes font_select(), ags_setFont() and ags_setFontWithWeight().
In TT2, keyboard/gamepad navigation is implemented by moving the mouse
cursor using IZ command. It did not work in browsers where mouse cursor
could not be moved or when mouse movement was disabled from the menu.
Now IZ command updates the internal mouse coordinates even when the
cursor cannot be moved.
These commands accept 0-127 as valid window numbers, which were 1-128
before this change.
To maintain savedata compatibility, window positions are saved in the
order 1,...,127,0.
- ags_drawString() returns a bounding box of the text so that callers
can update the screen appropriately.
- Use total font height (not only ascent) for vertical positioning.
- Any key input detected in skippable wait functions will cancel the
skip mode (regardless of skipModeInterruptable value).
- Space key (right click) in sys_getInputInfo() will no longer cancel
the skip mode.
- Add 30ms wait in sys_hit_any_key() (used by the 'A' command) so that
users can see what's going on while skipping.
- Cancel the skip mode when opening a menu, not when closing it.
The new behavior matches System 3.9.
- Use sel.WinFrameColor to draw selection cursor in EncloseType=0
- Implement EncloseType=1 (thick selection cursor)
- It always uses color 255, not WinFrameColor (System 3.9 bug?)
- EncloseType=2 uses MsgFontColor for background, WinBackgroundColor for
text