Commit graph

286 commits

Author SHA1 Message Date
Yuri Sizov
379f28d7dc
Merge pull request #77226 from aaronfranke/clamp
Document that clamp works with any type that supports greater/less than
2023-05-30 16:12:01 +02:00
Ninni Pipping
17fb77223c Minor grammar fixes to documentation 2023-05-28 18:27:56 +02:00
Aaron Franke
d209857ea7
Document that clamp works with any type that supports greater/less than 2023-05-18 20:18:08 -05:00
voidshine
06d02928b7 Document MIDI zero velocity quirk 2023-05-17 12:19:25 -07:00
kleonc
fc92ee6bf4 Fix property usage docs referring to removed network flag 2023-05-14 12:18:26 +02:00
Raul Santos
a34207b812
Reorder PropertyHint enum to avoid breaking compat
Also syncs the Core enum with the C# enum for the source generators.
2023-05-12 01:48:07 +02:00
Rémi Verschelde
fd4a06c515
Merge pull request #76906 from lawnjelly/safe_acos4_2
Make acos and asin safe
2023-05-11 13:33:37 +02:00
lawnjelly
50c5ed4876 Make acos and asin safe
A common bug with using acos and asin is that input outside -1 to 1 range will result in Nan output. This can occur due to floating point error in the input.

The standard solution is to provide safe_acos function with clamped input. For Godot it may make more sense to make the standard functions safe.
2023-05-11 08:34:34 +01:00
Rémi Verschelde
74e5ad5c60
Merge pull request #76165 from and-rad/safe-credentials
Store sensitive export options in dedicated credentials file
2023-05-10 12:47:07 +02:00
Andreas Raddau
fab160ce70 Store sensitive export options in dedicated credentials file 2023-05-10 11:40:17 +02:00
smix8
a6ac305f96 Rework Navigation Avoidance
Rework Navigation Avoidance.
2023-05-10 05:01:58 +02:00
Hugo Locurcio
ec277d804e
Improve print_rich() documentation
- List all supported colors.
- Mention URL tag support limitations.
- Fix and tweak code example to do what it says.
- Remove outdated notice about lack of Windows support (but mention
  that only Windows 10 and later support ANSI code conversion).
2023-04-16 16:34:28 +02:00
Hugo Locurcio
3c4f0ca9c6
Document how to use logarithm of base 10 with log() 2023-03-26 22:23:13 +02:00
Dipal Zambare
8901986d56 Fix typo in the type-safe examples
Fix type in the type-safe examples of snapped, lerp and sign function.
2023-03-19 18:23:13 +01:00
Haoyu Qiu
1e0b8d6240 Hide internal settings from the classref
Default actions are no longer internal since we want to document them.
They are still hidden from the Project Setting dialog because we hid the
whole `input/` group manually.
2023-03-02 17:52:37 +08:00
Rémi Verschelde
1c1524a651
Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
George Marques
ed81b165eb
Make max() and min() global functions only accept numbers
The behavior for those are not well defined for non-numeric arguments.
To avoid confusion the other types are forbidden.
2023-02-24 14:06:11 -03:00
Rémi Verschelde
b2584629c8
Merge pull request #73195 from timothyqiu/weblate-comments
Improvements and fixes based on Weblate comments
2023-02-17 09:55:39 +01:00
Micky
436bbfebe2 Tweak @GlobalScope & GDScript's documentation 2023-02-14 13:26:18 +01:00
Hugo Locurcio
42b7739321
Document unsupported features in Mobile and Compatibility rendering methods 2023-02-13 22:17:02 +01:00
Haoyu Qiu
84aee17901 Improvements and fixes based on Weblate comments
* Description of `ui_text_submit` action should be "Submit Text" instead of "Text Submitted".
* Spell out "Animation" instead of using "Anim.".
* Treat "Max" as regular word instead of writing "Max.".
* Use generic "Set %s" for action name instead of a dedicated "Set target_position".
* Add translator comment for:
    * "Inclusive" and "Self" in the profiler.
    * Places where it needs the context about being an editor progress label.
    * "Duplicated Animation Name" since it's refering to the new name of a duplicated animation.
    * Disambiguation of "View Plane Transform", "Paste Selects" and "Display Normal".
* Fix wrong undo action name for renaming an input action.
* Fix missing end quote in a shader error message.
* In class reference:
    * Fix duplicated "if" in the description of `signf()`.
    * Fix mismatched example output in `String.operator %()`.
    * Fix typo in the description of `Decal.texture_emission`.
    * Unify description of `String.match()` and `StringName.match()`.
