AnthonyMichaelTDM / DRG-Save-Editor

Rock and stone!
GNU General Public License v3.0
115 stars 17 forks source link

Refactor godclass into components #89

Closed simon-wg closed 4 months ago

simon-wg commented 4 months ago

Only a rough draft so the progress can be checked while it's still being worked at.

Please give feedback, since it's such a large file it's very likely that I'm missing things.

Deals with #75

simon-wg commented 4 months ago

I've tried it out and it seems like the save data didn't get corrupted at least, so probably nothing that's broken yet(?)

simon-wg commented 4 months ago

I'm still not a big fan of how the StateManager does so much still, but it's a start on moving things away from main at least.

AnthonyMichaelTDM commented 4 months ago

looking good so far, I'll do a more in depth review as this get's closer to completion.

wahlp commented 4 months ago

when will this be considered finished?

simon-wg commented 4 months ago

I've been a bit busy with work so I've put this on the backburner, however once I've got a better way to handle the OC's I would consider it at least ready for merging.

We would probably still need more work after that with splitting it into further parts.

wahlp commented 4 months ago

i've got time to help, but i don't want to step over what you've already got in progress.

is there anything i can help out with?

simon-wg commented 4 months ago

Please feel free! Regarding oc's I've pretty much got them under control, but one thing that you could look at would be separating the actual writing of the save file from the main file into a new component.

That, and the StateManager itself could use some work in getting split into even smaller components imo.

wahlp commented 4 months ago

i have slaughtered the 200+ line beast that guarded file writing.

also a bit of cleanup in main.

simon-wg commented 4 months ago

Right now I'm taking the shotgun approach to moving all the ocs, there is a high risk of some functionality breaking here, so feel free to sanity check me if I've just removed something.

wahlp commented 4 months ago

i think you meant to call Stats.get_overclocks() under Stats.get_initial_stats(), right now it's not being called anywhere

simon-wg commented 4 months ago

You're right! Should be fixed now along with the type hinting that's being a bother

simon-wg commented 4 months ago

nvm... I'm just adding # type : ignore for it at this point, since it's guaranteed that the keys are the same

wahlp commented 4 months ago

there's an error when processing cosmetic overclocks found in the save data.

while trying to find the cause, i noticed that there was a nesting issue that unintentionally looped code that was not supposed to be looped.

i fixed both of those problems

wahlp commented 4 months ago

i think it's just about finished. adding/removing overclocks works fine, haven't found any save-resetting errors

simon-wg commented 4 months ago

Thanks for the help! Opened the PR now.

simon-wg commented 4 months ago

@AnthonyMichaelTDM