Commit Graph

31 Commits

Author SHA1 Message Date
sfan5 1ba26d67bd Remove excessive includes from porting.h 2024-01-14 13:17:53 +01:00
Gregor Parzefall 04dc4a10f0 Fix TouchScreenGUI ignoring server-sent pitch changes 2023-12-20 21:24:10 +01:00
Gregor Parzefall 7b56daa236
Small setting-related fixes (#13755) 2023-08-27 20:18:41 +02:00
Desour f98726c516 Revert "Use our GUIButton in touchscreengui"
This reverts commit f7f3aaf43c.
Fixes #13743.
2023-08-24 22:14:44 +02:00
Gregor Parzefall 92b6ff4721
TouchScreenGUI: Fix only 9 hotbar slots being usable (#13698)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-08-24 17:45:51 +02:00
Desour f7f3aaf43c Use our GUIButton in touchscreengui 2023-08-14 18:13:47 +02:00
Muhammad Rifqi Priyo Susanto 2061984313 Simplifies code by using Irrlicht's operator overloads
New variables are added to replace in-place calculations.
2023-07-14 21:00:29 +07:00
Muhammad Rifqi Priyo Susanto 3a47559e86 Fix some memory leaks and code style issues
Maximum line length is 95 characters.
Some members' name are changed.
Struct initialisations use brace syntax; eliminating the usage of the memset function.
Iterations use for-each-loop instead of while-loop+iterator.
char * -> std::string
button_info * -> std::shared_ptr<button_info>
2023-07-14 21:00:29 +07:00
Gregor Parzefall 7e51e2dea6 Fix compiler error on MSVC with ENABLE_TOUCH=TRUE 2023-06-24 20:37:59 +02:00
Gregor Parzefall 03ffc2618c
TouchScreenGUI: Add an exit / "ESC" button to the rare controls bar (#13574) 2023-06-22 17:50:36 +02:00
Muhammad Rifqi Priyo Susanto a4e69d6843
TouchScreenGUI: Read coordinates directly for virtual joystick (#13567)
The movement's direction and speed are calculated directly from the button's relative screen coordinate. The previous method was to trigger the movement using a keyboard event.
The only virtual joystick status left is Aux1 button.

---------

Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2023-06-16 22:40:16 +07:00
Gregor Parzefall fc3d6c1dd9
Place nodes with single tap on Android (+ bugfix) (#13187)
Don't place nodes when closing button bars.
Update docs (also in-game).
Rename "Default controls" -> "Controls" in Android pause menu since players can't change them (normally), so calling them "default" doesn't make sense.
2023-05-29 12:30:30 +07:00
Gregor Parzefall 15fb4cab15
Fix Android segfault when game exits before TouchScreenGUI is initalized 2023-05-11 22:51:16 +02:00
Muhammad Rifqi Priyo Susanto 40a45b8c99
Virtual joystick: Use s32 when using m_screensize as a subtrahend (#12814)
If still uses u32, m_screensize will yield a big value (underflow) when used as a subtrahend.
ETIE_MOVED is allowed to be run if joystick's ID is available and virtual joystick is fixed.
Add .0f for some float values.
2022-11-26 09:16:14 -05:00
Abdou-31 d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
Muhammad Rifqi Priyo Susanto 3978b9b8ed
Add crosshair support for Android (#7865)
If enabled, a crosshair will be shown to select object.
This will give Android players a way to play like they play on desktop.
On third-person back camera mode, player is forced to use crosshair.
On third-person front camera mode, player is unable to select anything.

Co-authored-by: ROllerozxa <temporaryemail4meh+github@gmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2022-09-29 20:30:33 +02:00
SmallJoker 051181fa6e
Enforce limits of settings that could cause buggy behaviour (#12450)
Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
2022-07-09 22:32:08 +02:00
TheBrokenRail 3dcf9e963e
Touch UI support for desktop builds (#10729) 2021-09-26 18:04:09 +02:00
hecks 850293bae6
Remove unused header includes 2021-07-21 22:07:13 +02:00
Wuzzy 827224635b
Use "Aux1" key name consistently everywhere 2021-02-24 11:45:30 +01:00
sfan5 74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
rubenwardy 8ebeed53ad
Android: Fix only right strafe working (#10046) 2020-06-18 01:43:43 +01:00
MoNTE48 b9f618746c TouchScreenGUI: fix some bugs, cleanup 2020-06-09 19:35:25 +02:00
Maksim 756dc89ede Fix real keyboard movements on touchscreen devices 2020-06-09 19:35:25 +02:00
Juozas 94f2d99142 Fix Android build errors (caused by 5f1cd55)
After commit 5f1cd55 touchscreengui.* files were pointing to old file locations
2018-12-03 19:31:20 +01:00
Paramat e369eb1a9b
Android buttons: Inset 'rare controls', inset and resize 'gear icon' (#7792)
Previously these were both inconsistently close to the screen edge.
'gear icon' has been enlarged to match the width of 'zoom' and 'aux'
buttons.
2018-10-19 04:52:47 +01:00
Muhammad Rifqi Priyo Susanto 7ebc229b0d Android: Add 'aux' button (#7477)
Add 'aux' button.
Use joystick to trigger 'aux' button when forward and out of main circle, by enabling
'virtual_joystick_triggers_aux' setting.
2018-07-10 23:33:40 +01:00
Muhammad Rifqi Priyo Susanto ad3d1d20d1 Android: Resize jump and sneak buttons' touch target (#7498) 2018-06-30 22:33:14 +01:00
Muhammad Rifqi Priyo Susanto b1e58c9c35 Android: Modify touch screen GUI's buttons (#7240)
* Android: Add zoom, minimap, and toggle chat button
Zoom button is put above jump button.
Minimap and toggle chat button are put in settings bar.
* Jump button is rotated down button
* Move three buttons on the right screen higher
2018-04-18 20:55:42 +02:00
Muhammad Rifqi Priyo Susanto 326eeca306 Android: Replace movement buttons with joystick (#7126)
* Android: Replace movement buttons with joystick

Replace movement control buttons (arrows at bottom left screen) with virtual joystick.
Joystick has 8 directions (same as keyboard). Basically, just map it to keyboard input.
Joystick applies only on left 1/3 of screen.
Joystick's position can be fixed by enabling fixed_virtual_joystick setting.
Three new images:
(1) placeholder joystick,
(2) joystick container (background), and
(3) joystick cursor.
Remove unused images: movement control buttons (*_arrow.png).
New data type: touch_gui_joystick_move_id

Joystick's fixed position is spaced one button size from bottom and from left of screen.
Remove unused variable: m_joystick_downlocation
2018-04-10 22:55:17 +02:00
Vitaliy 20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00