Commit Graph

366 Commits

Author SHA1 Message Date
rubenwardy 3017b0213b
Allow quoting hypertext attribute values (#14550) 2024-05-05 14:27:17 +02:00
grorp d7f9da49eb
Fix shootline not being updated if press and release happen in the same step (#14606) 2024-05-05 13:28:50 +02:00
SmallJoker f0bb5313d3 Chat console: Prevent input loss on double open 2024-05-03 16:29:33 +02:00
grorp 73dbd2f0ab
Smooth scrolling (#14562) 2024-04-28 00:14:31 +02:00
SmallJoker c8a41409d9
HUD: Text element color support (#14558) 2024-04-20 20:36:44 +02:00
sfan5 d8190e1c5f Some globals (un-)init fixes 2024-04-20 13:03:42 +02:00
grorp f2b5c35fa2
TouchScreenGUI dehardcoding refactor (#14472) 2024-04-17 15:59:52 +02:00
rubenwardy b2057a5da7
Hypertext: Fix missing space after single letter word (#14551)
Fixes #11727
2024-04-16 08:48:16 +01:00
Gregor Parzefall 07fdf7158d Migrate the Android port to SDL2 2024-04-08 20:15:37 +02:00
cx384 3a35db6e67 Turn dos files into unix files 2024-03-31 21:02:47 +02:00
Gregor Parzefall 8935f2af3c Make long tap delay customizable and change default to 400ms 2024-03-30 11:40:50 +01:00
Gregor Parzefall 517f1602aa Re-add "long tap to punch" as a client-side setting 2024-03-30 11:40:50 +01:00
sfan5 6c6e48f006
Move values the mainmenu caches to dedicated files (#14433) 2024-03-30 11:06:28 +01:00
rubenwardy 24cc33e704
Add button_url[] and hypertext element to allow mods to open web pages (#13825)
Fixes #12500
2024-03-24 17:19:23 +00:00
Desour 751ede516b ProfilerGraph: Increase buffer size for min/max formatting
Fixes values being cut off, e.g. "1.0000e+06" to "1.0000e+0".
2024-03-20 15:28:37 +01:00
grorp f07e1026ac
Allow sync HTTP fetches to be interrupted to fix hanging (#14412)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2024-03-12 20:09:43 +01:00
cx384 aaf77025b6 Split up tile.cpp/h 2024-03-03 15:52:05 +01:00
Gregor Parzefall aac616fcc5 Avoid visible camera jumps because of touchscreen_threshold 2024-03-01 17:11:46 +01:00
Gregor Parzefall fa0745f7da Adjust touchscreen_sensitivity to display density 2024-03-01 17:11:46 +01:00
Gregor Parzefall 00a3e6bbd7 Touchscreen: Allow camera movement while digging without touch_use_crosshair 2024-03-01 17:11:46 +01:00
sfan5 bb7f57b095 VBO-related optimizations and improvements (#14395) 2024-02-29 17:20:57 +01:00
sfan5 13a0e5fb4a Share FpsControl code between game and menu 2024-02-29 17:20:50 +01:00
rubenwardy b4be483d3e
Add support for translating content titles and descriptions (#12208) 2024-02-24 19:13:07 +00:00
grorp 57de599a29
Restore pre-5.9.0-dev behavior of touch_use_crosshair=false shootline (#14389)
* Fix incorrect shootline after releasing pointer if touch_use_crosshair=false

This happened because Android reuses pointer IDs.
Also includes a refactor to merge "m_known_ids" and "m_pointer_pos".

* Restore pre-5.9.0-dev behavior of shootline when !m_has_move_id
2024-02-24 13:12:53 +01:00
David Heidelberg 34286d77c7
Allow toggling touchscreen mode at runtime (#14075)
Signed-off-by: David Heidelberg <david@ixit.cz>
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2024-02-22 15:44:49 +00:00
sfan5 6ca214fefc
Introduce `std::string_view` into wider use (#14368) 2024-02-17 15:35:33 +01:00
David Heidelberg eb52a149a0
Enable IPO/LTO by default except for debug builds (#14198)
Test case:

```
$ cmake . -DRUN_IN_PLACE=TRUE -DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=TRUE -DENABLE_TOUCH=FALSE

         minetest minetestserver
W/o LTO:      13M           7.3M
W/  LTO:      11M           5.9M
difference:   15%            19%
```

Also fixes various compiler warnings resulting from compilation using LTO.

---------

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-02-09 00:01:12 +01:00
grorp fbec168e91
Only pause rendering if the Android activity is stopped (#14211) 2024-01-27 14:37:00 +01:00
grorp 2b99dabdac
Touchscreen: Abort ongoing short taps if touch interaction mode changes (#14305) 2024-01-26 23:19:06 +01:00
grorp 404a063fdf
Touchscreen: Allow mods to swap the meaning of short and long taps (punch with single tap) (#14087)
This works through a new field "touch_interaction" in item definitions.
The two most important use cases are:
 - Punching players/entities with short tap instead of long tap (enabled by default)
 - Making items usable that require holding the place button (e.g. bows and shields in MC-like games)
2024-01-21 17:44:08 +01:00
sfan5 699d1bf27c Use newer IrrlichtMt
now with SDL2
2024-01-19 11:54:40 +01:00
sfan5 1ba26d67bd Remove excessive includes from porting.h 2024-01-14 13:17:53 +01:00
Muhammad Rifqi Priyo Susanto 171f911237
Android: Add selection dialog (drop down/combo box) (#13814)
- The handling of IGUIComboBox uses the new setAndSendSelected() method.
- getDialogState() is now getInputDialogState() and returns the state of the input dialog.
- getLastDialogType() is added and returns current/last shown dialog's type.
- getInputDialogState() now returns an enum instead of int.
- getAndroidUIInput() now returns void instead of bool.
- New data types (enum) are added:
  (1) GameActivity.DialogType (Java) and porting::AndroidDialogType (C++)
  (2) GameActivity.DialogState (Java) and porting::AndroidDialogState (C++)
- When showing a text input dialog, there is no custom accept button text any more.
- showDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- showInputDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- getDialogValue()/getInputDialogValue() is now getDialogMessage()/getInputDialogMessage().


Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2024-01-07 19:00:04 +07:00
grorp 05a53cd330
Touchscreen: Recognize double-taps as double-clicks (#14187) 2024-01-05 00:39:40 +01:00
grorp 995c192874
Don't apply gui_scaling & DPI twice to table[] / textlist[] scrollbar (#14206) 2024-01-03 21:58:58 +01:00
grorp 32e492837c
Support both mouse and touch input in GUIs in a single binary (#14146) 2023-12-27 22:37:36 +01:00
Gregor Parzefall 04dc4a10f0 Fix TouchScreenGUI ignoring server-sent pitch changes 2023-12-20 21:24:10 +01:00
Gregor Parzefall 3b346fd3c9 Fix touch input on Linux
The code relied on touch IDs being consecutive. This is true on Android, but not on Linux.
Therefore, touch input on Linux was broken since 53886dcdb5.
2023-12-20 21:22:15 +01:00
grorp 00d9d96e48
Android: Pause rendering while the app is paused (#14058) 2023-12-19 20:18:28 +01:00
Gary Miguel da832a295e
Delete clang-format files and comments (#14079) 2023-12-15 10:23:44 +01:00
Muhammad Rifqi Priyo Susanto 55fafb7d25
Add sound volume when unfocused setting (#14083)
This adds a new setting to set sound volume multiplier when Minetest window is unfocused/inactive (sound_volume_unfocused, located in Settings > Graphics and Audio > Audio > Volume when unfocused).

If the window is not focused, the sound volume will be multiplied by sound_volume_unfocused setting. The sound volume will be set back to sound_volume again when the window is focused.
2023-12-10 19:11:39 +01:00
SmallJoker 321bcf5c44
GUIFormspecMenu: Fix race condition between quit event and cleanup in Game (#14010)
To not instantly free GUIFormSpec upon close/quit, Game periodically
cleans up the remaining instance on the next frame.

When a new formspec is received and processed after closing the previous formspec
but before the cleanup in Game, the formspec would be closed regardless.
This now re-creates the formspec when the old one is already pending for removal.
2023-12-10 19:09:51 +01:00
Muhammad Rifqi Priyo Susanto 047520d91e
Inventory: Add remaining items into the source slot directly (#14021)
Remaining items are added into the source slot directly when left-dragging over the source slot.
2023-12-03 15:00:07 +07:00
Muhammad Rifqi Priyo Susanto 53886dcdb5
Formspec: Pass the second-touch event as is (#13872)
The second-touch event is passed to the GUIFormSpecMenu::OnEvent() function as a touch event.
There are two types of event for inventory formspec: (1) mouse event and (2) touch event.
The touch event is just a modifier of the mouse event.


Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2023-11-28 07:00:07 +07:00
grorp 771da80bbb
Make it possible again to see item tooltips on Android (#14029)
This change is a quick fix so that item tooltips show again on Android.
2023-11-25 17:07:07 +01:00
grorp 4255ac3022
Mainmenu: Avoid the header being displayed behind the formspec (#13924)
This change keeps the current header placement code, but adds additional code to make sure the header doesn't end up behind the formspec.
2023-11-25 17:04:33 +01:00
Desour 1bc74b0ba1 Fix undefined inf to s32 cast in GUIScrollBar::setPos 2023-11-19 20:45:18 +01:00
Muhammad Rifqi Priyo Susanto aa912e90a7
Make text containers wider in the Volume Change dialog (#13995)
These containers are widened to account for translations.
2023-11-15 07:00:03 +07:00
Gregor Parzefall 96197025b9
Fix hypertext[] sometimes calculating incorrect scrollbar height (#13943) 2023-10-29 17:54:31 +01:00
SmallJoker 906417cc0d
GUI: Autofocus newly opened GUIModalMenu instances (#13911)
This in particular fixes incorrect event propagation to menus that
are no longer shown, such as the key change menu when opened within
the settings tab.
2023-10-22 15:31:42 +02:00