Pilot icon indicating copy to clipboard operation
Pilot copied to clipboard

Add preset saving and loading

Open goonzoid opened this issue 4 years ago • 6 comments

I'm planning on using Pilot for some new projects, and having the ability to save and load presets will be really useful for me, so I started trying to add the functionality.

So far I have basic preset loading working okay. As you can see, it simply loads Pilot commands from a text file and runs them. I haven't written any javascript for about 6 or 7 years, so please forgive me if I did anything weird. Happy to change anything about the implementation if you have any feedback.

Am planning on trying to add preset saving tomorrow, which I expect will be a bit more work. I thought it would be worth opening a PR now to start a conversation about this, and to see if you're even open to including this functionality in Pilot.

Please let me know what you think. Thanks!

goonzoid avatar Nov 10 '19 06:11 goonzoid

It's a good idea :) Ideally this would use source.js to handle loading/saving of the preset data.

neauoire avatar Nov 11 '19 01:11 neauoire

Okay, I'll take a look at that. Thanks!

goonzoid avatar Nov 11 '19 05:11 goonzoid

I've now implemented both saving and loading of preset files. I used lib/source.js from Orca, but had to make a small change to export Source so that it could be imported as a module in pilot.js. I guess this wouldn't be necessary if app initialisation was done in the same way as it is in Orca, but that seemed like a bigger change that I didn't want to do without you confirming that it's what you wanted.

Let me know if there are other changes that you'd like to see. As I mentioned before, I haven't written any javascript for a very long time, and this is my first time touching Electron, so I'm sure I made some odd choices.

goonzoid avatar Nov 12 '19 05:11 goonzoid

Hey there, I'm not sure if @neauoire is still maintaining this, but feel free to make a PR to my fork of Pilot! I'm wanting to make a few improvements and update the dependencies and such, so maybe we can work there till this gets picked up again? https://github.com/jakofranko/Pilot

jakofranko avatar Feb 13 '22 16:02 jakofranko

Cool! I should have some time next month to take a look at this again. I haven't been using Pilot much recently, but I'd like to change that.

goonzoid avatar Mar 25 '22 18:03 goonzoid

Awesome! @ondras has already put his PR over there and I've updated to Electron v17. Let me know if you need another set of eyes, I'd be happy to take a look at your code if you run into issues.

jakofranko avatar Apr 01 '22 02:04 jakofranko