Godot-proposals: Implement saving and loading the Input Map from within the Project Settings

Created on 31 Jan 2020  路  6Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
I constantly create small minimal projects if I want to try a specific feature/mechanic first before implementing it into my main project, if I discover a bug and need to report it, if I want to help someone out in the community channels. Sometimes one or two a day.

Describe the problem or limitation you are having in your project:
Everytime I create a new project, I have to set all custom Input map actions again. Any single action usually has 3 to 4 Inputs. In 95% these are the same every time - joypad, keyboard, mouse. It feels like a massive chore and waste of time. I'd much rather rename or delete what I don't need than create everything.
It would also make it easy to share Input Maps.

Related: https://github.com/godotengine/godot/issues/29358

Describe how this feature / enhancement will help you overcome this problem or limitation:
If I could click "load", select a config file or whatever and be done with it, instead of doing the same process over and over again, I would be a much more zen person.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Load-save-inputmap

Describe implementation detail for your proposal (in code), if possible:
Clicking on "Save" would open a prompt asking to select a place and a name to save the simple text config file. (res:// by default)
Clicking on "Load" would open a prompt to browse to the place to select the Input Map config file. (res:// by default)
When starting a new project, I imagine all I'd have to do is to copy the InputMap config file I saved in my previous project into res:// of my new one and load it, or even simpler have a common place outside of res:// and just load it from there.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
It would be used a lot by anyone creating small test projects, teachers, people testing things in the engine ...

Is there a reason why this should be core and not an add-on in the asset library?:
I think this should be build into the engine as it would speed up workflow quite a lot for people who create a lot of projects.

editor

Most helpful comment

@KoBeWi A lot of things are stored this way, importing and exporting the InputMap would allow to import and export _only_ the InputMap. I can see this be useful.

All 6 comments

Wouldn't it make more sense to allow saving and loading input map files from anywhere on the filesystem, not just res://?

Wouldn't it make more sense to allow saving and loading input map files from anywhere on the filesystem, not just res://?

Yes absolutely, that's what I meant with "select a place".
res:// just being the default.

I'm adding a menu and an option to restore default here https://github.com/godotengine/godot/pull/31815

It could help to put the option to import / export in there.

InputMap is stored in your project, so you just need a "template" project.godot with InputMap configured and just copy it when you want to create a new project.

@KoBeWi A lot of things are stored this way, importing and exporting the InputMap would allow to import and export _only_ the InputMap. I can see this be useful.

@KoBeWi That's a good tip if you'd want to copy more than just the Input map. Thx!

Was this page helpful?
0 / 5 - 0 ratings