Commit graph

430 commits

Author SHA1 Message Date
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Aaron Franke
3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Hugo Locurcio
c012fbc8b2
Rename PROPERTY_USAGE_NOEDITOR to PROPERTY_USAGE_NO_EDITOR
This is consistent with other constants that include `NO`,
such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-11-03 23:06:17 +01:00
Rémi Verschelde
4387f9645b
Merge pull request #52940 from groud/toast_notification 2021-10-19 09:57:13 +02:00
Eric M
7e435fa841 Fixed shortcut saving and 'original' comparisons 2021-10-15 20:39:38 +10:00
Gilles Roudière
0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Rémi Verschelde
8f227e9da3
Merge pull request #51413 from KoBeWi/🚗 2021-10-04 20:31:47 +02:00
Eric M
ad30b0a8dd Allow shortcuts to have any number of bindings. Updated UI as required. 2021-10-01 18:04:28 +10:00
Lightning_A
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Paulb23
6596c7bdc2 Add TextFile support across the editor 2021-09-30 13:29:29 +01:00
Hugo Locurcio
3143e7df69
Add history navigation in the script editor using extra mouse buttons
This feature is enabled by default, but it can be disabled in the editor
settings in case it interferes with other uses of the extra buttons
(such as push-to-talk in a VoIP program).
2021-09-25 13:33:07 +02:00
Rémi Verschelde
726b826b31
Merge pull request #52901 from nonunknown/master 2021-09-21 21:04:52 +02:00
nonunknown
5489f43844 Fix alpha typo in code completion color 2021-09-21 12:59:01 -03:00
Eric M
6b65092c57 Added ability to override shortcut definitions for OSX (remove preprocessor defines) 2021-09-22 00:09:57 +10:00
Eric M
28b7c1be80 Improve implementation of builtin action overrides 2021-09-21 22:25:31 +10:00
Hugo Locurcio
e2718b7717
Tweak the 3D editor inertia defaults for better responsiveness
The default orbit sensitivity was decreased to account for this change.
Rotational inertia (orbit + freelook) was disabled by default due to
known issues.

