AlyxMoon / lunar-factorio-mod-manager

A mod manager for Factorio, programmed using the Electron framework.
MIT License
6 stars 2 forks source link

electron-json-storage integration #83

Closed Danacus closed 7 years ago

Danacus commented 7 years ago

I've successfully integrated electron-json-storage. I've used promises, because electron-json-storage is async. Promises are better than callbacks, because you can avoid a "callback hell" (llike this: https://www.reddit.com/r/ProgrammerHumor/comments/5un65s/it_took_some_time_to_fix_this/) and it has a nice error handling system. If you need more information about promises, you can ask me, it's very easy to use.

It does save config files even when using a compiled asar archive, but it can't toggle mods, because you haven't finished the react client rendering yet (don't worry, I didn't touch the front-end code).

Danacus commented 7 years ago

I'm helping you with the front-end react code, I'm doing it slowly and carefully and I trying to learn how it works. I understand the actions system and I made the start factorio button work again.

Danacus commented 7 years ago

I'm having some trouble with the toggle mod system. I updated some things in ProfileManager.toggleMod, but I don't know what's the proper way to do it.

Danacus commented 7 years ago

Seems to be a problem with 'true' vs true and 'false' vs false

Danacus commented 7 years ago

It works now, but appears that if you don't wait 5 seconds before reopening the app after closing it, the config files get corrupted. I'm still investigating the problem. Edit: forget about the 5 seconds thing, it just randomly corrupts the config files for some reason Edit 2: It becomes more stable when I close the log file and mod list file in the editor. Everything works perfectly, but on random moments, the config file from electron-json-storage is undefined.

AlyxMoon commented 7 years ago

So about pulling in other branches, I think it's best to keep a focus on the branch you're working on.

In this case, think of develop as the primary branch, where all branches come from and eventually go to. Unless it's a primary branch, generally a branch is worked on by a single developer and merged separately​ onto a primary branch. It's easier to handle things that way.

With the json-storage thing, the only files needing changes would be in the lib folder (appManager and profileManager I think), and the branch for that feature should only include those changes. Then when the react/redux branch is finished, that will merge into develop as well. In the event problems do arise between the two, that's the appropriate place to handle changes.

You've pulled in my half-finished branch, which will make things a bit weird when I finish it and merge it in to develop.

In short, can you take out everything unrelated to implementing electron-json-storage out of this branch before making another pull request?

And I'm happy for you to help with things but to be just a bit selfish, this little pet project is still my baby, I'd appreciate finishing up my own branch.

Danacus commented 7 years ago

I fixed it!!!! I forgot to wait until electron-json-storage was finished saving the config files before quitting the app

Danacus commented 7 years ago

Ok, I'll do that

Danacus commented 7 years ago

Sorry, this is taking very long, I feel like I'm screwing everything up

Danacus commented 7 years ago

Sorry for the weird things I did, but now I understand what you mean with the primary branch concept

AlyxMoon commented 7 years ago

No worries about any issues, I've been inconsistent with the project myself so I feel weird telling you off, but with two developers now's the time to do things right! And don't sweat how long you take to do something, it's personal time so there's no rush. I'll work on a contribution guide to point out some ways I'd like to do things if I'm going to be picky about it.