Commit Graph

341 Commits (cb1569345a6f17da08241e645ab03cb2e1b78d2f)

Author SHA1 Message Date
Daylily-Zeleen 28a2fa496f [GraphEdit] Convert to minimap line after getting connection line. 2024-05-29 12:58:51 +07:00
Hendrik Brucker 6a067a4a80 [GraphEdit] Fix GraphNode's ports interactable through other GraphNodes 2024-05-15 19:55:43 +07:00
A Thousand Ships ee79386f7b
[Scene] Add SceneStringNames::pressed 2024-05-14 15:51:28 +07:00
kobewi 413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +07:00
Hendrik Brucker 62776842df [VisualShader] Add reroute node and improve port drawing 2024-05-13 03:26:01 +07:00
A Thousand Ships 308dbb8c63
[Core] Add scalar versions of `Vector*` `min/max/clamp/snap(ped)`
Convenience for a number of cases operating on single values
2024-05-02 10:31:13 +07:00
Hendrik Brucker a81561cbd9 Add GraphFrame and integrate it in VisualShader 2024-04-04 15:11:00 +07:00
kobewi 25f9f923a1 Rename some arguments called "position" 2024-03-27 01:28:24 +07:00
A Thousand Ships 79ba22a73f
Use `Vector*` component-wise `min/max/clamp` functions where applicable 2024-03-20 13:47:42 +07:00
Michael Alexsander d70c45b5c8
Add option to add built-in strings in the POT generation 2024-02-28 11:34:26 +07:00
Hendrik Brucker 02a33b67a8 Redesign the graph editor for visual shaders 2024-02-22 20:40:09 +07:00
Rémi Verschelde 21f0529aa9
Revert "Update Node::get_configuration_warnings signature"
This reverts commit d3852deaa4.
2024-02-17 19:03:21 +07:00
RedMser d3852deaa4 Update Node::get_configuration_warnings signature 2024-02-08 23:05:20 +07:00
Hendrik Brucker 9d7c2978f4 Rework GraphEdit connections (drawing, API, optimizations)
- GraphEdit now uses Line2D nodes to draw connection lines and uses a dedicated canvas item shader for them
2024-01-18 16:53:15 +07:00
Yuri Sizov b9dff50282 Merge pull request #83785 from Geometror/graphedit-dotted-grid
Add dotted grid to GraphEdit
2023-12-19 20:32:35 +07:00
Lera Elvoé 60cb44e84c
Add GraphEdit connection layer child as internal 2023-11-17 15:29:39 +07:00
Hendrik Brucker 1a8e676131 Add different grid patterns to GraphEdit 2023-11-14 19:48:31 +07:00
Hendrik Brucker 9391046c32 Fix GraphNode slot index inconsistency. 2023-10-24 16:19:33 +07:00
Rémi Verschelde 024172b4eb
Merge pull request #82409 from KoBeWi/3_in_1
Document, cleanup and fix some theme properties
2023-10-18 00:00:36 +07:00
Yuri Sizov b07c664af9 Make `GraphEdit` toolbar more customizable
Also adds a semi-transparent background
to make the toolbar stand out in front of nodes.
2023-10-02 13:43:08 +07:00
kobewi cfb6d25d30 Document, cleanup and fix some theme properties 2023-09-27 00:06:15 +07:00
Yuri Sizov 378ab38b1f Rename close requests to delete requests in `GraphEdit` 2023-09-26 16:41:39 +07:00
Rémi Verschelde 8ddf73c74d
Merge pull request #81939 from YuriSizov/gui-flat-and-depressed
Replace flat buttons with flat-styled buttons with a visible pressed state
2023-09-25 17:18:29 +07:00
Yuri Sizov 4bd569be95 Replace flat buttons with flat-styled buttons with a visible pressed state 2023-09-19 22:36:29 +07:00
ajreckof 6afadbaa9f Replace Ctrl in editor shortcuts with Cmd or Ctrl depending on platform 2023-09-19 10:29:07 +07:00
Yuri Sizov 325ec7fdda Merge pull request #81600 from aaronfranke/fix-graph-edit-valid-port-conn-type
Fix GraphEdit port valid connections incorrectly checking sides
2023-09-14 15:21:59 +07:00
Yuri Sizov fe000277ea Bind remaining theme properties to their respective classes
This adds binds for GraphEdit/GraphElement/GraphNode, which were
skipped before due to a rework. This also adds binds for Window,
which was skipped before due to a complicated code organization.

