Move GUI code.
This commit is contained in:
45
ui/rocket.ks
Normal file
45
ui/rocket.ks
Normal file
@ -0,0 +1,45 @@
|
||||
function launchButtonPressed {
|
||||
run "launch"(
|
||||
targetApo:TEXT:ToNumber(),
|
||||
gravTurnStart:TEXT:ToNumber(),
|
||||
initialPitch:TEXT:ToNumber()
|
||||
).
|
||||
}
|
||||
|
||||
function nodeButtonPressed {
|
||||
run "executenode".
|
||||
}
|
||||
|
||||
// Button panel
|
||||
CreateGUI().
|
||||
|
||||
local interface is gui(200).
|
||||
set interface:X to 200.
|
||||
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@.
|
||||
|
||||
local nodeButton is interface:AddButton("Execute Node").
|
||||
set launchButton:onClick to nodeButtonPressed@.
|
||||
|
||||
interface:show().
|
||||
|
||||
wait until false.
|
Reference in New Issue
Block a user