From c222f590e5b0d4d0e6bfdb8313fc6c1f838ca3f0 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 22 Jul 2021 22:29:18 +0000 Subject: [PATCH] Begin refactor / rework of UI. --- rocket/ui.ks | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/rocket/ui.ks b/rocket/ui.ks index 4f7eb39..0a0d91a 100644 --- a/rocket/ui.ks +++ b/rocket/ui.ks @@ -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.