Commit Graph

405 Commits

Author SHA1 Message Date
Marc Gilleron cee8bd9e76 Expose `EditorInspector.get_selected_path` 2022-09-19 15:20:34 +01:00
Marc Gilleron 056a418862 Expose `EditorProperty._set_read_only` virtual method 2022-09-19 11:56:49 +01:00
Rémi Verschelde 3546add9b3 Merge pull request #60786 from Rindbee/update-editor-property-status
Update checked based on the variant type of the value
2022-09-16 09:24:10 +02:00
Rémi Verschelde 37146763b1 Merge pull request #65868 from timothyqiu/metadata-crash
Fix crash open opening Add Metadata dialog
2022-09-16 09:24:02 +02:00
Haoyu Qiu 372e4cfd49 Fix crash open opening Add Metadata dialog 2022-09-16 11:28:09 +08:00
Michael Alexsander 2f016c521f Fix empty text in the add button when editing nodes with items 2022-09-15 22:01:52 -03:00
Rindbee 9066d55763 Update checked based on the variant type of the value
In `EditorProperty::update_revert_and_pin_status`, if `checkable` is `true`, update `checked` based on the variant type of the value, and rename the function as `EditorProperty::update_editor_property_status`.

**Known problems:**
1. Unable to check Checkbox for properties of type `Object` when it is unchecked. This is probably because during value store/fetch, the `nullptr` (variant type is `Variant::OBJECT`) eventually becomes `Variant()` (variant type is `Variant::NIL`).
2. For theme overrides, click the revert icon will uncheck the Checkbox. This is probably because `EditorPropertyRevert::get_property_revert_value` returns `Variant()`.
2022-09-16 07:22:50 +08:00
Rémi Verschelde 89840b75c9 Merge pull request #65430 from SaracenOne/read_only_array
Add read-only mode to inspector array and dictionary viewer.
2022-09-14 17:43:49 +02:00
Michael Alexsander c4c9e41073 Make `Vector2i` values paired with `EDSCALE` be just `Vector2` 2022-09-08 14:46:32 -03:00
bruvzg 6f4d233062
Fix key mapping changes when moving from macOS to other platform
Removes separate `Command` key (use `Meta` instead).
Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`).
2022-09-07 18:45:35 +02:00
Rémi Verschelde 2b6e043491 Merge pull request #58617 from KoBeWi/custom_something
Improve handling of custom types
2022-09-07 17:54:17 +02:00
Yuri Sizov 43f03e2ce6 Improve naming of theme properties throughout GUI code
Rename ItemList's bg -> panel
Rename ItemList's bg_focus -> focus
Rename ProgressBar's bg -> background
Rename ProgressBar's fg -> fill
Rename Tree's bg -> panel
Rename Tree's bg_focus -> focus
Rename ScrollContainer's bg -> panel
Rename FileDialog's *_icon_modulate -> *_icon_color
Rename FileDialog's files_disabled -> file_disabled_color
Rename CheckButton's on/off -> checked/unchecked
Rename check_v_adjust -> check_v_offset
2022-09-06 22:53:17 +03:00
SaracenOne 4d898f9bb4 Add read-only mode to inspector array and dictionary viewer. 2022-09-06 18:02:03 +01:00
FireForge a914dc0c46 Improvements to multi-node editing
- Show revert button for properties that are not default for all selected nodes
- Show property documentation tooltips
- Show common class name and icon and number of selected nodes in EditorPath, e.g. "Node2D (4 Selected)"
- Hide metadata for MultiNodeEdit and AnimationMultiTrackKeyEdit
- Hide script for MultiNodeEdit
2022-09-05 18:36:03 -05:00
kobewi a3309215c2 Improve handling of custom types 2022-09-05 23:08:28 +02:00
Hugo Locurcio 8611b712dc
Improve the editor's Add Metadata dialog
- Mention the node name in the dialog title.
- Improve error messages to be more descriptive.
2022-09-01 19:03:40 +02:00
Rémi Verschelde ae349d8227
Merge pull request #64377 from Mickeon/rename-canvas-redraw
Rename `CanvasItem.update()` to `queue_redraw()`
2022-08-30 14:47:41 +02:00
Atlinx 0e3097c023 Add missing parameters for signal in docs 2022-08-29 20:13:01 -04: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
Yuri Sizov 207bdc2b9f Remove Inspector tooltip hack that never actually worked 2022-08-26 17:22:13 +03:00
Rémi Verschelde 0a828dbd92
Merge pull request #64270 from timothyqiu/close-keying
Fix overlapping keying and remove button in Inspector
2022-08-25 07:53:55 +02:00
SaracenOne dd814a0dca Disable editing properties in foreign resources
from imported scenes or objects returning
true from a function named '_is_read_only' and
disable resaving imported resources.
2022-08-23 23:16:13 +01:00
kobewi ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02:00
Yuri Sizov 980f5f32f4 Make `property_*_revert` methods multilevel and expose them for scripting 2022-08-18 00:03:53 +03:00
Haoyu Qiu 3369d090d9 Fix overlapping keying and remove button in Inspector 2022-08-11 18:00:34 +08:00
Xwdit 39469fdd58 Fix document display in inspector for properties 2022-08-10 23:11:24 +02:00
Rémi Verschelde 6d94465f3c
Merge pull request #62868 from fire-forge/array-resize-size
Use a SpinBox in the inspector array resize dialog
2022-08-08 12:53:55 +02:00
Rémi Verschelde 77d3ac700d
Merge pull request #63712 from object71/fix-export-issues 2022-08-06 14:27:17 +02:00
Ricardo Buring 4a59188898 Fixup array property inspector 2022-08-04 16:21:09 +02:00
Rémi Verschelde a1d4cf6898
Merge pull request #63894 from fire-forge/add-metadata-button
Add spacing above the "Add Metadata" button
2022-08-04 09:06:18 +02:00
Hristo Stamenov 0e1f7e9f89 Removed faulty function update after get_property_list.
The function tried to rearrange properties but that lead to problems with duplication or deleted properties. Implemented the logic that that function did inside the get_property_list both for tool scripts and non-tool scripts.
2022-08-03 21:45:16 +03:00
FireForge 3200f196da Add 4px of spacing above the "Add Metadata" button 2022-08-02 17:39:08 -05:00
reduz 0351a0908f Clean-up array editing 2022-08-02 23:36:02 +02:00
Rémi Verschelde 6c5330154e
Merge pull request #63429 from RandomShaper/indicate_overridden 2022-07-31 23:54:38 +02:00
Rémi Verschelde 214d0b20b0
Merge pull request #62936 from Xwdit/script_doc_inspector_property 2022-07-31 22:28:05 +02:00
Pedro J. Estébanez 4a127cb5fe Improve usability of non-default values in the property inspector
- Provide a visual indication that a (sub)group contains non-default (revertable) values when it's collapsed.
- Add a new option to the inspector's tools menu for expanding only (sub)groups containing properties with non-default values.
2022-07-30 15:25:45 +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
Rémi Verschelde 03987738aa
Merge pull request #63351 from fire-forge/array-colors 2022-07-27 18:10:44 +02:00
Rémi Verschelde ba2aa30a18
Merge pull request #58443 from object71/fix-editor-properties-deleted-by-mistake 2022-07-27 16:53:26 +02:00
FireForge f26414762f Reduce contrast in inspector array element backgrounds
Co-authored-by: reduz <reduzio@gmail.com>
2022-07-27 09:50:28 -05:00
K. S. Ernest (iFire) Lee fb2b26eec3 Avoid crash when when the editor_property_map is empty. 2022-07-24 17:46:02 -07:00
Xwdit 8ee125a128 Fix document not showing for script properties in inspector 2022-07-14 03:33:51 +02:00
Rémi Verschelde 9b29f18631
Merge pull request #59680 from fire-forge/property-help
Add "Open Documentation" button to EditorProperty context menu
2022-07-13 14:12:53 +02:00
FireForge dcf42cff86 Add "Open Documentation" button to EditorProperty context menu 2022-07-11 19:30:46 -05:00
FireForge d6188b4632 Use a SpinBox in the inspector array resize dialog 2022-07-10 00:19:29 -05:00
FireForge e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
bruvzg 344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
reduz b7c41f9ba1 Add ability to export Node pointers as NodePaths
This PR implements:
* A new hint: PROPERTY_HINT_NODE_TYPE for variant type OBJECT, which can take specific node types as hint string.
* The editor will show it as a node path, but will set it as a pointer to a node from the current scene if you select a path.
* When scene is saved, the node path is saved, then restored as a pointer.

NOTE: This is a proof of concept and this approach will most likely not work. The reason if that, if the node referenced is deleted, then when trying to edit this the node will become invalid.

Potential workarounds: Since this uses the Variant API, it should obtain the pointer from the Variant object ID. Yet, this would either only really work in GDScript or it would need to be implemented with workarounds in every language.
Alternative ways to make this work: Nodes could export an additional property with a node path (like for which_node, it could be which_node_path).
Another alternative: Path editing could happen as a hidden metadata (ignoring the pointer).
2022-06-25 15:50:15 +02:00
Rémi Verschelde 4922fee09e
Merge pull request #59770 from fire-forge/rounded-corners 2022-06-10 10:53:09 +02:00
Rémi Verschelde ff75a49227
Merge pull request #61387 from KoBeWi/press_to_action
Improve style of inspector buttons
2022-05-26 00:57:21 +02:00
Rémi Verschelde 0736eed747
Merge pull request #60987 from fire-forge/vertical-move
Use the move mouse cursor shape for the inspector array reorder button
2022-05-26 00:54:35 +02:00
kobewi e7b0e7e35a Improve style of inspector buttons 2022-05-25 22:54:47 +02:00
FireForge 9bc6f44c80 Add rounded corners to EditorProperty and EditorSpinSlider
- Adds rounded corners to the EditorProperty child background, EditorSpinSlider label background, and resource sub-inspector borders and background.
- Allows customizing EditorSpinSlider label background through a new Theme StyleBox property, label_bg.
- Makes margins consistent in resource sub-inspectors.
- Removes space between buttons in NodePath, Resource, and multiline string editors.
- Adds space between label background and content for vertical property editors.
2022-05-25 15:31:30 -05:00
reduz 4044cc7d57 Reorganize Region Rect Editor
Problem:

* Region rect was pretty much a hidden editor. Because it was annoying for it to pop up automatically, it did not.
* Because it did not, most users have no idea it even exists.
* But because it is a transient editor, it would steal focus of other editor and annoy users.

Solution:

* Editor has been moved to a window.
* Regions that can be edited add a button below the region which can be pressed to open the editor.

This required a slight change in EditorInspectorPlugin to allow custom editors to be below others.
2022-05-24 09:42:49 +02:00
FireForge a369bc7325 Use the "Move" mouse icon in inspector arrays 2022-05-22 14:27:32 -05:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
RechieKho 8e8e457dd9 Disallow setting editor-only metadata in the editor 2022-05-05 16:11:27 +02:00
Hristo Stamenov f9dba447b9 Deleting only repeating "Scripted Variables" props 2022-05-04 09:09:26 +03: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
Haoyu Qiu 28317ef33c Fix issues when skipping l10n for script variables 2022-04-29 17:49:17 +08:00
Rémi Verschelde 004567e0cd
Merge pull request #60367 from timothyqiu/refresh-cd 2022-04-26 12:12:29 +02:00
FireForge 3073b85de9 Rename theme properties to include underscores
- check_vadjust -> check_v_adjust
- close_h_ofs -> close_h_offset
- close_v_ofs -> close_v_offset
- commentfocus -> comment_focus
- hseparation -> h_separation
- ofs -> offset
- selectedframe -> selected_frame
- state_machine_selectedframe -> state_machine_selected_frame
- table_hseparation -> table_h_separation
- table_vseparation -> table_v_separation
- vseparation -> v_separation
2022-04-23 11:16:18 -05:00
Haoyu Qiu 925167c4ea Reset refresh countdown if pending update tree request 2022-04-19 14:42:16 +08:00
Rindbee d97236bfca Fixes incorrect display of property labels with feature tags
Closes #60352
2022-04-19 09:08:56 +08:00
bruvzg d1207a0504
[Input] Add extra `shortcut_input` input processing step to process Unicode character input with Alt / Ctrl modifiers, after processing of shortcuts. 2022-04-05 13:46:45 +03:00
FireForge 88b09694e7 Fix inspector group name capitalization 2022-03-28 14:02:06 -05:00
Haoyu Qiu ccde2bf66f Add property name style toggle to Inspector 2022-03-28 18:52:09 +08:00
reduz 09b951b99b Refactor Object metadata
* API kept the same (Although functions could be renamed to set_metadata/get_metadata in a later PR), so not much should change.
* Metadata now exposed as individual properties.
* Properties are editable in inspector (unless metadata name begins with _) under the metadata/ namespace.
* Added the ability to Add/Remove metadata properties to the inspector.

This is a functionality that was requested very often, that makes metadata work a bit more similar to custom properties in Blender.
2022-03-24 14:21:52 +01:00
Haoyu Qiu 7bdca99d51 Improve inspector filtering 2022-03-18 01:16:25 +08:00
Rémi Verschelde c8fce1661d
Merge pull request #59102 from rcorre/copy-project-config 2022-03-13 15:38:55 +01:00
Ryan Roden-Corrent d271e2517e
Copy full project setting path from dialog.
The EditorProperty UI elements for project settings are created from
SectionedInspector, which has a prefix added to each property path. Each
EditorProperty needs to be made aware of this path so copy_property_path
copies the full path, and not just the suffix.

Fixes #59020.
2022-03-13 09:23:44 -04:00
Aaron Franke 918b09cabc
Initialize bools in the headers in editor 2022-03-12 13:34:06 -06:00
Rémi Verschelde 7e4a8d3ab3
Merge pull request #58706 from timothyqiu/property-i18n 2022-03-10 21:09:50 +01:00
reduz 21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +01:00
kobewi 3203a2b4bb Fix color pickers closing in editor settings 2022-03-05 13:25:32 +01:00
FireForge 6a4d3859cf Make EditorSpinSlider label color a theme property 2022-03-04 15:27:50 -06:00
Haoyu Qiu d6df2ffad8 i18n: Make property paths and categories translatable 2022-03-03 18:31:40 +08:00
Rémi Verschelde 51a00c2855
Merge pull request #58182 from akien-mga/style-cleanup-if-semicolons-deadcode 2022-02-16 16:55:07 +01:00
Rémi Verschelde b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
jmb462 dcd2a92af3 Port existing _notification code to use switch statements (part 1/3) 2022-02-16 11:38:24 +01:00
Rémi Verschelde c4779196b9
Merge pull request #58125 from fire-forge/editor_property_overlap_fix
Fix EditorProperty icon overlapping text with checkbox
2022-02-15 08:09:51 +01:00
FireForge dbc380af59 Fix EditorProperty text and icon overlap bugs 2022-02-13 22:27:06 -06:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Yuri Sizov 107b6f299c Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
FireForge 62073d157f Unify array, dictionary, and inspector array editors 2022-02-09 00:15:47 -06:00
kobewi 0e8147d303 Display built-in script names in the inspector 2022-02-08 16:15:27 +01:00
Rémi Verschelde a66e55069e
Merge pull request #57796 from akien-mga/revert-sname-theme-setters 2022-02-08 11:13:24 +01:00
Rémi Verschelde 6eeeb9a63c
Re-add missing `SNAME` macros in `get_theme_*` calls
They were removed in the previous commit reverting the addition of `SNAME`
to `add_theme_*` and theme setter methods, which is not wanted.
2022-02-08 10:31:56 +01:00
Rémi Verschelde fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
Rémi Verschelde 317cd0b19a
Refactor some object type checking code with `cast_to`
Less stringly typed logic, and less String allocations and comparisons.
2022-02-08 10:08:34 +01:00
jmb462 a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
jmb462 1ce81dc5f2 Add missing SNAME macro optimization in some function calls 2022-02-06 15:54:04 +01:00
bruvzg 244db37508
Cleanup and move char functions to the `char_utils.h` header. 2022-02-04 11:35:01 +02:00
Rémi Verschelde f8f19b313d
Merge pull request #57562 from AnilBK/string-add-contains
String: Add contains().
2022-02-03 22:21:24 +01:00
Anilforextra adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
Gilles Roudière 73e784de1e Remove get_focus_owner() from Control, replaced by get_viewport()->gui_get_focus_owner() 2022-02-03 11:59:32 +01:00
Rémi Verschelde 9f0a693b50
EditorHelpBit: Fix content height fit and RTL theme propagation
This reverts #51619 and fixes the issue properly, as well as enabling
`fit_content_height` which is necessary following #57304.

Fixes #57174.

Also adds a placeholder for property and signal tooltips with no description,
factoring the code while at it.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-02-02 22:16:46 +01:00
Rémi Verschelde 7c3003fcbe
Improve some signal bindings to use specific `Object` subtypes 2022-01-28 15:35:40 +01:00
Wilson E. Alvarez 3eb5e0ac50
Rename String::is_subsequence_ofi to String::is_subsequence_ofn 2022-01-26 18:03:56 -05:00
Rémi Verschelde 5e26a275bb
Merge pull request #56474 from brennengreen/keying-bounds 2022-01-23 00:33:28 +01:00
trollodel aa1102fc53 Store panels and docks singletons in their own classes 2022-01-20 20:13:26 +01:00
Fabio Alessandrelli 7e14548fc6 [Editor] Move some animation specific keying logic out of inspector.
Most of the custom logic to handle special keying cases is now inside
the AnimationPlayerEditorPlugin.

The EditorInspector now emits a signal when inspecting a new object.
2022-01-19 11:08:25 +01:00
Fabio Alessandrelli 98b147b319 [Editor] Fix inspector keying signals argument count.
The second parameter of the signals `EditorInspector.property_keyed` and
`EditorProperty.property_keyed_with_value` can be NIL, causing the event
to fire with less arguments when using `emit_signal` that accepts
Variant arguments, so we use the pointer version instead.
2022-01-07 15:48:37 +01:00
Brennen Green e5759b7ff9 add bounds to next keying next 2022-01-04 17:18:26 -05:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Rémi Verschelde 1032c2c434
Merge pull request #55487 from YeldhamDev/scroll_bikeshedding 2022-01-03 14:10:41 +01:00
luz paz a124f1effe Fix various typos
Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn`
Update editor/import/resource_importer_layered_texture.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update doc/classes/TileSetScenesCollectionSource.xml

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/graph_edit.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/rich_text_label.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Revert previously committed change
2022-01-02 01:03:58 -05:00
Pedro J. Estébanez 18663aa305 Stop asuming a default value of NIL means there's no default 2021-12-11 14:03:48 +01:00
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
Nathan Franke 41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
kobewi 841a9ef820 ScrollContainer's scrollbar visibility is now enum 2021-12-07 18:27:12 +01:00
Rémi Verschelde 75ac048e4b
Merge pull request #55662 from KoBeWi/update_minimum_size_changed_to_update_minimum_size 2021-12-06 18:28:46 +01:00
jmb462 81efebb3a1
Fix bad popups offset in editor with single window off
Co-authored-by: Gil Arasa Verge <gilarasaverge@gmail.com>
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2021-12-06 14:29:48 +01:00
kobewi ea7cc1dea9 Rename minimum_size_changed() method 2021-12-06 14:02:34 +01:00
Haoyu Qiu da94b61d09 Fix EditorPlugin.remove_inspector_plugin() instance cleanup 2021-12-06 10:25:01 +08:00
Michael Alexsander ec4f4c6cda Rename all methods that return `ScrollBar` nodes to `get_*_scroll_bar()` 2021-11-30 13:46:36 -03:00
Lightning_A e078f970db Rename `remove()` to `remove_at()` when removing by index 2021-11-23 18:58:57 -07:00
Yuri Roubinsky eabf8f5edf Added `reset_size` method to `Control` and `Window` classes 2021-11-22 16:55:21 +03:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Rémi Verschelde 57ae154e86
Merge pull request #53987 from groud/tile_data_inspector_plugin 2021-11-12 15:10:54 +01:00
Yuri Sizov 2e4d18c929 Fix EditorInspectorPlugin virtual bindings and add parse_group callback 2021-11-10 17:56:59 +03:00
Pedro J. Estébanez 8d6f80d367 Add property value pinning 2021-11-08 17:42:30 +01:00
Pedro J. Estébanez 1806ec7c14 Unify determination of default property values 2021-11-07 15:27:47 +01:00
kobewi e393c2a734 Add is_built_in() method to Resource 2021-11-04 12:45:58 +01:00
Gilles Roudière cec004adf0 Implement polygons editors in the tiles selection mode 2021-10-26 12:38:36 +02:00
Hugo Locurcio bf34253131
Use a yellow color for editable children properties instead of red
This matches the usual "Changes may be lost!" warning color.

