20,741
edits
m (move img elsewhere, was complicating the table layout) |
m (→Nasal dialog: simplify callback creation (untested for now)) |
||
Line 254: | Line 254: | ||
scroll.setLayout(list); | scroll.setLayout(list); | ||
var fgcommandCb = func(command, arguments) { | |||
return func() { | |||
fgcommand(command, props.Node.new(arguments) ); | |||
}; | |||
} | |||
## | ## | ||
Line 259: | Line 264: | ||
var ControlButtons = [ | var ControlButtons = [ | ||
{name: "Global reset", callback: | {name: "Global reset", callback: fgcommandCb("reset") }, | ||
# see $FG_SRC/Main/fg_commands.cxx (do_switch_aircraft) | # see $FG_SRC/Main/fg_commands.cxx (do_switch_aircraft) | ||
{name: "Reload aircraft", callback: | {name: "Reload aircraft", callback: fgcommandCb("switch-aircraft", {aircraft:'ufo'}) }, | ||
# WIP: (placeholders) | # WIP: (placeholders) | ||
{name: "Relocate:KSFO", callback: func() {} }, | {name: "Relocate:KSFO", callback: func() {} }, |