alexmoon / ksp

Kerbal Space Program Mission Plotter
Other
185 stars 75 forks source link

The origins list is now generated in coffeescript to allow dynamically adding bodies via the console #3

Closed ElvishJerricco closed 10 years ago

ElvishJerricco commented 10 years ago

For example, if you were using the Alternis mod and wanted to try the transfer from Kerbin to Laythe, you'd add new bodies in the console with this code and use them. Plus now there's potential for a UI for this.

CelestialBody.KerbinAlternis = KerbinAlternis = new CelestialBody(5.2915793e22, 600000, 21600, new Orbit(CelestialBody.Jool, 68506000, 0.02, 0.4, 0, 0, 270 * Math.PI / 180))
CelestialBody.LaytheAlternis = LaytheAlternis = new CelestialBody(2.9397663e22, 500000, 52980.879, new Orbit(CelestialBody.Jool, 27184000, 0, 0, 0, 0, Math.PI))
prepareOrigins()
alexmoon commented 10 years ago

I'm not sure how large the audience is for entering bodies via the console, but I'd be happy to merge this in if you could make the generated options and optgroups match the current format for consistency (i.e. Body followed by Body's Moons, instead of Body System followed by Body then Body's Moons).

ElvishJerricco commented 10 years ago

That's how I originally tried it, but I personally preferred this UI. I'll change it to that though.

tavert commented 10 years ago

I believe this change modified the default selection for Origin body from Kerbin to Moho. I don't know enough JS/CoffeeScript to find where to fix that...

alexmoon commented 10 years ago

Yes, it should be fixed now.

tavert commented 10 years ago

Awesome, keep up the great work. "Future plans," eh? Sounds exciting!