derkork / godot-statecharts

A state charts extension for Godot 4
MIT License
761 stars 39 forks source link

GUI editor support, add many state nodes quickly #7

Closed folt-a closed 1 year ago

folt-a commented 1 year ago

Hi.

Thank you for this wonderful addon!

Are you planning to add an editor GUI Editor support that creates many State&Transition nodes?

I want to create State&Transition nodes quickly because complex state management requires many nodes.

I have created and used a feature like this editor addon codes.

https://github.com/folt-a/godot-statecharts/tree/editor_add_node_buttons

https://user-images.githubusercontent.com/32963227/232418419-4b16055f-0bae-40dd-9caa-62652124427a.mp4

1647224978197319681-img1

1647224978197319681-img2

if you are already planning to add a similar feature, please ignore this Issue and close it!

derkork commented 1 year ago

Hey Folt-a, this looks really neat! I'll check out your branch and add this to the library. If you find the time you can also send a PR for this. どうもありがとうございます!

derkork commented 1 year ago

I merged this. I have removed the "rename" feature as it does not fix the names in the transitions which the built-in rename does. I think using the built-in rename is fast and easy enough in this case and there is no need to recreate this in the addon. I also did a slight modification of the UI so you can now press Shift when clicking to move the selection to the node you just created. This way you have more control over the parent node to which new nodes are added. I also auto-focus the name edit after clicking so you can directly type the next name and I added support for undo/redo for quickly fixing mistakes.

Thanks again for this nice contribution!