The stick moves the player through the game's input state (keyboard_controls_update), as the keys do, so it moves with a southpaw or legacy stick layout too, where it was the left stick. The buttons are named by the profile's button layout, which the game sends the overlay as it changes (host_touch_bindings): with Swap triggers the right trigger's button says Grenade.
No control is smaller than a finger (48 dp across). The overlay's opacity can be set; a floating move stick (off by default) goes where the thumb lands in the lower left. Hide is remembered, and Hide and Options act as the finger lifts on them, so a swipe that starts on them aims rather than opens the options mid-fight. A label too long for its button is drawn smaller.
TouchControls, TouchLayout, GyroscopeAim and HaloActivity's touch layout files in the repository's style; the layout file is version 3 (opacity, floating stick), and versions 1 and 2 still load. CI runs the layout tests.
An overlay over the game, from JoshRob297's halo-ce-touch, which ported
theLlamaNet's halo-ce-android: a stick, the controller's buttons with word
labels, swipe aiming, optional gyroscope aiming, the phone's vibration, and
an editor to move, resize, hide, copy, export and import the buttons. It
is player 1's controller, merged into port 0's state as the keyboard is.
Changes from the fork:
- The controls show only in a game. In the menus and during cinematics
they hide and let the fingers through, so HiIAmMoot's menu touch
(upstream #50) and its tap to skip work under them. The game tells the
overlay through a new host import, host_touch_scene.
- They hide while a controller with a stick is connected, such as a
handheld's built-in one, and never show without a touchscreen (a TV).
The new setting input.touch_controls ("auto", "on", "off"; default
"auto") overrides this. Hiding with a controller follows diegotorres00's
upstream #58.
- Swipes that start in Android's edge-gesture zones do not turn the view,
and a press shorter than a frame is held long enough for the game to see
it, as HiIAmMoot suggested in the review of #58.
- The swipe is not the mouse's aiming, so it keeps the controller's aim
assist.
- The phone vibrates from port 0's XInputSetState, so the game's own
vibration setting applies and no game source changes. It vibrates only
while the touch controls show.
- The fork's cheats menu and its built-in cheat buttons are left out.
Co-authored-by: JoshRob297 <99092299+JoshRob297@users.noreply.github.com>
Co-authored-by: theLlamaNet <107216990+theLlamaNet@users.noreply.github.com>
(cherry picked from commit 7bd7481bdede370558a3c93d286e37a9c24237bd)
(cherry picked from commit 5911e2312b6960de58dfa1cad2fefce1a17b97f7)