taniwha / Extraplanetary-Launchpads

GNU General Public License v3.0
53 stars 45 forks source link

KSP 1.10 support, kOS compatibility adjustment, EL build window GUI recovery #159

Closed peter-sibiro closed 4 years ago

peter-sibiro commented 4 years ago

This pull request contains 3 adjustments, one per commit.

1) OnConfigNodeSelected callback for the compatibility with KSP 1.10. I only tested it on 1.10 and I'm not sure at all how this will work in KSP 1.9.x.

2) I found that if something wrong (exception) happens during Craft loading and parsing (inside LoadCraft) the GUI ends up being in State.Planning without other things properly set up. This leads to the window becoming unusable, player cannot even close it. The try-catch with state reverting should allow the mod to recover from at least some kinds of exceptions during the load.

3) kOS compatibility fix. Added the check to remove kOS modules during "virtual spawn" inside getBuildCost method. kOSProcessor module triggers OrbitDriver and cause "virtual vessel" despawn before cost is calculated. No actual dependency from kOS was introduced, of course.

peter-sibiro commented 4 years ago

Nevermind. Endless log spam in the Editor was due to my stupid debug logs. Without them, EL info window works fine in KSP 1.10!

(These debug things were not included into pull request, so it should be all good)

taniwha commented 4 years ago

A few little things but overall pretty good. I very much appreciate your work.

peter-sibiro commented 4 years ago

@taniwha I've updated the code according to our discussion.

I was doing some checks and noticed a couple of things. I'm not sure whether those were introduced by my changes or it was before too. If I load the craft when another one was already loaded, the GUI is not updated properly - the name is changed, but the parts list is still from the previous craft. I will review further.

taniwha commented 4 years ago

Thank you :)