kOS/os/rocketos.ks

37 lines
861 B
Plaintext

function launchButtonPressed {
run "launch"(
targetApo:TEXT:ToNumber(),
gravTurnStart:TEXT:ToNumber(),
initialPitch:TEXT:ToNumber()
).
}
// Button panel
local interface is gui(200).
set interface:X to 150.
set interface:Y to 900.
// Launch button
local hBox is interface:AddHBox().
hBox:AddLabel("Initial Pitch").
local initialPitch is hBox:AddTextField("85").
local hBox is interface:AddHBox().
hBox:AddLabel("Gravity Turn @").
local gravTurnStart is hBox:AddTextField("8000").
local hBox is interface:AddHBox().
hBox:AddLabel("Gravity Pitch").
local gravPitch is hBox:AddTextField("75").
local hBox is interface:AddHBox().
hBox:AddLabel("Target Apoapsis").
local targetApo is hBox:AddTextField("80000").
local launchButton is interface:AddButton("Launch").
set launchButton:onClick to launchButtonPressed@.
interface:show().
wait until false.