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