Skip to content

Fix InputMap load removing spatial_editor actions in editor #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

Cafezinhu
Copy link

Calling InputMap.load_from_project_settings() in addons/block_code/ui/picker/categories/category_factory.gd in the editor causes all spatial_editor actions to be lost, making it impossible to use first person camera controls in the 3D tab.

This pull request fixes #100 by re-adding all spatial_editor actions after calling InputMap.load_from_project_settings() and after adding all the Input actions to block_list, making sure they don't appear in the input blocks.

Copy link
Contributor

@manuq manuq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cafezinhu thanks for your contribution! I have tested here and it works for me. Honestly I only tried the BlockCode nodes in 2D scenes before.

if Engine.is_editor_hint():
var actions := InputMap.get_actions()
for action in actions:
if action.begins_with("spatial_editor"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cafezinhu are there other actions worth re-adding other than the ones beginning with "spatial_editor"?

@manuq manuq merged commit e3ae3ed into endlessm:main Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing a BlockCode breaks editor 3d first person navigation
2 participants