Commit graph

207 commits

Author SHA1 Message Date
Marius Hanl
af6a4f300e Improve performance of the 'Create New Node' dialog
- Merged 3 for loops into 1 and save Vector allocation
- Use get_instance_base_type() or get_global_name() instead of get_language()->get_global_class_name() for performance considerations
- Use StringName where appropriate
2024-05-15 20:50:13 +02:00
A Thousand Ships
ee79386f7b
[Scene] Add SceneStringNames::pressed 2024-05-14 15:51:28 +02:00
kobewi
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
A Thousand Ships
a0dbdcc3ab
Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
Danil Alexeev
a714cb9f65
Editor: Display deprecated/experimental messages in tooltips 2024-04-18 14:32:04 +03:00
kobewi
c9407931b8 Disable Create button for abstract classes 2024-04-17 18:48:36 +02:00
Haoyu Qiu
8cd1ebbd6d Fix unexpected auto translation of Tree content 2024-03-18 09:31:00 +08:00
Muller-Castro
1638c1b28f Add const lvalue ref to editor/* container parameters 2024-02-26 15:28:15 -03:00
Michael Alexsander
7b42c24550
Make auto translation inheritable 2024-02-15 16:51:19 -03:00
Yuri Sizov
635b8a1474 Split theme generation logic into several subroutines
This change introduces a new theme configuration struct to be
passed to the aforementioned routines to better control reuse
of styles and definitions in the generator.

Everything not passed and not explicitly shared is scoped so it
is not automatically accessible throughout the routine. This
should ensure that the decision to share styles is a conscious one.

In the future we will try to reduce the number of unique definitions
and share most of it. This PR is a stepping stone on this path.

This also puts the effort into separating redefinitions of
default theme items vs custom types introduced only by the editor.
In a few cases where editor-specific definitions need to reference
default definitions we simply fetch them from the theme. It's not
ideal and hides the dependency a bit, but hopefully these cases
will be abstracted properly in due time.
2024-01-16 11:57:45 +01:00
Yuri Sizov
95b27fe8c7 Reorganize code related to editor theming
This change introduces a new EditorThemeManager class
to abstract theme generatio and its subroutines.

Logic related to EditorTheme, EditorColorMap, and editor
icons has been extracted into their respective files with
includes cleaned up.

All related files have been moved to a separate folder to
better scope them in the project. This includes relevant
generated files as well.
2024-01-16 11:57:45 +01:00
kobewi
0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
Rémi Verschelde
5eb22a317d
Merge pull request #83577 from DennisManaa/fix-translation-for-item-list
Add automatic translation of items to ItemList
2024-01-04 16:39:36 +01:00
DennisManaa
1a1c542836 Implement automatic translation for ItemList 2023-10-23 10:14:08 +02:00
Yuri Sizov
9b03fb36f9 Improve threading in ClassDB and EditorHelp 2023-10-20 22:14:04 +02:00
Michael Alexsander
ae91644c73
Revamp how documentation tooltips work 2023-10-03 17:40:51 -03:00
Rémi Verschelde
d759f91f8d
Merge pull request #81101 from 398utubzyt/dotnet/abstract-class-support
C#: Add abstract class support
2023-09-25 17:18:05 +02:00
398utubzyt
2df37a237a C#: Abstract script class support 2023-09-15 20:35:25 -07:00
Yuri Sizov
8ecc0c4f47 Fix accessing editor theme items throughout the UI
This also exposes `EditorInterface::get_editor_theme`.
2023-09-15 14:51:01 +02:00
Rémi Verschelde
786dab42fd
Merge pull request #70329 from Daylily-Zeleen/daylily-zeleen/register_internal_class
Allow GDExtension to register unexposed classes.
2023-09-11 15:35:31 +02:00
Daylily-Zeleen
41ffe5461f Allow GDExtension to register unexposed class. 2023-09-04 10:18:20 +08:00
kobewi
6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
MewPurPur
398ca4e71a Use the gray color for all abstract classes 2023-08-31 12:59:18 +03:00
Hugo Locurcio
08118b1456
Only display 15 nodes in the Recent section of the Create New Node dialog
This prevents the history size from becoming too large, which made it less
useful.

This also fixes an off-by-one error in the completion scoring algorithm.
2023-06-23 23:51:51 +02:00
Yuri Sizov
294b1a731a
Merge pull request #63732 from DarkMessiah/create-new-node-arrow-navigation
Add arrow navigation for the Create New Node window
2023-05-29 12:21:29 +02:00
Stanislav Labzyuk
7b139e77e8 Add spacebar for folding in the Create New Node window 2023-05-28 12:48:34 +02:00
Yuri Sizov
1522762dc9 Make icons of scripted and custom classes fit the editor UI
Also:
- Add an option to limit the icon size in PopupMenu.
This is similar to how this works in Tree and TreeItem.
- Add the same option to TabBar.
- Add a theme constant for Tree, PopupMenu, Button, and
TabBar to apply this limit on the control level.

Co-authored-by: Daylily-Zeleen <daylily-zeleen@foxmail.com>
2023-03-31 21:39:02 +02:00
Ryan Roden-Corrent
894ce41180
Apply clamp_to_embedder on parent resize and popup.
Fixes #75084.

The clamp_to_embedder setting was added in 8be16e0704,
but was not set on any of the in-editor dialogs.

This patch sets `clamp_to_embedder` on editor dialogs so they cannot be dragged out of the frame.
This also modifies `clamp_to_embedder` so a window is clamped to the bounds of an embedder when
it pops up and when the parent is resized.
2023-03-27 07:08:29 -04:00
kobewi
970f5533dd Fix filtering editor nodes in Create Dialog 2023-01-27 12:26:26 +01:00
kobewi
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
Dmitrii Maganov
274d49790d GDScript: Fix extending abstract classes, forbid their construction 2023-01-12 17:47:10 +02:00
Juan Linietsky
e6a4debede Change set_drag_forwarding() to use callables.
* This solution is much cleaner than the one in 3.x thanks to the use of callables.
* Works without issues in any language (no need to worry about camel or snake case).
* Editor code uses a compatibility function (too much work to redo).

Fixes #59899
2023-01-10 14:09:24 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Aaron Franke
137508dfc8
Check if class exists before checking if it's virtual in Create Dialog 2022-12-11 13:12:59 -06:00
Rémi Verschelde
3673eb7001
Merge pull request #67553 from Sauermann/fix-new-node-dialog-description
Fix Updating New Node Dialog Description of Custom Nodes
2022-12-05 18:07:20 +01:00
Rémi Verschelde
6d2a7cb46d
Merge pull request #68709 from MewPurPur/instance-begone-part3
Remove more instances of 'instance' being used as a verb
2022-11-16 14:41:42 +01:00
VolTer
3b4f5f8a04 Remove more instances of 'instance' being used as a verb 2022-11-16 14:01:53 +01:00
Rémi Verschelde
2444860d03
Merge pull request #67798 from KoBeWi/code_resurrection
Uncomment drag forwarding in CreateDialog
2022-11-15 13:25:00 +01:00
Aaron Franke
ba542444e3
Don't allow instancing virtual node types in the Create New Node dialog 2022-11-05 14:45:16 -05:00
kobewi
c5c30898af Uncomment drag forwarding in CreateDialog 2022-10-23 15:47:22 +02:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Markus Sauermann
6a3df02956 Fix Updating New Node Dialog Description of Custom Nodes
The text of the first column in the selection Tree is used to compare
Node names.
Since this text contains additionally the path to the file, it doesn't
match anything.

This patch separates the path and puts it into the cell as suffix.
2022-10-18 01:56:07 +02:00
Rémi Verschelde
8017827144 SCons: Re-enable treating #warning as error with werror
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Markus Sauermann
c8106ca317 Fix creating Nodes from Recent list
- give shorter search matches more weight
- allow matching against "Node"
2022-09-30 22:40:10 +02:00
SaracenOne
cc4bda8500 Add ability to flag classes as experimental or deprecated. 2022-09-11 00:11:33 +01:00
Nathan Franke
a258101971
simplify title of create/change node dialog
The create dialog in replace mode now always has the title `Change type of "%s"`, where `%s` is either "MyNodeName" or "MyVisualScript.vs".
2022-09-07 21:44:33 -05:00
kobewi
a3309215c2 Improve handling of custom types 2022-09-05 23:08:28 +02:00
Rémi Verschelde
ebe4f8d3a4
Merge pull request #65039 from Mickeon/rename-treeitem-tooltip 2022-08-30 14:05:08 +02:00
Micky
97f8c9b97c Rename TreeItem's set_tooltip to set_tooltip_text
`set_tooltip` -> `set_tooltip_text`
`get_tooltip` -> `get_tooltip_text`

For consistency:
`get_button_tooltip` -> `get_button_tooltip_text`
And the `tooltip` parameter in `add_button` was renamed to `tooltip_text`
2022-08-30 11:16:23 +02:00