Route-manager dialog: default to appending
Rather than warning in the case where there is no selected, default to appending new waypoints, since this is a fairly common case.
This commit is contained in:
parent
f6fd864394
commit
29ec71b3a6
1 changed files with 7 additions and 7 deletions
|
@ -44,11 +44,7 @@ command interface /autopilot/route-manager/input:
|
|||
|
||||
var insert = func {
|
||||
var insertIndex = sel_index();
|
||||
if (insertIndex < 0) {
|
||||
var msg = "Select the waypoint after which new waypoints should be added";
|
||||
setprop("sim/messages/copilot", msg);
|
||||
return;
|
||||
}
|
||||
var appending = (insertIndex < 0);
|
||||
|
||||
# Input is a list of space-separated waypoint specifications
|
||||
var argv = split(" ", input.getValue());
|
||||
|
@ -56,8 +52,12 @@ command interface /autopilot/route-manager/input:
|
|||
# When argument is not empty (caused by multiple space
|
||||
# separators) insert *after* waypoint
|
||||
if (size(arg) > 0) {
|
||||
insertIndex += 1;
|
||||
cmd.setValue("@insert" ~ insertIndex ~ ":" ~ arg);
|
||||
if (appending) {
|
||||
cmd.setValue(arg);
|
||||
} else {
|
||||
insertIndex += 1;
|
||||
cmd.setValue("@insert" ~ insertIndex ~ ":" ~ arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue