Commit graph

132 commits

Author SHA1 Message Date
Hugo Locurcio
aa0976f47c
Expose OS data directory getter methods
This can be used by editor plugins and non-game applications to
store data in the correct directories according to the
XDG Base Directory specification.
2021-06-19 08:56:20 +02:00
Michael Alexsander Silva Dias
0ff4095b36 Better format arguments in variant parser 2021-06-18 00:06:40 -03:00
Aaron Franke
f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
Marcel Admiraal
b3a962945e Add OS.get_external_data_dir() to get Android external directory 2021-06-10 16:48:17 +01:00
Rémi Verschelde
62efa30ed2
OS: Better validation of invalid input for get_unix_time_from_datetime
Default missing keys to Unix time 0 (1970-01-01 at 00:00:00 UTC).
Abort if year <= 0, this is not supported by the current algorithm.

Prevents an infinite loop further down.

Fixes #49022.
2021-05-24 13:37:36 +02:00
Rémi Verschelde
4219a4cb6f
Fix typos with codespell
Using codespell 2.0.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
GIRD
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2021-05-20 12:38:56 +02:00
Hugo Locurcio
7350f90c57
Document caveats of OS.get_unique_id() 2021-05-09 13:23:53 +02:00
Hugo Locurcio
ce4aa07276
Implement the %command% placeholder in the Main Run Args setting
This can be used to tell Godot to run an executable that will run Godot
rather than running Godot directly. This is useful to make Godot start
on the dedicated GPU when using a NVIDIA Optimus setup on Linux:
`prime-run %command%`

The `editor/run/main_run_args` setting declaration was moved to make it
visible in the ProjectSettings documentation.
2021-05-07 00:05:02 +02:00
kobewi
6e4a8b7f37 Clarify that get_unix_time() returns seconds 2021-03-24 13:21:32 +01:00
Paul Joannon
8455e901f3
class reference proofreading 2021-03-19 13:21:20 +01:00
Aitor Cereceto
1e820b3d9d [46188] fix: get unix from datetime when empty dict 2021-03-12 09:27:21 +01:00
Emmanuel Leblond
60d2c1fd47
Remove GDScript bindings for OS.get/set_exit_code, SceneTree.quit(<exit_code>) should be used instead 2021-02-25 18:34:50 +01:00
Hugo Locurcio
355803db1b
Improve the OS.get_environment()/OS.set_environment() documentation 2021-02-25 15:38:51 +01:00
Bastiaan Olij
4c8f5b998f Expose set_environment to GDScript 2021-02-25 23:36:14 +11:00
Hugo Locurcio
76f1f9b3c5
Don't allow negative values for OS.delay_usec()/OS.delay_msec()
This closes #46190.
2021-02-18 23:01:45 +01:00
bruvzg
3e0262509f
Move tablet driver API from OS to DisplayServer. 2021-02-18 17:12:24 +02:00
Rémi Verschelde
fb01d057af
doc: Sync classref with current source 2021-01-28 11:26:37 +01:00
Rémi Verschelde
d6765c8d8b
Merge pull request #44732 from Calinou/os-add-get-thread-caller-id
Add an `OS.get_thread_caller_id()` method
2021-01-26 15:54:25 +01:00
Marcel Admiraal
2a74b388d0 Split OS::execute into two methods
1. execute(): Executes a command and returns the results.
2. create_process(): Creates a new process and returns the new process' id.
2021-01-09 10:03:23 +00:00
Hugo Locurcio
35b046ddf7
Add an OS.get_thread_caller_id() method
This can be used to print thread IDs in logs. This can make it easier
to debug multi-threaded applications.

Co-authored-by: Khaos <khaos@khaos-coders.org>
2020-12-27 16:54:18 +01:00
Fabio Alessandrelli
49741d9464 Add important note about OS.get_unixtime.
Should NEVER be used for precise time computations since its return
values are not guaranteed to be monotonic.
2020-12-13 13:56:45 +01:00
Rémi Verschelde
37d0d757d6
Merge pull request #40708 from bruvzg/improve_os_locale
Improve `OS::get_locale()` and documentation.
2020-12-10 11:49:00 +01:00
HaSa1002
a3df26e554 Docs: Port Code Examples to C# (M, N, O, P, R)
Includes:
 * MarginContainer
 * NavigationPolygon
 * Node
 * NodePath
 * OS
 * PackedByteArray
 * PackedScene
 * PacketPeerUDP
 * PCKPacker
 * Performance
 * PhysicsShapeQueryParameters2D
 * PhysicsShapeQueryParameters3D
 * PrimitiveMesh
 * ProjectSettings

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2020-11-09 10:05:53 +01:00
Aaron Franke
439be614f4
Link to demos from within the class reference 2020-10-01 23:57:21 -04:00
Rémi Verschelde
819c3524a5
OS: Remove unused get_splash_tick_msec
It was added in 3e20391bf6 but it doesn't seem
particularly useful, and it was only implemented for the custom splash branch
and not the default one, so it could return an uninitialized int.
2020-09-24 15:40:30 +02:00
bruvzg
f797e1c078
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. 2020-08-11 13:19:19 +03:00
Rémi Verschelde
932b75e247 doc: Sync classref with current source 2020-07-28 01:08:44 +02:00
Rémi Verschelde
a5fb445121
Merge pull request #40450 from asmaloney/spelling
Fix spelling & grammar in comments, docs, and messages
2020-07-21 22:14:04 +02:00
Andy Maloney
4dda62f591 Fix spelling & grammar in comments, docs, and messages 2020-07-21 15:17:23 -04:00
Andrii Doroshenko (Xrayez)
df80e259cd Document the process of parsing command-line arguments
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2020-07-20 12:09:46 +03:00
Rémi Verschelde
efcc508ee5 Move Haiku platform port to external repository
The Haiku port now resides at:
https://github.com/godotengine/godot-haiku-platform

