Commit graph

286 commits

Author SHA1 Message Date
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