This also removes the need for separate manipulation inertia settings,
as the default settings are more responsive.
2021-09-20 16:32:37 +02:00
Aaron Franke
ca801f833f
Add and use macros for defining editor settings with hint information 2021-09-15 14:19:58 -05:00
Hugo Locurcio
cbe6c25c6b
Rename polygon editor settings for better display in the Editor Settings 2021-08-23 17:59:19 +02:00
Paulb23
bcfc591f86 Reorganise text editor settings 2021-08-16 17:18:49 +01:00
Paulb23
7e70f9e0b9 Expose and cleanup TextEdit line wrap API 2021-08-12 09:29:16 +01:00
Paulb23
d5dcaee4c5 Cleanup and rename caret operations 2021-08-12 09:29:13 +01:00
kobewi
e401cd58f1 Add option to not expand tree on node select 2021-08-12 00:36:56 +02:00
Aaron Franke
fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
Rémi Verschelde
73cd3f0b38
Merge pull request #51395 from angad-k/pseudolocalization-squashed
Add pseudolocalization to Godot. (GSoC'21)
2021-08-08 17:55:30 +02:00
Angad Kambli
e79dde1cbb add pseudolocalization to Godot 2021-08-08 20:37:57 +05:30
Rémi Verschelde
de2c2be19b
Shortcut: Rename shortcut property to event
Having a property which has the same name as its class leads to confusing
situations (e.g. `BaseButton` has a `shortcut` property of type `Shortcut`
which has a `shortcut` property of type `InputEvent`).

Also renames `is_event` to `matches_event`, and `is_valid` to `has_valid_event`
to better reflect what the methods check.
2021-08-05 13:48:43 +02:00
Rémi Verschelde
92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
Rémi Verschelde
ff0b5f8fa1
Merge pull request #50809 from akien-mga/iterators-const-references 2021-07-25 12:52:58 +02:00
Rémi Verschelde
ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
luz paz
3564c16cb8
Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
Aaron Franke
4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
reduz
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
reduz
5ad4f26659 Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
Haoyu Qiu
4a26e61e89 Add numpad emulation in 3D viewport 2021-07-02 15:41:44 +08:00
Aaron Franke
2508fd0533
Use PROPERTY_USAGE_NONE instead of 0 for no property usage
Also use const more often.
2021-07-01 14:13:27 -04:00
Lightning_A
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Rémi Verschelde
4effadc0ba
Merge pull request #48696 from madmiraal/fix-48692
Fix `InputMap.action_erase_event()` failing to erase events correctly.
2021-06-20 00:29:42 +02:00
Rémi Verschelde
ba9ffbe5d7
Merge pull request #47813 from Calinou/editor-decrease-unfocused-fps-limit
Decrease the editor FPS limit when unfocused from 20 to 10
2021-06-17 12:46:29 +02:00
Rémi Verschelde
f862f9a056
EditorSettings: Factor code to compute auto display scale
Also fixes typo introduced in https://github.com/godotengine/godot/pull/48597/files#r652636544.
2021-06-16 14:36:09 +02:00
Rémi Verschelde
3f01b38185
Merge pull request #48597 from Calinou/editor-scale-auto-portrait
Handle portrait mode monitors in the automatic editor scale detection
2021-06-15 18:27:48 +02:00
Rémi Verschelde
1074017f04
Refactor editor paths validation in EditorPaths and EditorSettings
- EditorSettings: Ensure that `create()` makes a valid singleton.
  Fixes #49179, fixes #49450.
- EditorPaths: Cleanup code, properly set `paths_valid`.
- EditorPaths: Move more paths validation (check, mkdir) from
  EditorSettings for a better separation of concerns.
- EditorPaths: Move EditorFileSystem creation of `.godot/imported`
  next to other paths.
2021-06-14 19:56:20 +02:00
Rémi Verschelde
9e328bb5b7
Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
TwistedTwigleg
8aa3c2f091 New and improved IK system for Skeleton2D
This PR and commit adds a new IK system for 2D with the Skeleton2D node
that adds several new IK solvers, a way to control bones in a Skeleton2D
node similar to that in Skeleton3D. It also adds additional changes
and functionality.

This work was sponsored by GSoC 2020 and TwistedTwigleg.

Full list of changes:
* Adds a SkeletonModifier2D resource
  * This resource is the base where all IK code is written and executed
  * Has a function for clamping angles, since it is so commonly used
  * Modifiers are unique when duplicated so it works with instancing
* Adds a SkeletonModifierStack2D resource
  * This resource manages a series of SkeletonModification2Ds
  * This is what the Skeleton2D directly interfaces with to make IK possible
* Adds SkeletonModifier2D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in its own file
  * There is also a SkeletonModifier2D resource that acts as a stack for using multiple stacks together
* Adds a PhysicalBone2D node
  * Works similar to the PhysicalBone3D node, but uses a RigidBody2D node
* Changes to Skeleton2D listed below:
  * Skeleton2D now holds a single SkeletonModificationStack2D for IK
  * Skeleton2D now has a local_pose_override, which overrides the Bone2D position similar to how the overrides work in Skeleton3D
* Changes to Bone2D listed below:
  * The default_length property has been changed to length. Length is the length of the bone to its child bone node
  * New bone_angle property, which is the angle the bone has to its first child bone node
  * Bone2D caches its transform when not modified by IK for IK interpolation purposes
  * Bone2D draws its own editor gizmo, though this is stated to change in the future
* Changes to CanvasItemEditor listed below:
  * Bone2D gizmo drawing code removed
  * The 2D IK code is removed. Now Bone2D is the only bone system for 2D
* Transform2D now has a looking_at function for rotating to face a position
* Two new node notifications: NOTIFICATION_EDITOR_PRE_SAVE and NOTIFICATION_EDITOR_POST_SAVE
  * These notifications only are called in the editor right before and after saving a scene
  * Needed for not saving the IK position when executing IK in the editor
* Documentation for all the changes listed above.
2021-06-05 15:19:51 -04:00
Yuri Sizov
638cd3b056 Replace get_settings_dir with get_config_dir when fetching configuration paths 2021-06-03 18:24:26 +03:00
Rémi Verschelde
c5f237eaf8
Merge pull request #45393 from Paulb23/code_edit_autocomplete 2021-06-01 17:58:19 +02:00
Paulb23
c1b9971ad8 Move and expose Code Hint in CodeEdit 2021-06-01 15:38:45 +01:00
Rémi Verschelde
e615060cd6
Merge pull request #49132 from Calinou/editor-syntax-themes-rename-default
Rename the bundled text editor themes for consistency with themes
2021-05-31 14:47:49 +02:00
Hugo Locurcio
1704be0a44
Rename the bundled text editor themes for consistency with themes
The Adaptive text editor theme is the default, and has therefore
been renamed Default for consistency with the Default theme preset.
It keeps its automatic dark/light switch status.

The Default text editor theme was actually a legacy Godot 2-style theme,
so it has been renamed to Godot 2 to match the theme preset.
Its background color has been changed to be a constant opaque color,
since the new editor theme made the theme look less good on a translucent
background. The previous background color on light theme also lacked
contrast.
2021-05-31 14:02:13 +02:00
Rémi Verschelde
f0aa4e597a
Merge pull request #49178 from YeldhamDev/remove_dim_option 2021-05-31 12:27:01 +02:00
reduz
0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00