Commit graph

311 commits

Author SHA1 Message Date
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +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
VolTer cb310a229b Rename Copy Property –> Copy Value 2022-09-30 16:44:27 +02:00
Rémi Verschelde 166df0896c Fix typos with codespell
Using codespell 2.3-dev from current git.

And fix typo in `methods.py` for `vsproj=yes` option (still won't work
though).
2022-09-30 14:23:36 +02:00
Rindbee e9465825cd Fix EditorInspectorCategory minimum size calculation
Calculated using the same theme property values as in `NOTIFICATION_DRAW`, keeping the width at `0` and calculating only the height.
2022-09-21 19:56:19 +08:00
Rémi Verschelde 82961dda3d Merge pull request #66108 from Zylann/editor_inspector_get_selected_path
Expose `EditorInspector.get_selected_path`
2022-09-19 22:01:32 +02:00
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