Begin refactor / rework of UI.

This commit is contained in:
Anna Rose 2021-07-22 22:29:18 +00:00
parent 41438700ad
commit c222f590e5

View File

@ -20,23 +20,16 @@ function launchButtonPressed {
set STEERINGMANAGER:MAXSTOPPINGTIME to oldStopTime..
}
function executeNode {
run "/rocket/execnode".
}
function showLaunchMenu {
stk:ShowOnly(launchMenu).
}
// Main UI.
local interface is gui(250, 300).
set interface:X to 200.
set interface:Y to 700.
// Main menu elements in here.
local box is interface:AddVLayout().
local y is interface:AddVLayout().
local x is y:AddHLayout().
local btn is box:AddButton("TERM").
local btn is x:AddButton("TERM").
set btn:TOGGLE to true.
set btn:ONTOGGLE to {
parameter activate.
@ -45,26 +38,31 @@ set btn:ONTOGGLE to {
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Open Terminal").
} else {
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal").
}
}
}.
set btn to box:AddButton("LAUNCH").
set btn:onClick to showLaunchMenu@.
set x:AddButton("CONF"):onClick to {
stk:ShowOnly(confMenu).
}.
set btn to box:AddButton("EXECNODE").
set btn:onClick to executeNode@.
set x to y:AddHLayout().
set x:AddButton("LNCH"):onClick to {
stk:ShowOnly(launchmenu).
}.
set x:AddButton("NODE"):onClick to {
run "/rocket/execnode".
}.
local stk is interface:AddStack().
// Launch menu
// Build launch menu
local launchMenu is stk:AddVLayout().
set btn to launchMenu:AddButton("Execute").
set btn:onClick to launchButtonPressed@.
local launchConfig is box:AddScrollBox().
// set launchConfig:STYLE:WIDTH to 300.
// set launchConfig:STYLE:HEIGHT to 800.
set sbox to launchConfig:AddHLayout().
sbox:AddLabel("Target Apoapsis").
@ -102,6 +100,11 @@ local maxStopTime is sbox:AddTextField("2.0").
// End Launch Menu
// Build conf menu
// end conf menu
interface:show().
wait until false.