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

Add preset saving and loading #44

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

Conversation

goonzoid
Copy link

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!

@neauoire
Copy link
Member

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

@goonzoid
Copy link
Author

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

@goonzoid goonzoid changed the title Add preset loading Add preset saving and loading Nov 12, 2019
@goonzoid
Copy link
Author

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.

@jakofranko
Copy link

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

@goonzoid
Copy link
Author

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.

@jakofranko
Copy link

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.

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.

3 participants