Commit graph

262 commits

Author SHA1 Message Date
Hendrik Brucker
a38fd09669 Clean up/refactor GraphEdit 2023-07-24 18:37:23 +02:00
Yuri Sizov
91258e52be
Merge pull request #79307 from Geometror/remove-graph-node-comment
Remove GraphNode's comment property and related functionality
2023-07-24 16:56:41 +02:00
Hendrik Brucker
a29a680920 Extract StyleBoxFlat, StyleBoxTexture and StyleBoxLine in their own file 2023-07-17 13:25:00 +02:00
Hendrik Brucker
662d8c76b3 Remove GraphNode's comment property and related functionality
(this functionality will be reintroduced in a new and more flexible way)
2023-07-11 02:05:25 +02:00
Hendrik Brucker
1e8ca95cdc [GraphEdit] Fix port hotzones at zoom levels other than 100% 2023-06-25 17:13:53 +02:00
QbieShay
237e3c6099 Fix regression in visual nodes hotzones 2023-06-22 19:03:17 +02:00
Ninni Pipping
0c16082e1e Use get_node_or_null when null checks are present
Avoids duplicate or unnecessary errors
2023-06-10 13:22:56 +02:00
Ninni Pipping
dcd2b883eb Use NULL instead of COND checks when appropriate
Restricted to scene
2023-06-10 08:56:30 +02:00
Michael Alexsander
8118d0d2f5 Add more uses of appropriate cursors when resizing/moving some UI nodes 2023-05-07 11:14:57 -03:00
Hendrik Brucker
49587fd6d9 Fix several GraphEdit operations at zoom levels other than 100% 2023-04-02 16:40:10 +02:00
Michael Alexsander
c567a853db Fix GraphNode resizing when its bottom border is too thin 2023-02-23 01:42:06 -03:00
Hendrik Brucker
3aab79914c Fix GraphEdit port hotzone snapping 2023-02-12 01:31:58 +01:00
Hendrik Brucker
4601acbaf4 Update GraphEdit configuration warning, mark GraphNode/GraphEdit as experimental 2023-02-09 02:39:55 +01:00
Silc Renew
8f21f637e2 Fix scroll_offset_changed signal doesn't fired when panning GraphEdit 2023-02-01 07:11:35 +09:00
Stanislav Labzyuk
068f4d88f6 Fix connections drawing in GraphEdit minimap 2023-01-28 18:55:14 +01:00
Gilles Roudière
a3b431b09d Add gesture to ViewPanner and simplify a bit its API 2023-01-23 16:43:53 +01:00
Rémi Verschelde
2d214c8881
Merge pull request #70685 from stmSi/fix-nan-graphedit-infinite-loop
Fix: NaN value making infinite loop inside GraphEdit's `NOTIFICATION_DRAW`
2023-01-16 09:41:08 +01:00
stmSi
d1bd7539a6 Fix NaN value making infinite loop inside GraphEdit's NOTIFICATION_DRAW 2023-01-13 12:29:29 +06:30
Hendrik Brucker
62278eb236 Rename (de)selected signals to node_(de)selected in GraphNode 2023-01-12 04:08:06 +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
K. S. Ernest (iFire) Lee
8302f17adf Update graph_edit.cpp to automatically arrange nodes if nothing is selected. 2023-01-04 16:48:01 -08:00
kobewi
5490c22ffb Improve usage of StringNames in GraphEdit 2022-12-02 22:57:23 +01:00
Haoyu Qiu
06a0b26c9e Fix inspector not showing name for LabelSettings.font 2022-11-25 12:48:37 +08:00
kobewi
d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +02:00
Rémi Verschelde
2ffb609658 Merge pull request #66337 from EricEzaM/sprite-frames
Ensure control built-in shortcuts are matched exactly & add shortcuts for SpriteFrames editor
2022-10-13 15:24:39 +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
Eric M
2eda77c682 Ensure all checks of is_action in the editor which are for 'shortcut' use, check the action exactly. 2022-09-24 18:01:02 +10:00
Marc Gilleron
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
Hendrik Brucker
299585fcde Add configuration warning to GraphEdit regarding future refactoring 2022-09-14 18:09:21 +02:00
Yuri Sizov
29c8504dd9 Improve parameter naming and documentation in GraphEdit and GraphNode
Co-authored-by: Maganty Rushyendra <mrushyendra@yahoo.com.sg>
2022-09-09 17:50:44 +03:00
kobewi
b218727599 Rename raise() to move_to_front() 2022-09-06 22:13:06 +02:00
Maxim Kulkin
9a35ede23f Add GraphNode 'selected' and 'deselected' signals, simplify GraphEdit 2022-09-05 02:32:06 -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
Rémi Verschelde
d3db8bbebd
Merge pull request #62846 from AaronRecord/remove_redundant_theme_updates_in_enter_tree
Remove `NOTIFICATION_ENTER_TREE` when paired with `NOTIFICATION_THEME_CHANGED`
2022-08-27 21:56:14 +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
SaracenOne
75f1357ced Add read-only mode to AnimationTreeEditor plugins 2022-08-25 16:29:36 +01:00
Yuri Sizov
5d14d08702
Merge pull request #59226 from Rindbee/better-setters-in-gui-controls
Improve the setters in gui, return directly if the value does not change.
2022-08-24 17:03:54 +03:00
kobewi
1abdffe7a0 Replace Array return types with TypedArray 2 2022-08-23 23:21:32 +02:00
风青山
e561c68256 Add some codes, returnes directly if the value is not changed.
Avoid executing the following value-changed logics if the value does not really change.
2022-08-23 23:25:22 +08:00
daylilyzeleen
64e33d9ed1 fixed GraphEdit signal argument type 2022-08-12 20:18:36 +08:00
tefusion
f1c19e058c Fix GraphEdit::arange_nodes causing a freeze
When a Graph contains cycles, e.g. 1->2->3->1 _layering would end
up in an infinite loop since IS_SUBSET would never be true.
By keeping check of the size of z, which contains the already layered
nodes, one can detect a freeze (since it should change after
current_layer increases. If it doesn't "u" didn't change and q and u
will  never be equal resulting  in a freeze/infinite while loop).
If a freeze happens warn the user and put all the nodes part of the
cycle (leftover in p) to the  first layer which will end up in them
being listed top to bottom.
2022-08-04 17:13:56 +02:00
Johannes Witt
2fb69afde6
Add GraphEdit.is_node_hover_valid(...) method
This is a virtual method that can be used to add additional error
condition checks while the connection is still being dragged. If true is
returned, the connection is valid. If false is returned, the connection
is invalid and thus not possible (ie. it will not snap). The virtual
method is exposed with an underscore to scripts.
2022-07-31 15:35:26 +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
FireForge
97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
FireForge
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
Hendrik Brucker
c6a39cd952 Fix enclosed nodes calculation of GraphEdit comment nodes 2022-06-02 13:14:46 +02:00
Hendrik Brucker
70c234f3e3 Improve Graphedit connection lines 2022-05-30 17:33:01 +02:00