While we're happy to support as many Free and Open Source platforms as we can,
we need to put the main focus on the platforms that we can reasonably maintain,
and for Haiku we have been lacking maintainers ever since the port was first
merged in 2015.

The Haiku code has not been compiling and much less working at least since the
release of Godot 3.0, and while some attempts have been made at fixing things,
it's still not functional today in the `3.2` branch (and much less in `master`,
understandably).

Having it in an external repository should hopefully enable Haiku contributors
to fix issues in their own time, and possibly tag versions compatible with
past Godot releases once they are ready.
2020-06-20 17:59:41 +02:00
Rémi Verschelde
ba0db95909 DocData: Skip language-specific ClassDoc without methods/constants
Removes the useless `@C#`, `@NativeScript` and `@VisualScript` entries.
2020-06-17 15:09:07 +02:00
Emmanuel Leblond
c6de3872f9
Remove OS.get_system_time_secs/get_system_time_msecs and change OS.get_unix_time return type to double 2020-05-31 14:19:31 +02:00
Rémi Verschelde
0b8cb945cf doc: Sync classref with current source 2020-05-20 15:29:37 +02:00
bruvzg
d0b5174b6a
[Windows] Add tablet driver selection. 2020-05-20 09:37:32 +03:00
Hugo Locurcio
d46e411b44
Warn when trying to open res:// or user:// with OS.shell_open()
`OS.shell_open()` will pass on the path directly to the OS' shell
handler (which can handle file paths or URLs). It can't handle
Godot-specific paths, so these need to be converted with
`ProjectSettings.globalize_path()` first.
2020-04-28 19:37:09 +02:00
Rémi Verschelde
e5033d3952 doc: Sync classref with DisplayServer/Window changes 2020-03-31 11:56:58 +02:00
Rémi Verschelde
471271b727 doc: Sync classref with current source 2020-03-09 10:13:45 +01:00
bruvzg
1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02:00
Rémi Verschelde
213a85521d doc: Sync classref with current source
Handle removal of Pool*Array types and other recent changes.
2020-02-18 14:02:02 +01:00
Rémi Verschelde
3dea5fd631 Remove incomplete battery status/power API
It was initially implemented in #5871 for Godot 3.0, but never really
completed or thoroughly tested for most platforms. It then stayed in
limbo and nobody seems really keen to finish it, so it's better to
remove it in 4.0, and re-add eventually (possibly with a different API)
if there's demand and an implementation confirmed working on all
platforms.

Closes #8770.
2020-02-14 13:43:32 +01:00
Rémi Verschelde
386968ea97 Remove obsolete GLES3 backend
Due to the port to Vulkan and complete redesign of the rendering backend,
the `drivers/gles3` code is no longer usable in this state and is not
planned to be ported to the new architecture.

The GLES2 backend is kept (while still disabled and non-working) as it
will eventually be ported to serve as the low-end renderer for Godot 4.0.

Some GLES3 features might be selectively ported to the updated GLES2
backend if there's a need for them, and extensions we can use for that.

So long, OpenGL driver bugs!
2020-02-13 10:36:44 +01:00
muiroc
e51c6a0d28 Allow per pixel transparency in javascript platform 2020-02-10 14:27:30 +01:00
clayjohn
57e27683ba Update docs to version 4.0 2020-01-31 17:15:41 -08:00
Rémi Verschelde
2d20fc39aa doc: Drop unused 'category' property from header
We already removed it from the online docs with #35132.

Currently it can only be "Built-In Types" (Variant types) or "Core"
(everything else), which is of limited use.

We might also want to consider dropping it from `ClassDB` altogether
in Godot 4.0.
2020-01-26 16:02:39 +01:00
Hugo Locurcio
7a0c37c3f5
Document how to get a human-readable string from an InputEventKey 2020-01-25 20:13:18 +01:00
Hugo Locurcio
90a1f8d8a7
Make OS.execute() blocking by default if not specified
This makes `OS.execute()` calls quicker to set up when calling programs
in a blocking fashion.
2020-01-23 01:26:32 +01:00
Rémi Verschelde
ab97f78fa5 Revert "Enable Vsync via Compositor by default"
This reverts commit 9600fd5dde.

Add comment warning about possible implications of using this option.

Fixes #35038.
2020-01-13 09:33:27 +01:00
Hugo Locurcio
74ae1ca616
Improve the OS.is_debug_build() documentation 2020-01-10 15:26:47 +01:00
Hugo Locurcio
9600fd5dde
Enable Vsync via Compositor by default
This feature was added in #33414 but it was disabled by default.
Now that it got some testing, it's probably safe to enable it
by default.
2020-01-09 22:22:11 +01:00