Set up code for quickly handling antennas and solar panels.

This commit is contained in:
Anna Rose Wiggins 2021-08-25 01:11:29 -04:00
parent 27ad3c11d7
commit 081fcb3618
5 changed files with 108 additions and 36 deletions

View file

@ -13,6 +13,17 @@ function MakeButton {
return b.
}
function MakeToggle {
parameter p.
parameter l.
parameter f.
local btn is p:AddButton(l).
set btn:TOGGLE to true.
set btn:onClick to f.
return btn.
}
function MakeMenu {
parameter stack. // the stack where menu stuff goes
parameter btn. // the button that should show this menu
@ -58,9 +69,7 @@ function AddStockButtons {
parameter row.
parameter bootname.
local btn is row:AddButton("Term").
set btn:TOGGLE to true.
set btn:ONTOGGLE to {
MakeToggle(row, "Term", {
parameter d.
if d {
@ -68,7 +77,7 @@ function AddStockButtons {
} else {
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal").
}
}.
}).
MakeButton(row, "Update", {
switch to 0.