Skip to content
Snippets Groups Projects
Commit b4fbc321 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Support text/menu/xtrn*_tail even when xtrn<secnum|name> menu exists.

Previously, the xtrn*_tail menu was only displayed in the programmatic menu
mode.

Also, using the P_NOERROR mode flag for bbs.menu() to simplify all the if/else
logic.

And use require() instead of load().
parent 0d0863d2
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
"use strict"; "use strict";
load("sbbsdefs.js"); require("sbbsdefs.js", "P_NOERROR");
/* text.dat entries */ /* text.dat entries */
load("text.js"); require("text.js", "XtrnProgLstFmt");
/* See if an xtrn section code was passed as an argument */ /* See if an xtrn section code was passed as an argument */
/* must parse argv before calling load() */ /* must parse argv before calling load() */
...@@ -123,17 +123,11 @@ function external_program_menu(xsec) ...@@ -123,17 +123,11 @@ function external_program_menu(xsec)
var secnum = xtrn_area.sec_list[xsec].number+1; var secnum = xtrn_area.sec_list[xsec].number+1;
var seccode = xtrn_area.sec_list[xsec].code; var seccode = xtrn_area.sec_list[xsec].code;
if(bbs.menu_exists("xtrn" + secnum + "_head")) { if(!bbs.menu("xtrn" + secnum + "_head", P_NOERROR))
bbs.menu("xtrn" + secnum + "_head"); bbs.menu("xtrn" + seccode + "_head", P_NOERROR);
} if(bbs.menu("xtrn" + secnum, P_NOERROR) || bbs.menu("xtrn" + seccode, P_NOERROR)) {
else if(bbs.menu_exists("xtrn" + seccode + "_head")) { if(!bbs.menu("xtrn" + secnum + "_tail", P_NOERROR))
bbs.menu("xtrn" + seccode + "_head"); bbs.menu("xtrn" + seccode + "_tail", P_NOERROR);
}
if(bbs.menu_exists("xtrn" + secnum)) {
bbs.menu("xtrn" + secnum);
}
else if(bbs.menu_exists("xtrn" + seccode)) {
bbs.menu("xtrn" + seccode);
} }
else { else {
var multicolumn = options.multicolumn && prog_list.length > options.singlecolumn_height; var multicolumn = options.multicolumn && prog_list.length > options.singlecolumn_height;
...@@ -182,12 +176,8 @@ function external_program_menu(xsec) ...@@ -182,12 +176,8 @@ function external_program_menu(xsec)
} }
console.crlf(); console.crlf();
} }
if(bbs.menu_exists("xtrn" + secnum + "_tail")) { if(!bbs.menu("xtrn" + secnum + "_tail", P_NOERROR))
bbs.menu("xtrn" + secnum + "_tail"); bbs.menu("xtrn" + seccode + "_tail", P_NOERROR);
}
else if(bbs.menu_exists("xtrn" + seccode + "_tail")) {
bbs.menu("xtrn" + seccode + "_tail");
}
bbs.node_sync(); bbs.node_sync();
console.mnemonics(options.which); console.mnemonics(options.which);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment