Commit graph

177 commits

Author SHA1 Message Date
Rémi Verschelde
f706a3bd54
Web: Clarify that OS.get_unique_id is not supported
Remove the base error message in `OS`, we no longer really error out this
way for not implemented methods. Instead, each platform should override them
to provide the context they want.

Fixes #82439.

(cherry picked from commit 0a10f09ce4)
2024-01-18 16:19:43 +01:00
DylanCheetah
bc93cad7f9
Implement UWP version of OS.get_unique_id function. 2024-01-10 13:25:28 +01:00
bruvzg
18ee8da7d6
Add audio/general/text_to_speech project setting to enable/disable TTS. 2023-05-26 20:57:29 +03:00
Yuri Sizov
0f24d6ecf7 Update make_rst.py to match the master version
This does not include master-specific concepts, like
constructors, operators, annotations, and bitfields.
2023-04-10 20:47:01 +02:00
Hugo Locurcio
1a6343729b
Document using String.percent_encode() with OS.shell_open() 2023-03-03 11:17:21 +01:00
Hugo Locurcio
badcfa2523
Expose OS.read_string_from_stdin() to the scripting API
This can be used in scripts to read user input in a blocking manner.

This also removes the unused `block` argument, which is always `true`.
2023-01-16 11:39:53 +01:00
Hugo Locurcio
65465f309c
Add a project setting to make the root viewport transparent
This allows creating a project with a transparent window without having
to write any script.
2022-12-18 00:38:05 +01:00
Hugo Locurcio
06c266f231
Only support XDG directory path configuration on Linux
This also harmonizes the server code to be consistent with Linux desktop
(with warnings printed for relative XDG paths).

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-12-12 11:13:19 +01:00
Hugo Locurcio
76a14cfd02
Expose the "restart on exit" OS functionality
This can be used to restart a project with specific command line arguments
applied. This can work in tandem with `OS.get_cmdline_args()` to restart
with the same command line arguments as used to originally run the project.

Example use cases:

- Restart to apply an user setting change that requires a restart to work.
- Restart with a Godot command line argument to change the video driver,
  audio driver, etc.
2022-09-20 17:27:46 +02:00
Haoyu Qiu
1be078ebcb Fix Time.get_unix_time_from_system() not including msecs 2022-08-08 20:31:51 +08:00
Rémi Verschelde
0bed7ea63f
Merge pull request #61316 from bruvzg/tts_3x
[3.x] Backport text-to-speech support.
2022-08-05 23:45:51 +02:00
Rémi Verschelde
26762a71b6
Merge pull request #58537 from winterpixelgames/feature/virtual-keyboard-types-3.x 2022-08-05 19:37:13 +02:00
Rémi Verschelde
0a8d5d7098 Bump version to 3.6-beta 2022-08-05 18:51:38 +02:00
Brian Semrau
ce24b48e50 Add support for multiple virtual keyboard types 2022-07-07 14:22:28 -04:00
bruvzg
6489fe890e
Backport text-to-speech support. 2022-07-01 11:04:50 +03:00
Rémi Verschelde
e4d6a4d005
Merge pull request #60799 from Calinou/doc-os-cmdline-args-3.x 2022-06-19 14:09:23 +02:00
kobewi
2a7d60111f Improve description of move_to_trash()
(cherry picked from commit 1c90b066dd)
2022-06-13 17:44:27 +02:00
Rémi Verschelde
80b82e4e66 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:56:42 +02:00
Hugo Locurcio
99d9228a2e
Handle CLI arguments without a value in OS.get_cmdline_args() example
Command lines such as `--host --address 127.0.0.1` are now parsed as
`{"host": "", "address": "127.0.0.1"}`.
2022-05-05 19:19:15 +02:00
mdavisprog
53fb0440d3 Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script.

This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.

Documentation is updated to reflect new API function.

(cherry picked from commit f3c1232c59)
2022-05-05 15:02:46 +02:00
Rémi Verschelde
d8e702b010
Merge pull request #60552 from madmiraal/implement-3466-3.x
[3.x] Add a method for obtaining display cutouts on Android
2022-05-02 07:58:05 +02:00
kobewi
b7336524f2 Expose move_to_trash()
(cherry picked from commit b80e52f048)
2022-04-27 12:41:01 +02:00
Marcel Admiraal
ec2270b88f Add a method for obtaining display cutouts on Android 2022-04-26 13:52:33 +02:00
Hugo Locurcio
b087538119
Add an XML schema for documentation
This makes it easier to spot syntax errors when editing the
class reference. The schema is referenced locally so validation
can still work offline.

Each class XML's schema conformance is also checked on GitHub Actions.
2022-03-16 23:01:02 +01:00
Hugo Locurcio
cec7c908ca
Add get_screen_refresh_rate() to OS
This method can be used to get the refresh rate of a given screen.
It is supported on Windows, macOS, Linux, Android and iOS (but not
HTML5).
2022-03-10 22:10:48 +01:00
Hugo Locurcio
7f9e974a8b
Add an OS.get_processor_name() method
This method can be used to get the CPU model name.
It can be used in conjunction with
`VisualServer.get_video_adapter_name()` and
`VisualServer.get_video_adapter_vendor()` for annotating benchmarks
and automatic graphics quality configuration.
2022-02-16 18:39:02 +01:00
Rémi Verschelde
a9b10054b8
Merge pull request #56950 from timothyqiu/has-clipboard-3.x 2022-01-20 12:09:53 +01:00
bruvzg
7eb8339f6c
[Documentation] Add instruction how to execute built-in commands of various shells.
(cherry picked from commit 9faf1e027a)
2022-01-19 16:04:16 +01:00
Haoyu Qiu
76297e744d Add OS.has_clipboard() to check clipboard content 2022-01-19 20:19:06 +08:00
Rémi Verschelde
879244c54e
Merge pull request #56015 from bruvzg/phy_code_conv 2022-01-16 11:36:26 +01:00
Rémi Verschelde
8a192cd0ab
Merge pull request #55987 from bruvzg/wt🤎3 2022-01-10 16:43:56 +01:00
skyace65
ea637f641e
State that get static memory usage only works in debug
(cherry picked from commit 32b4edbe4e)
2022-01-06 00:21:36 +01:00
bruvzg
59085d5051
[Windows] Improve console handling and execute.
Always build with the GUI subsystem.
Redirect stdout and stderr output to the parent process console.
Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with non-blocking calls).
Add `open_console` argument to the `execute` to open a new console window (for both blocking and non-blocking calls).
Remove `interface/editor/hide_console_window` editor setting.
Remove `Toggle System Console` menu option.
Remove `set_console_visible` and `is_console_visible` functions.
2021-12-18 10:13:27 +02:00
bruvzg
b4ec1c5817
Backport: Allow for mapping scancodes to current layout
Co-authored-by: Frixuu <kontakt@lukasz.xyz>
2021-12-17 13:04:47 +02:00
Haoyu Qiu
b1153f8829 Fix broken links in Class Reference 2021-12-10 21:07:21 +08:00
Hugo Locurcio
58296c7e21
Add an OS.crash() method for testing system crash handler
This makes it possible to test the system's crash handler without
having to modify engine code or exploit an engine bug.
2021-12-04 01:40:56 +01:00
Aaron Franke
035a84fe92
[3.x] Add a Time singleton 2021-11-29 11:00:06 -06:00
Brian Semrau
04846156c3
Expose Thread::get_main_id in core bindings
(cherry picked from commit c558263d84)
2021-11-20 11:48:09 +01:00
Rémi Verschelde
3ac2999f22
Replace Godot docs URL with $DOCS_URL in XML class reference 2021-11-15 17:22:47 +01:00
Max Hilbrunner
73cb77c62c
Merge pull request #54623 from gongpha/3.x-typo1
Fix little typos in `OS` 3.x doc
2021-11-06 17:35:45 +01:00
Rémi Verschelde
14c366ddd7
Bump version to 3.5-beta 2021-11-05 16:10:17 +01:00
Kongfa Waroros
0d852bf5a6 Fix little typos in 3.x doc 2021-11-05 16:23:37 +07:00
Rémi Verschelde
b4fc24b73f
Implement OS::get_locale_language() helper method
This method extracts the 2 or 3-letter language code from `OS::get_locale()`,
making it easier for users to identify the "main" language code for users
that might have different OS locales due to different OS or region, but
should be matched to the same translation (e.g. "generic" Spanish).

Fixes #40703.

(cherry picked from commit def99c7baf)
2021-09-21 20:33:12 +02:00
bruvzg
131f913747
Improve OS::get_locale() on macOS and Windows, replace "-" with "_" and use system macros instead of bitwise AND. Add locale format info to the documentation.
(cherry picked from commit f797e1c078)
2021-09-21 20:33:11 +02:00
Hugo Locurcio
6702e37a88
Document how to delay code execution in a non-blocking manner
(cherry picked from commit 1529bf7c10)
2021-09-21 20:33:11 +02:00
PouleyKetchoupp
52fdb4ece9 Window transparency support on Android
Implements per-pixel transparency feature on Android.
Allows plugins to do specific rendering and render godot UI on top
(useful for camera support with drawing on top).
2021-09-15 10:41:08 -07:00
Hugo Locurcio
59f24d8867
Define a default minimum window size to workaround rendering issues
The minimum window size can still be set to `Vector2(0, 0)` in a script
if needed.
2021-08-23 04:10:24 +02:00
ne0fhyk
c88d1608ab Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-13 11:04:17 -07:00
Rémi Verschelde
f0b37b1519
doc: Point URLs to 3.4 version of the online docs 2021-08-12 17:08:10 +02:00
Rémi Verschelde
f5836b40d4
doc: Use self-closing tags for return and argument
For the time being we don't support writing a description for those, preferring
having all details in the method's description.

Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.

(cherry picked from commit 7adf4cc9b5)
2021-08-03 10:20:19 +02:00