Commit Graph

315 Commits

Author SHA1 Message Date
Serhii Snitsaruk 50e9e570dd
Fix loop variables used as copy 2024-09-15 13:32:58 +02:00
yds 4df6647a75 Improve multiple drag and drop 2024-09-14 11:22:52 -03:00
yds 1742018696 Preserve selection after drop 2024-09-13 09:04:18 -03:00
yds a460c7898b Add drag preview 2024-09-13 09:04:18 -03:00
yds 8ee3688da2 Implement task multiple selection and drag and drop 2024-09-13 09:04:18 -03:00
Alexander Montag ad11f401b1 Generalize EDITOR_DEF macro to fix potential editor setting issues
This commit provides a generalized solution to ensure editor settings are
properly initialized and available in both module and GDExtension versions.
While #204 fixed the specific issue with 'limbo_ai/editor/layout', this change
aims to prevent similar problems for all editor settings.

In particular, `limbo_ai/editor/prefer_online_documentation` was also not
available.

Changes:
- Updated EDITOR_DEF macro to handle both module and GDExtension cases
- Remove special case for `limbo_ai/editor/layout` in
  LimboAiEditorPlugin from earlier fix.
2024-09-03 16:37:54 +02:00
Alexander Montag a5517313d2 Fix editor setting initialization for GDExtensions
This commit addresses an issue where editor settings were not properly
initialized when using GDExtensions. The problem manifested as an error
message: "Condition '!props.has(pinfo.name)' is true" when trying to
access the "limbo_ai/editor/layout" setting.

Changes:
- Replace Dictionary with PropertyInfo for adding property information
- Add a safeguard to ensure the setting is explicitly set if not present
2024-09-02 10:27:22 +02:00
Serhii Snitsaruk 9da16a1e0f
Clean up unused string names 2024-08-21 20:04:35 +02:00
Serhii Snitsaruk 472f360cf9
Switch to contextual behavior tree upon undo action 2024-08-21 17:30:30 +02:00
Serhii Snitsaruk c94ec7613d
Add hack to associate undo-redo actions with global history 2024-08-21 16:40:02 +02:00
yds 410efbe0d3 Fix tab names doesn't update when filesystem changes 2024-08-10 11:29:22 -03:00
yds 1b04a8589f Make player filter in the debugger case-insensitive 2024-08-06 16:34:06 -03:00
Serhii Snitsaruk c19fd54927
Edit task script on double-click (open help for core task) 2024-08-05 16:34:54 +02:00
Serhii Snitsaruk 5a4893fc53
Editor setting to prefer online docs, and open builtin docs by default 2024-08-05 15:46:02 +02:00
Serhii Snitsaruk 68a9492f3d
Fix uninitialized integers 2024-08-03 13:48:15 +02:00
Serhii Snitsaruk c4c9b5fe09
Utilize BTInstance in BTState 2024-08-03 11:39:23 +02:00
Serhii Snitsaruk fc26f51ff2
Implement BTInstance - runtime instance of BehaviorTree 2024-08-03 11:07:06 +02:00
yds 3e5e34f5f8 Fix new task script path don't update after changing the setting 2024-07-10 13:23:48 -03:00
Serhii Snitsaruk 5f40d38f8d
Add a hack to force documentation parsing on user scripts
As things currently stand in Godot Engine, documentation comments are
not loaded from user scripts into help system when the project is
started. This leads to empty tooltips for user tasks in LimboAI, unless
such a script is resaved.

This hack forces script documentation to be added to help system,
when the editor needs it to show a tooltip.
2024-07-07 12:13:07 +02:00
Serhii Snitsaruk 800bc8f16d
Tooltip improvements
- Fix tooltip not shown for scripted tasks in TaskPalette
- Allow following links in the tooltip text
- If help data cannot be found, an empty tooltip is shown instead
2024-07-06 16:46:55 +02:00
Serhii Snitsaruk 40acd04eb9
Fix tooltip popup too small 2024-07-06 12:33:08 +02:00
Serhii Snitsaruk f1af947060
Defer banner actions to not crash upon restart 2024-07-06 12:13:58 +02:00
Serhii Snitsaruk 254a9ca943
Merge pull request #157 from limbonaut/task-palette-placement
Improved layout for wide displays (optional)
2024-07-06 10:08:01 +02:00
Serhii Snitsaruk bc99965205
Fix compilation with GDExtension 2024-07-06 09:46:22 +02:00
Serhii Snitsaruk cfa1f70d79
Update banners upon editor settings changed 2024-07-06 09:38:33 +02:00
Serhii Snitsaruk 7c0d49bafa
Reparent banners if using new layout 2024-07-06 09:29:09 +02:00
Serhii Snitsaruk da9d80d110
Add Misc->Layout options 2024-07-06 09:18:50 +02:00
Serhii Snitsaruk 4787413cb6
Add header to the sidebar 2024-07-05 20:49:16 +02:00
Serhii Snitsaruk 2813728785
Fix connected signal error when loading BT for the second time 2024-07-05 20:32:53 +02:00
Serhii Snitsaruk 2973590533
Flip split offset setting if editor layout changed 2024-07-05 17:53:35 +02:00
Serhii Snitsaruk b74f664da6
Fix compilation issue with GDExtension 2024-07-05 17:24:32 +02:00
Serhii Snitsaruk 7baa395d3f
Rename to editor_layout 2024-07-05 17:02:29 +02:00
Serhii Snitsaruk 7d6cc1a828
Editor: Adjust layout to work better with task palette on the left 2024-07-04 21:16:35 +02:00
Dave Palais 4cba3b39db Replace deprecated set_auto_translate call with set_auto_translate_mode 2024-07-02 12:50:56 -05:00
Serhii Snitsaruk 872f7a4532
Editor: Add setting for task palette placement 2024-07-02 11:55:22 +02:00
Wilson E. Alvarez d2ca303c5e
Fix List<T> access
Due to upstream change:

	955d5affa8
2024-06-29 14:52:05 -04:00
Wilson E. Alvarez d20d28be78
Update EditorPlugin header location
Due to upstream change:

	1bcbbe96c4
2024-06-29 14:52:05 -04:00
Wilson E. Alvarez 2f1fd6fb62
Update EditorHelpBit calls
Due to upstream change:

	a714cb9f65
2024-06-29 14:52:05 -04:00
Wilson E. Alvarez 022d95434d
Add missing MarginContainer header
Due to upstream change:

	7884d63281
2024-06-29 14:52:05 -04:00
Wilson E. Alvarez ce28ed92d2
Fix bottom panel visbility calls
Due to upstream change:

	eb6ca91ba6
2024-06-29 14:52:05 -04:00
Wilson E. Alvarez 8f294ac5ea
Migrate to Tree::set_custom_draw_callback
Due to upstream change:

	a32a2eaedc
2024-06-29 14:52:05 -04:00
Wilson E. Alvarez 9410031d45
Fix upstream EditorScale header locations
Due to upstream change:

	4b55c81eba