Also adds theme cache entries/direct cache access to a few places
that previously missed it. Some theme properties are now exposed
to other classes via friendships or public getters for convenience.

This removes all string-based theme access from scene/ classes.
2023-09-13 19:31:35 +07:00
Aaron Franke 366e54b0a3
Fix GraphEdit port valid connections incorrectly checking sides 2023-09-12 20:46:43 +07:00
Hendrik Brucker 5afe78bd9c Clean up/refactor GraphNode and make it more flexible
Split GraphNode into GraphElement and GraphNode, add custom
titlebar, and adjust theming.
2023-09-07 17:29:06 +07:00
Hendrik Brucker a38fd09669 Clean up/refactor GraphEdit 2023-07-24 18:37:23 +07: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 +07:00
Hendrik Brucker a29a680920 Extract StyleBoxFlat, StyleBoxTexture and StyleBoxLine in their own file 2023-07-17 13:25:00 +07: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 +07:00
Hendrik Brucker 1e8ca95cdc [GraphEdit] Fix port hotzones at zoom levels other than 100% 2023-06-25 17:13:53 +07:00
QbieShay 237e3c6099 Fix regression in visual nodes hotzones 2023-06-22 19:03:17 +07: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 +07:00
Ninni Pipping dcd2b883eb Use NULL instead of COND checks when appropriate
Restricted to scene
2023-06-10 08:56:30 +07:00
Michael Alexsander 8118d0d2f5 Add more uses of appropriate cursors when resizing/moving some UI nodes 2023-05-07 11:14:57 +07:00
Hendrik Brucker 49587fd6d9 Fix several GraphEdit operations at zoom levels other than 100% 2023-04-02 16:40:10 +07:00
Michael Alexsander c567a853db Fix `GraphNode` resizing when its bottom border is too thin 2023-02-23 01:42:06 +07:00
Hendrik Brucker 3aab79914c Fix GraphEdit port hotzone snapping 2023-02-12 01:31:58 +07:00
Hendrik Brucker 4601acbaf4 Update GraphEdit configuration warning, mark GraphNode/GraphEdit as experimental 2023-02-09 02:39:55 +07:00
Silc Renew 8f21f637e2 Fix scroll_offset_changed signal doesn't fired when panning GraphEdit 2023-02-01 07:11:35 +07:00
Stanislav Labzyuk 068f4d88f6 Fix connections drawing in GraphEdit minimap 2023-01-28 18:55:14 +07:00
Gilles Roudière a3b431b09d Add gesture to ViewPanner and simplify a bit its API 2023-01-23 16:43:53 +07: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 +07:00
stmSi d1bd7539a6 Fix NaN value making infinite loop inside GraphEdit's NOTIFICATION_DRAW 2023-01-13 12:29:29 +07:00
Hendrik Brucker 62278eb236 Rename (de)selected signals to node_(de)selected in GraphNode 2023-01-12 04:08:06 +07: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 +07: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 +07:00
kobewi 5490c22ffb Improve usage of StringNames in GraphEdit 2022-12-02 22:57:23 +07:00
Haoyu Qiu 06a0b26c9e Fix inspector not showing name for LabelSettings.font 2022-11-25 12:48:37 +07:00
kobewi d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +07: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 +07:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +07: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 +07:00
Marc Gilleron aed3822a93 Change return type of `get_configuration_warnings` to `PackedStringArray` 2022-09-19 16:43:15 +07:00
Hendrik Brucker 299585fcde Add configuration warning to GraphEdit regarding future refactoring 2022-09-14 18:09:21 +07: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 +07:00
kobewi b218727599 Rename raise() to move_to_front() 2022-09-06 22:13:06 +07:00
Maxim Kulkin 9a35ede23f Add GraphNode 'selected' and 'deselected' signals, simplify GraphEdit 2022-09-05 02:32:06 +07: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 +07: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 +07: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 +07: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 +07:00
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 +07: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 +07:00
SaracenOne 75f1357ced Add read-only mode to AnimationTreeEditor plugins 2022-08-25 16:29:36 +07: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 +07:00
kobewi 1abdffe7a0 Replace Array return types with TypedArray 2 2022-08-23 23:21:32 +07: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 +07:00
daylilyzeleen 64e33d9ed1 fixed GraphEdit signal argument type 2022-08-12 20:18:36 +07: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 +07: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 +07: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 +07:00
FireForge 97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 +07:00
FireForge 4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 +07:00
Hendrik Brucker c6a39cd952 Fix enclosed nodes calculation of GraphEdit comment nodes 2022-06-02 13:14:46 +07:00
Hendrik Brucker 70c234f3e3 Improve Graphedit connection lines 2022-05-30 17:33:01 +07:00
Hendrik Brucker 771cb1261a Improve and fix the GraphNode port hotzones
Co-authored-by: Ansraer <jacky2611@gmail.com>
2022-05-30 15:48:58 +07: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 +07:00
Aaron Record 900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +07:00
Yuri Rubinsky c84d050980 Add node list param to `GraphEdit::delete_nodes_request` signal 2022-05-17 13:28:21 +07: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 +07:00
reduz 8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +07: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 +07:00
Eric McGuirk b1441bbcfc Fix toggling GraphEdit's minimap with `minimap_enabled`
Fixes #53831.
2022-04-11 17:52:04 +07:00
kobewi b29aff8dac Fix GraphEdit's valid connections being reversed 2022-04-11 00:34:59 +07:00
Fazil Babu a3598b487a popup_request signal emits mouse click position 2022-03-12 14:00:04 +07:00
Rémi Verschelde 0f5455230c
Use `switch` consistently in `_notification` (`scene` folder) 2022-02-15 18:44:55 +07:00
Nathan Franke 8a0a3accee
simplify formatting scripts, add a clang-tidy script, and run clang-tidy 2022-01-29 04:41:03 +07:00
kobewi 98692d68c3 Minor tweaks and fixes to panning 2022-01-23 13:49:53 +07:00
kobewi 74bfe88267 Add ViewPanner to 2D editor 2022-01-21 18:35:06 +07:00
kobewi ba7ed05792 Unify panning in sub-editors and make it configurable 2022-01-11 13:57:19 +07:00
Rémi Verschelde c09c4e0154
Merge pull request #56575 from HaSa1002/drag-signal-began
Rename GraphEdit `connection_drag_begun` to `connection_drag_started`
2022-01-07 20:41:39 +07:00
Johannes Witt 4c5ceb1a97
Rename GraphEdit connection_drag_begun to connection_drag_started 2022-01-07 18:25:03 +07:00
Rémi Verschelde 6a27d7361a
Merge pull request #56321 from pycbouh/core-use-gdvirtual-everywhere 2022-01-07 16:14:28 +07:00
Johannes Witt 0505b08a56
Add `GraphEdit` drag notifications
This commit adds two signals:
 * connection_drag_begun, which is emitted when a connection is started
   to be created by the user and
 * `connection_drag_ended`, which is emitted when no longer a connection
   is created.

Additionally `force_connection_drag_end()` adds the possibility to end
the connection dragging. If called from user code, no other connection
request signals are invoked. This is useful to add `GraphNode`s via
shortcuts while the user is dragging a connection to directly connect
the newly added node.
2022-01-06 17:51:40 +07:00
Rémi Verschelde 8501233401
Merge pull request #56347 from NNesh/fix/graph_editor_out_of_range_alignment
Fixed an invalidation of sets and out of range for an alignment
2022-01-04 00:37:43 +07:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +07:00