blackears / cyclopsLevelBuilder

A Godot plugin to let you block in levels inside the Godot editor.
MIT License
920 stars 36 forks source link

Shortcut keys #178

Closed diklor closed 3 weeks ago

diklor commented 3 weeks ago

Simple plugin to manage shortcuts. The changes are indicated with the README.md, there are few of them keys

blackears commented 3 weeks ago

This PR as it is will delete most of the project. Could you describe how exactly you are planning to implement this?

I do plan to add support for hot keys eventually, but I have a big redesign of the user interface planned which will likely conflict with the changes you are submitting. I think it would be best to not work on this issue for now unless your fix is really minimal.

diklor commented 3 weeks ago

Yeah, sorry about that. I want to make a normal pull today, there were some problems with the versions I have almost all my files replaced.

So I'm adding parameters input_events: Array[InputEvent] = [] and input_events_override: bool = false (To override WASD keys) to the tool_tag class. In the editor_toolbal.gd script in build_ui() func when loading buttons through a loop with these ToolTags these InputEvents are loaded into the Shortcut if there is no input_events_override, otherwise in to a special dictionary. The _input() function works with this dictionary and checks the events and whether the button of this event is found (by name) and calls button.pressed.emit(). Input does not check whether you are moving in 3D on by keys WASDQE but it checks if you are on the 3D tab and it's still very convenient for me to work this way. I also indicated the changes in the readme file, what's new and what's changed

diklor commented 3 weeks ago

I made a normal commit 😀

blackears commented 3 weeks ago

I just noticed the line for v: InputEvent in tag.input_events:. Is this PR compatible with Godot 4.2.1?

diklor commented 3 weeks ago

Yes, since 4.2