Skip to content
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

Implement export/import functionality for custom input actions #84902

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ZycaR
Copy link

@ZycaR ZycaR commented Nov 14, 2023

Input Action Map - Import / Export feature
image

Actions:
Import Custom Actions -> Pick file (previously exported of project.godot file) to import custom actions or merge additional actions into existing set.
Export Custom Actions -> Export user defined actions into text file.
Remove Built-in Action -> This action remove all 'key' events from build in actions.
Restore Built-in Action -> Reset build-in actions to default deadzone (0.5) and 'key' events.

UI Update:
Move Show Built-in Actions into threedot menu.
image

@AThousandShips
Copy link
Member

Please open a proposal when making new features, to gauge the need and popularity of a proposed feature

@ZycaR
Copy link
Author

ZycaR commented Nov 14, 2023

Please open a proposal when making new features, to gauge the need and popularity of a proposed feature

Proposal created (I hope it will not be a problem as it is an Issue not the 'discussion' ... there are no other options)
godotengine/godot-proposals#8433

@ZycaR
Copy link
Author

ZycaR commented Nov 14, 2023

Update:
Proposal was merged with godotengine/godot-proposals#423.

@Calinou, @AThousandShips - this means green light or should I still wait for approval of proposal #423?

@AThousandShips
Copy link
Member

AThousandShips commented Nov 14, 2023

Proposals don't really get the green light like that, all we really give is "we'd like to see this", it's all down to the PR, the only thing is that a proposal can be turned down due to lack of interest or being incompatible

@MMUTFX2053
Copy link

a "clear defaults" button to clear all the build in default inputs would also be useful, i often end up deleting them 1 by 1

@golddotasksquestions
Copy link

Thank you for this PR!

If you want to add more functionality like the clear default button as @MMUTFX2053 suggested, it might be better to move these buttons (Import Actions, Export Actions, Delete Default Actions) under a vertical three dot dropdown menu like in other areas of the editor to show additional options.

three_dot_options.mp4

@ZycaR
Copy link
Author

ZycaR commented Nov 20, 2023

Thak you for feedback. Here is updated ui with tree dot menu (also I moved show defaults):
image

image

EDIT: I'm not sure about "Reset Built-in Actions", should I use "Restore Built-in Actions" or reset is descriptive enough?

@MMUTFX2053
Copy link

MMUTFX2053 commented Nov 20, 2023

@ZycaR i think "restore built-in actions" is more descriptive

@ZycaR
Copy link
Author

ZycaR commented Nov 20, 2023

Update:
Remove Built-in Action events -> This action remove all 'key' events from build in actions.
Restore Built-in Action events -> Reset build-in actions to default deadzone (0.5) and 'key' events.

image

Question:
Is there a chance that list of built-in actions (ui_accept, ui_select, ...) will be modified during running of godot editor? I dig a bit in code and looks like editor does not count with alteration of list of built-in actions .. only 'key' events and deadzone value.

@ZycaR ZycaR marked this pull request as ready for review November 21, 2023 00:23
@ZycaR ZycaR marked this pull request as draft November 21, 2023 00:23
@ZycaR ZycaR marked this pull request as ready for review November 21, 2023 00:47
@ZycaR
Copy link
Author

ZycaR commented Nov 21, 2023

I hope the Pull Request is ready for review! Does the editor have unit tests?

@YuriSizov YuriSizov changed the title Input Action Map - Import Export Implement export/import functionality for custom input actions Nov 21, 2023
@YuriSizov
Copy link
Contributor

Does the editor have unit tests?

You can add them if you have an idea how to test this for regression.


Also make sure to check the CI reports, you have codestyle issues which need to be fixed before the full CI suite can run: https://github.com/godotengine/godot/actions/runs/6937666541/job/18883753525?pr=84902

@ZycaR
Copy link
Author

ZycaR commented Nov 21, 2023

@YuriSizov - builds are green ... finally :)

@golddotasksquestions
Copy link

I don't know about others, but I personally always toggle the "show built in actions" whenever I start a new project. Since I always add to those default actions.
For me this is so common thing to do to warrant the "show built in actions" staying outside the three dot dropdown.

The "Add new action" box is also incredibly large, and the "Add" Button all the way to the right, so I think there is enough space to have and keep the "show built in actions" there as it is right now. What do you think?

@ZycaR
Copy link
Author

ZycaR commented Dec 8, 2023

I don't know about others, but I personally always toggle the "show built in actions" whenever I start a new project. Since I always add to those default actions. For me this is so common thing to do to warrant the "show built in actions" staying outside the three dot dropdown.

The "Add new action" box is also incredibly large, and the "Add" Button all the way to the right, so I think there is enough space to have and keep the "show built in actions" there as it is right now. What do you think?

We can keep the switch there if it is desirable. I'll also include it in tree-dot menu to have this options together with new remove/restore built in actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement saving and loading the Input Map from within the Project Settings
5 participants