2024-06-29 14:52:05 -04:00
Serhii Snitsaruk c76278b735
Fix task tree warnings column always taking up space 2024-06-10 08:26:18 +02:00
Serhii Snitsaruk d6076d131f
Fix folding/unfolding selected composite task is not working 2024-06-06 12:58:18 +02:00
Serhii Snitsaruk 3bca05bc50
Fix crash on adding a task with bad script base type and improve error handling 2024-06-02 21:58:50 +02:00
Serhii Snitsaruk 29532113c0
Change to typed array in `BlackboardPlan::list_vars` 2024-05-31 11:57:27 +02:00
Serhii Snitsaruk a04d4aaca4
Show version info in the editor
- Version is set in `limboai_version.py` file and hash is taken from GIT on build.
- Click to copy version info into clipboard.
2024-05-30 16:03:05 +02:00
Serhii Snitsaruk c9825413c0
Add shortcut for "Close Tab" and clean up input code 2024-05-29 19:13:57 +02:00
Serhii Snitsaruk 990438db55
Handle built-in resources in "Jump to owner" tab action 2024-05-29 18:27:55 +02:00
Serhii Snitsaruk 2b299c0007
Accept Ctrl-J when LimboAI editor is visible and fix shortcuts not working sometimes 2024-05-29 11:58:59 +02:00
Serhii Snitsaruk 88e468c526
Editor: Add Ctrl+J shortcut for "Jump to Owner" tab action 2024-05-29 11:18:11 +02:00
Serhii Snitsaruk a0cd983927
Editor: Fix "jump to owner" from subtree and refactor 2024-05-29 10:53:54 +02:00
Serhii Snitsaruk 792502db84
Editor: Add tab context menu option "Open owner scene" 2024-05-28 21:16:26 +02:00
Serhii Snitsaruk fa3034d190
Remove old editor navigation code 2024-05-28 12:04:02 +02:00
Serhii Snitsaruk 9e0489a034
Editor: Tab button to inspect blackboard plan 2024-05-28 11:16:37 +02:00
Serhii Snitsaruk a7d4b1e7f7
Editor: Use the full name for tabs if the short name is not unique 2024-05-28 09:46:21 +02:00
Serhii Snitsaruk 127fa678f4
Editor: Add tab context menu 2024-05-27 16:53:44 +02:00
Serhii Snitsaruk e0d47ddf08
Fix closing last tab leads to crash on exit 2024-05-27 15:36:17 +02:00
Serhii Snitsaruk 57382e10a7
Editor: Show full filename in tabs for BTs saved as built-in resources 2024-05-27 15:06:35 +02:00
Serhii Snitsaruk 0a28feb7a9
Fix GDExtension compilation issues 2024-05-27 14:27:14 +02:00
Serhii Snitsaruk 6f8f95b5de
Editor: Replace BT resource button with tabs 2024-05-27 13:48:08 +02:00
Serhii Snitsaruk 064d00fdfa
Editor: Check if variable is of correct type for BBParam subtypes 2024-05-18 14:12:00 +02:00
Serhii Snitsaruk 7ab7a9d098
BlackboardPlan: Improve inspector update while manually typing in mappings
Fixes property glitches observed while a map variable is typed in.
2024-05-17 21:54:50 +02:00
Serhii Snitsaruk b54f3696ff
Fix crash upon adding variable in the plan editor with empty default name
Also default to float when expected type is not specified.
2024-05-17 11:08:58 +02:00
Serhii Snitsaruk 026272f7f7
Fix BBParam subtypes incorrectly display type error in inspector 2024-05-17 10:27:22 +02:00
Serhii Snitsaruk 2718271bb1
Clean up & renames 2024-05-15 20:43:24 +02:00
Serhii Snitsaruk c6b1a40627
BlackboardPlan: Update inspector upon mapping editing finished 2024-05-15 12:52:50 +02:00
Serhii Snitsaruk a572613001
BlackboardPlan: Utilize mapping in LimboHSM
Also changes how parent plan providing is implemented (used for editor hints).
2024-05-15 11:38:53 +02:00
Serhii Snitsaruk c30c5a4d7a
BlackboardPlan: Auto-fill type info when adding a missing variable for a mapping 2024-05-14 22:55:25 +02:00
Serhii Snitsaruk e43bc25d82
BlackboardPlan: Provide editor hints for mappings 2024-05-14 13:29:04 +02:00
Serhii Snitsaruk 7f89659110
Support multiple debugger sessions 2024-04-21 13:04:16 +02:00
Serhii Snitsaruk 12fd9d00d6
Update file headers and fix whitespace 2024-03-21 21:38:57 +01:00
Serhii Snitsaruk 79d72c39e0
Use proper icon in inspector for BB vars 2024-03-20 17:42:04 +01:00
Serhii Snitsaruk 5a8fe97aac
Fix error when clicking resource header in debugger with a scene-embedded BT 2024-03-20 14:19:49 +01:00
Serhii Snitsaruk 39c4511249 BBParam editor: Combine type+mode functionality in one button
Previously, we had two buttons: "mode switch" and "type choice".
Now replaced with the One Button to rule them all!
2024-03-12 18:10:53 +01:00
Serhii Snitsaruk b09006a11b Fix issues with blackboard plan system 2024-03-11 18:58:40 +01:00
Serhii Snitsaruk b90b85f0c3
Merge pull request #68 from Rubonnek/fix-btview-update-crash
Fix `BehaviorTreeView::update_tree` null data crash
2024-03-07 20:32:58 +01:00
Wilson E. Alvarez dd837ff472
Fix BehaviorTreeView::update_tree null data crash 2024-03-07 11:50:34 -05:00
Wilson E. Alvarez 3f34e4dde2
Expose BehaviorTreeView::clear to GDScript 2024-03-07 11:39:53 -05:00
Serhii Snitsaruk 2658060b1c Move prefetching code into `BlackboardPlan` and add checkbox to the plan editor 2024-03-06 21:28:06 +01:00
Serhii Snitsaruk 4c26583007 Remove "p_" from the argument names in the `ClassDB` bindings 2024-03-04 21:36:16 +01:00
Serhii Snitsaruk bea25049a0 Update plan editor utilizing `StringName` 2024-03-04 18:06:59 +01:00
Serhii Snitsaruk 84aeb4bfff Adjust BB variable property editor to expect `StringName` 2024-03-04 15:09:15 +01:00
Dave Palais 73aa636271 Change some includes to use relative paths
The paths before assumed we were inside the Godot modules folder.
This change enables building as an external module.
2024-03-02 18:10:00 -05:00
Serhii Snitsaruk 7626c84633 New `task_selected` signal for BehaviorTreeView 2024-02-29 23:42:24 +01:00
Serhii Snitsaruk 78c61d459d
Merge pull request #42 from limbonaut/debugger-improvements
Debugger improvements
2024-02-17 15:35:09 +01:00
Serhii Snitsaruk b3380bd0ac Fix missing break in a switch 2024-02-17 15:15:20 +01:00
Serhii Snitsaruk ecf44e83e0 Debugger: Add update interval controls and keep it in the config
Also fix bug with partial update.
2024-02-17 14:56:19 +01:00
Serhii Snitsaruk b9cd31eb2b Debugger: Add BehaviorTreeView::update_interval_msec property 2024-02-17 13:40:53 +01:00
Serhii Snitsaruk 0ea8b9932c Debugger: Implement selective tree update in BehaviorTreeView
Flame graph showed performance bottleneck with recreating and redrawing the whole tree each frame.
This commit should improve debugger performance by a good margin.
2024-02-17 11:43:31 +01:00
Wilson E. Alvarez 1711cb6b87
Fix crash upon increasing TypedArray<BBVariant> size
Needed after upstream patch:

db7175458a
2024-02-16 10:46:42 -05:00
Serhii Snitsaruk 654eda1c65 Better error handling when resolving _generate_name 2024-02-10 15:05:50 +01:00
Serhii Snitsaruk d38e6f97f1 Editor: Implement Cut-Copy-Paste
Resolves #14
2024-02-08 17:16:26 +01:00
Serhii Snitsaruk 6405f9031b Fix shortcuts not working in the module version
Resolves #27
2024-02-07 12:36:59 +01:00
Serhii Snitsaruk 16840057a1 Editor: More space and align to right for BehaviorTreeView timings 2024-02-06 15:44:25 +01:00
Serhii Snitsaruk a353e561de Editor: More space for timings in BehaviorTreeView 2024-02-06 14:54:18 +01:00
Serhii Snitsaruk d0c7d98fc4 Editor: Clip content in BehaviorTreeView 2024-02-04 16:23:15 +01:00
Serhii Snitsaruk 8dc645c9a7 Fix issues and update docs for BehaviorTreeData/View 2024-02-03 17:53:12 +01:00
Serhii Snitsaruk c5b92aa676 Expose BehaviorTreeView for tools and in-game use 2024-02-03 16:59:51 +01:00
Serhii Snitsaruk 3e32051791 Editor: Remember collapsed items in task tree 2024-02-02 16:46:26 +01:00