Commit Graph

128 Commits

Author SHA1 Message Date
kobewi 6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
Rémi Verschelde 1ee2697682
Revert "Fix paste value not updated in dictionaries/arrays" 2023-06-24 10:59:35 +02:00
Rémi Verschelde e8e00b981e
Merge pull request #76711 from ajreckof/fix-paste-value-not-updating-element-in-dictionaries/array
Fix paste value not updated in dictionaries/arrays
2023-06-18 16:30:16 +02:00
ajreckof 31022d96a5 Fix being able to delete new key/value from dictionary editor. 2023-06-05 05:38:09 +02:00
Rémi Verschelde f77dee90a6
Merge pull request #76389 from ajreckof/editor-property-nodepath-for-node
Fix typed array export
2023-06-01 00:40:40 +02:00
kobewi 267728a240 Refactor vector editor properties 2023-05-31 00:14:28 +02:00
kobewi 010ce46ffa Add get_edited_property_value() shorthand method 2023-05-26 09:18:53 +02:00
ajreckof 465742d904 Fix typed array export
Apply suggestions from code review to squash later

Revert "Fix typed array export... again"

This reverts commit da8d6734fb.

Co-Authored-By: Tomek <kobewi4e@gmail.com>
2023-05-21 08:40:11 +02:00
Jackson Thomas Browne 4fb7aac651 Replace magic num in editor_properties_array_dict
Quick update to editor/editor_properties_array_dict max size.
Currently, an array in the EditorInspector won't display a number higher than 1,000,000.
In place of the current magic number this sets the max to be the INT32_MAX.
This eludes the magic number in place and is sufficiently large.

Resolves #77190
2023-05-19 14:34:22 -07:00
ajreckof 6f596ee903 fix paste value not updated in dictionaries/arrays 2023-05-12 16:13:35 +02:00
Nong Van Tinh 3ebf2264aa Fixes Node arrays appear as Object arrays in the inspector 2023-04-28 14:27:10 +07:00
kobewi da8d6734fb Fix typed array export... again 2023-04-23 20:08:30 +02:00
ajreckof 1557a37703 prevent nested packedArray from being casted to generic Arrays 2023-04-16 04:46:29 +02:00
kobewi 20261016a7 Fix typed array export
Co-authored-by: Guilherme Sousa <guilherme.sousa1994@gmail.com>
2023-04-12 12:19:17 +02:00
Yuri Sizov 4154039832 Improve includes of EditorNode (and everything else)
Also start organizing editor-specific GUI components
into a dedicated folder, `editor/gui`.
Also move `editor_file_server` next to the rest of debugger classes.
2023-04-07 18:59:49 +02:00
Rémi Verschelde 5ba53d0b36
Merge pull request #71740 from Jummit/dict-array-missing-types
Support signals and callables in exposed dictionaries
2023-02-11 22:04:02 +01:00
kobewi 2b71ede967 Fix @export_multiline for PackedStringArray 2023-02-04 17:06:58 +01:00
Dmitrii Maganov 5909f9f075 GDScript: Fix issues with typed arrays 2023-01-31 11:54:41 +02:00
Jummit 18e4b06162 Support signals and callables in exposed dictionaries 2023-01-20 16:32:16 +01:00
kobewi 59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
Rémi Verschelde 4c2dea108e
Merge pull request #70540 from vaartis/multiline-arrays-dictionaries
Implement export_multiline support for Array[String] and Dictionary
2023-01-13 18:01:55 +01: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
Ekaterina Vaartis 60692b4e45 Implement export_multiline support for Array[String] and Dictionary
For arrays, specifically check if it's a string array and pass the
type on to the editor. For dictionaries, save the hint on the type and
use it later to draw the multiline editor, except for when adding a
string key, because that doesn't make much sense. All string values
however will be drawn as multiline.
2022-12-25 01:46:57 +03:00
Silc Renew 060fb2d093 Add inspector plugin for key time edit & Change find key argument 2022-12-22 10:03:06 +09:00
kobewi d80a2a89f0 Fix crash in EditorPropertyArray 2022-11-29 16:08:43 +01:00
trollodel c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +01:00
Rémi Verschelde f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Rémi Verschelde 420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Marc Gilleron 7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Markus Sauermann 5ee449efec Remove unnecessary casts
button_add_item and button_add are both Button

p_parent is a Node3D

CanvasItem can never be cast to Viewport
2022-10-24 15:59:18 +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
SaracenOne 4d898f9bb4 Add read-only mode to inspector array and dictionary viewer. 2022-09-06 18:02:03 +01:00
Micky e31bb5ffeb Rename `CanvasItem.update()` to `queue_redraw()`
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
Rémi Verschelde fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +02:00
Rémi Verschelde f7f8af232c
Merge pull request #64885 from Mickeon/rename-tooltip-hint
Rename `hint_tooltip` to `tooltip_text` & setter getter
2022-08-28 17:43:01 +02:00
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Micky ef5b9a06a9 Rename `hint_tooltip` to `tooltip_text` & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +02:00
Juan Linietsky d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
reduz 455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
FireForge 0df23111b3 Show Resource type name in Array editor
Follow-up to #60409

Example: @export var gradient_array: Array[Gradient]
Before: Array[Object]
After: Array[Gradient]
2022-07-13 12:07:01 -05:00
FireForge 4e469886e8 Allow folding in sub-inspectors in Array and Dictionary editors 2022-06-14 23:25:40 -05:00
FireForge d605d13324 Add margins to Array and Dictionary editors 2022-06-11 10:44:15 -05:00
Rémi Verschelde c8ce7e34e2 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:57:54 +02:00
kobewi e7b0e7e35a Improve style of inspector buttons 2022-05-25 22:54:47 +02:00
kleonc 33b2970492 EditorPropertyArray Fix crash when drag-reordering elements in the inspector 2022-05-22 19:00:04 +02:00
kobewi e7da3ce96e Disallow Callable, Signal and RID in export arrays 2022-05-05 19:22:48 +02:00
Hugo Locurcio 180e5d3028
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
FireForge f563337251 Show typed Array type in Array editor
- Use vformat() and TTR() for Array editor button text
2022-04-20 22:59:51 -05:00
Rémi Verschelde e43fa2d35d Properly clean `button_add_item` ref in Array/Dict property editors
Fixes #59152.
2022-03-15 08:52:02 +01:00