Implemented nancy3's PianoPuzzle action record. Since the
record is extremely similar to OrderingPuzzle, the latter's
implementation was extended to cover both record types.
Added facilities for deferred loading of data that would take
far too long for a single frame. Deferred loading is
executed after the regular loop, where the system would
previously just sleep. Added deferred loading to RaycastPuzzle, which now no longer freezes the game
while initializing.
The top menu bar was problematic to control on touch based systems
since the default behaviour for taps is to send button down and up
events on taps. Make the top menu work in this case as well by
closing the menu only when the user have made a decision.
Clear the selection after deleting a character.
Not doing so can result in out-of-bounds reads in
EditTextWidget::drawWidget(), where _selCaretPos and _selOffset are
used as offsets, and to a failed assertion when calling
EditableWidget::defaultKeyDownHandler():
gui/widgets/editable.cpp:566:
bool GUI::EditableWidget::setCaretPos(int):
Assertion `newPos >= 0 && newPos <= (int)_editString.size()' failed.
Fixes#14584
Fixed the dependency code so dependencies marked with
an orFlag can be chained (that is, we can have more than
two of them at a time). This makes the chiming clock in
nancy3 actually work.
Added support for 3D sound, as introduced in nancy3.
The original engine used DirectSound 3D, which enabled
for easy sound panning, attenuation based on distance,
and doppler effect simulation. The DS3D algorithm
has only been approximated; in particular, there are some
minor differences when it comes to sound panning.
The UITextField protocol function:
"textField: shouldChangeCharactersInRange: replacementString:"
was sometimes called with empty replacementStrings on key press
releases on keyboard. That triggered a backspace keyboard char to
be sent which caused problems when trying to remap actions to
other keyboard keys. No matter which key you were pressing the
resulting key would always be the backspace key.
Only handle text input using the UITextField protocol function
when the replacement string isn't empty. Handle all deletes through
the UITextInput protocol function "deleteBackword".
This has been tested in both cases when the UITextField is empty
(but GUI text field has text) and when the UITextField has text
(which has been added using the SoftKeyboard).
It has also been tested on Apple TV where a software keyboard is
shown with a big text field.
Instead of register input based on if hardware is connected or not
register input based on backend capabilities.
Mouse support is default supported through touch events on screen
(iOS) or touch on controller (Apple TV), and through connected
mouse hardwares. Gamepad controllers are supported from iOS 14 and
later.
Register mouse and gamepad input based on above capabilities to be
able to map actions to buttons on these input devices.
Keyboard support is to be added but not in this commit.
Remove the "isConnected" methods for each input and change the same
method for game controllers to a "isSupported" function to deal
with the iOS version support.
Remove the sending of the EVENT_INPUT_CHANGED event due to the
above reasons. The overide of the isConnected property function is
also removed due to this reason. It caused problems that key
mappings were reset on connections/disconnections.
The gamepad controller dpad button vaule change handler callback,
also called for the virtual controller dpad buttons, sent events
also for buttons not being pressed or released.
E.g. when the left dpad button was pressed an event was sent,
JOYSTICK_BUTTON_DPAD_LEFT with value 1 meaning it's pressed DOWN.
However, the other dpad buttons also did send their events but with
value 0 meaning UP. This had no impact for most of the games but
"The Griffon Legend" handles the dpad events a bit different where
the character is kept moving when the button is released. It meant
that the engine was triggering movements on both the event
EVENT_CUSTOM_ENGINE_ACTION_START and EVENT_CUSTOM_ENGINE_ACTION_END.
This commit changes the dpad button input handling so it remembers
the current state for UP/DOWN and LEFT/RIGHT. This ensures that only
the button that changes state is triggering an event.