2023-02-13 15:22:18 +08:00
Danil Alexeev
c8e3d8b5d5
GDScript: Improve validation and documentation of @export_flags 2023-02-07 19:32:08 +03:00
Rémi Verschelde
ab2f8ab6ce
Merge pull request #72371 from dalexeev/remove-gds-str-duplicate
Remove `@GDScript.str` (duplicate of `@GlobalScope.str`)
2023-02-01 07:25:02 +01:00
Danil Alexeev
be4f36b87e
Remove @GDScript.str (duplicate of @GlobalScope.str) 2023-01-30 14:29:07 +03:00
Danil Alexeev
d4b78c352f
GDScript: Fix @export_enum works only with int 2023-01-30 12:30:37 +03:00
Rémi Verschelde
239145d9cb
Merge pull request #71946 from raulsntos/dotnet/gd
C#: Sync GD with Core
2023-01-26 23:43:36 +01:00
Rémi Verschelde
42424d3b8e
Merge pull request #71758 from adamscott/is_equal_ref
Add `@GlobalScope` `is_same(a, b)` and `Variant::identity_compare()`
2023-01-26 01:07:24 +01:00
Adam Scott
37248d7c87 Add @GlobalScope is_same(a, b) and Variant::identity_compare() 2023-01-25 10:46:21 -05:00
Aaron Franke
2a65f6812b
Add PROPERTY_USAGE_NEVER_DUPLICATE flag and use for script
Co-authored-by: Yakov Borevich <j.borevich@gmail.com>
2023-01-24 16:37:50 -06:00
Aaron Franke
2bc0bcbd26
PropertyUsage: Rename "DO_NOT_SHARE_ON_DUPLICATE" to "ALWAYS_DUPLICATE" 2023-01-24 16:05:07 -06:00
Raul Santos
47ca2f2e09
C#: Sync GD with Core
- Add overloads to print methods that take a single `string`.
- Use `StringBuilder` to append print parameters.
- Remove `PrintStack` method.
- Add `ErrorString`.
- Remove `Str` method.
- Add exception to `Range` when step is 0.
- Add `VarToBytesWithObjects` and `BytesToVarWithObjects`.
- Remove optional boolean parameter from `VarToBytes` and `BytesToVar`.
- Move `InstanceFromId` to `Godot.Object`.
- Add `Godot.Object.IsInstanceIdValid`.
- Update documentation.
2023-01-24 19:18:38 +01:00
bruvzg
daad4aed62
Cleanup and unify keyboard input.
- Unify keycode values (secondary label printed on a key), remove unused hardcoded Latin-1 codes.
- Unify IME behaviour, add inline composition string display on Windows and X11.
- Add key_label (localized label printed on a key) value to the key events, and allow mapping actions to the unshifted Unicode events.
- Add support for physical keyboard (Bluetooth or Sidecar) handling on iOS.
- Add support for media key handling on macOS.

Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-01-23 15:08:12 +02:00
Yuri Sizov
4c5e09f96a
Merge pull request #71339 from raulsntos/dotnet/is_finite
Add `IsFinite` to C# Variants
2023-01-13 23:34:51 +03:00
Raul Santos
14c16746f3
Add IsZeroApprox to C# vectors 2023-01-13 18:53:39 +01:00
Raul Santos
f852004cf5
Add IsFinite to C# Variants 2023-01-13 17:57:52 +01:00
Juan Linietsky
0e0a6bb39b
Removed unused property hints and Object::get_translatable_strings()
* Remove unused `EditorPropertyMember` and related hints, previouly used by
  VisualScript. Such logic should be implemented in the VS module itself.
* As the above broke compatibility with the VS module, clean up the other
  hacks that were still in core in support of VisualScript.
* `PROPERTY_USAGE_INTERNATIONALIZED` was only used in Object's
  `get_translatable_strings()`, which is a legacy function not used anywhere.
  So both are removed.
* Reordered some usage flags after the above removal to minimize the diff.
* General clean up.

Fixes #30203.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-01-09 16:56:01 +01:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
bruvzg
53c76fa5d1
[RTL/TextServer] Add baseline inline alignment mode for objects and RTL tables. 2022-12-15 23:16:02 +02:00
Gilles Roudière
be1c9d677d Rename all gdnative occurences to gdextension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension ->Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:04:57 +01:00
Yaohua Xiong
91e9ad92f5 Refactor baking code for Curve2D
The main change is to caculate tangent directly from bezier curve, without going
through discretized polyline, avoiding pitfalls of discretization. A similar refacor
had been applied to Curve3D.

The test cases for Curve2D is updated, comparing floating point with is_equal_approxmiate()
instead of `==`, in order to avoid float precision problem.
2022-12-05 21:22:05 +08:00
Silc Renew
83135aa122 Remove UPDATE_TRIGGER & Match behaviors between AnimationTree/Player
#69357
2022-12-02 20:28:10 +09:00
Rémi Verschelde
4a8b725bc9
Merge pull request #68386 from MewPurPur/snappedi-snappedf
Implement snappedi, snappedf, and Vector[2/3/4]i.snapped
2022-11-24 18:54:49 +01:00
Rémi Verschelde
5e2bb98eee
Merge pull request #68806 from MewPurPur/printraw-warn-better-in-docs
Make it clearer that printraw only prints to terminal
2022-11-24 18:54:42 +01:00
VolTer
a18afb9a56 Make it clearer that printraw only prints to terminal 2022-11-24 18:08:02 +01:00
Yaohua Xiong
f9fa182abc Refactor Curve3D::_bake() method
The main change is to caculate tangent directly from bezier curve, without going
through discretized polyline, avoiding pitfalls of discretization.

Other changes are:
1. Add an bezier_derivative() method for Vector3, Vector2, and Math;
2. Add an tesselate_even_length() method to Curve3D, which tesselate bezier curve to even length segments adaptively;
3. Cache the tangent vectors in baked_tangent_vector_cache;
2022-11-24 10:52:06 +08:00
Rémi Verschelde
3791872c65
Merge pull request #67726 from HenryClones/integer-lerping-errors
Add case for Variant::INT in lerp variant switch
2022-11-23 08:33:53 +01:00
Xpertice
3e36cc7c73 Add case for Variant::INT in lerp variant switch 2022-11-22 22:37:22 -05:00
VolTer
e26f0906f2 Implement snappedi, snappedf, and Vector[2/3/4]i.snapped 2022-11-19 06:18:55 +01:00
Micky
b4324e7a45 Remove PROPERTY_HINT_IMAGE_COMPRESS constants
These were used in 3.x but there's no reference of them in the codebase, at all.
2022-11-15 15:28:49 +01:00
Rémi Verschelde
08d56ac2f1
Merge pull request #66747 from aaronfranke/move-euler-order
Move EulerOrder enum to math_defs.h and global scope
2022-11-02 22:37:12 +01:00