- Remove a duplicate editor theme color setting declaration.
2021-10-05 19:15:44 +02:00
Lightning_A c63b18507d Use range iterators for `Map` 2021-09-30 15:09:12 -06:00
Rémi Verschelde eca594d25e
Merge pull request #52376 from rcorre/prop_path_copy_fix
Don't handle property_editor shortcuts on release.
2021-09-16 13:25:44 +02:00
Rémi Verschelde a3d1bc757d
Merge pull request #32068 from aaronfranke/transform-editor
Reformat Transform(2D) matrix display in the inspector
2021-09-15 13:06:25 +02:00
Gilles Roudière ed0a3b29dd
Merge pull request #52636 from Jummit/highlight_categories
Highlight hovered inspector categories
2021-09-14 18:19:11 +02:00
Rémi Verschelde de3bc8d294
Merge pull request #52259 from jmb462/fix-ctrl-V-wrong-behavior-in-inspector-textedit
Fix Ctrl+V wrong behavior in inspector textedit (Fix #52208)
2021-09-14 13:04:57 +02:00
Jummit 38b312404b Highlight hovered inspector categories 2021-09-13 21:35:09 +02:00
PouleyKetchoupp 37de1df2ab Fix undo/redo for properties set as PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED
Full inspector update was triggered only on property changed, but not on
undo/redo actions, which can cause inspector discrepancies when some
properties are supposed to be shown or hidden.

Now update all flag is passed into _edit_set() method which already has
logic to handle this case properly (it still triggers update_tree() down
the line).
2021-09-07 13:58:41 -07:00
Gilles Roudière 4bd7700e89 Implement properties arrays in the Inspector. 2021-09-07 09:51:28 +02:00
Silc 'Tokage' Renew facf8f1883 Apply set_read_only() to child classes of EditorProperty elements 2021-09-05 18:22:17 +09:00
Ryan Roden-Corrent b296ad23b4
Don't handle property_editor shortcuts on release.
Fixes #52336.

EditorProperty::unhandled_key_input was handling both press and release.
This means that if you press `ctrl+v` on an EditorProperty line input,
it will paste as expected on pressing `ctrl+v`, and accept the event so
EditorProperty will not see it. However, on release, LineEdit ignores
the event and EditorProperty still catches and handles it, using its own
paste implementation.
2021-09-03 08:33:02 -04:00
Aaron Franke 288f0b6555
Reformat Transform(2D) inspector menus
Move, rename, recolor, and fix the inspector for these in the inspector. Coloring is now done by a helper method in "editor_inspector.cpp".
2021-08-31 11:24:40 -05:00
jmb462 91974057a5 Fix CTRL+V doesn't work properly in inspector textedit 2021-08-30 17:33:01 +02:00
SaracenOne 1fbbe25cea Fix crash on scenes with tool scripts and mismatched node types 2021-08-27 14:32:28 +01:00
Ryan Roden-Corrent 0205fffbf3
Copy/Paste property paths/values in inspector.
Resolves godotengine/godot-proposals#106.

Adds the following property menu options with default bindings:

- Copy Property (ctrl+c)
- Paste Property (ctrl+v)
- Copy Property Path (ctrl+shift+c)

If you hover over a property label in the inspector dock, you can copy
either the property value or the property path to the system clipboard
using the shortcuts above This is especially useful for the
`AnimationTree`, where code might reference properties like
"parameters/state/aim/move/blend_position".

One issue is that if you click a property, then click on the node you
currently have selected in the node tree, then press ctrl+shift+c, it
will still copy the selected property path rather than the node path. If
you click on a different node in the nodetree, however, ctrl+shift+c
will return to copying the nodepath.

The property value copy/paste was implemented by @KoBeWi at #39398 and
merged into this PR due to their similarity.
2021-08-23 18:15:05 -04:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
PouleyKetchoupp 645bc94bfc Fix capsule height/radius setters with linked properties
Capsule height and radius setters can modify each other, rather than
using clamping, to avoid cases where values are not set correctly when
loading a scene (depending on the order of properties).

Inspector undo/redo:
Added the possibility to link properties together in the editor, so
they can be undone together, for cases where a property can modify
another one.

Gizmo undo/redo:
Capsule handles pass both radius and height values so they can be undone
together.
2021-08-19 10:31:19 -07:00
Yuri Roubinsky 33e0b4b60d Fix incorrect word block colors in the inspector tooltip 2021-08-13 16:15:05 +03:00
Yuri Sizov 45af2af214 Fix theme property descriptions in the Inspector 2021-08-06 17:12:43 +03:00