Skip to content
Snippets Groups Projects
Commit ada4cbdb authored by Michael Long's avatar Michael Long
Browse files

coding improvements, head/tail support

parent b8473194
No related branches found
No related tags found
2 merge requests!50Mlong/ddmsgcolor,!41Custom external program menus mod. Allows making custom external menus that...
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
"use strict"; "use strict";
load("sbbsdefs.js"); load("sbbsdefs.js", "K_NONE");
/* text.dat entries */ /* text.dat entries */
load("text.js"); require("text.js", "XtrnProgLstFmt");
function ExternalMenus() { function ExternalMenus() {
this.options = {}; this.options = {};
......
...@@ -15,10 +15,7 @@ ...@@ -15,10 +15,7 @@
"use strict"; "use strict";
load("sbbsdefs.js"); require("sbbsdefs.js", "K_NONE");
/* text.dat entries */
load("text.js");
load("xtrnmenulib.js"); load("xtrnmenulib.js");
...@@ -97,18 +94,14 @@ function external_section_menu_custom(menuid) ...@@ -97,18 +94,14 @@ function external_section_menu_custom(menuid)
menuitemsfiltered = ExternalMenus.getSortedItems(menuobj); menuitemsfiltered = ExternalMenus.getSortedItems(menuobj);
if (bbs.menu_exists("xtrnmenu_head_" + menuid)) { if (!bbs.menu("xtrnmenu_head_" + menuid, P_NOERROR) && !bbs.menu("xtrnmenu_head", P_NOERROR)) {
bbs.menu("xtrnmenu_head_" + menuid); bbs.menu("xtrn_head", P_NOERROR);
} else if (bbs.menu_exists("xtrn_head")) {
bbs.menu("xtrn_head");
} else if (!bbs.menu_exists("xtrnmenu_head_" + menuid)) {
console.crlf();
} }
if (bbs.menu_exists("xtrnmenu_" + menuid)) { // if file exists text/menu/xtrnmenu_(menuid).[rip|ans|mon|msg|asc],
// if file exists text/menu/xtrnmenu_(menuid).[rip|ans|mon|msg|asc], then display that instead // then display that, otherwise dynamiic
bbs.menu("xtrnmenu_" + menuid); if (!bbs.menu("xtrnmenu_" + menuid, P_NOERROR)) {
} else {
// if no custom menu file in text/menu, create a dynamic one // if no custom menu file in text/menu, create a dynamic one
multicolumn = options.multicolumn && menuitemsfiltered.length > options.singlecolumn_height; multicolumn = options.multicolumn && menuitemsfiltered.length > options.singlecolumn_height;
...@@ -212,19 +205,11 @@ function external_section_menu_custom(menuid) ...@@ -212,19 +205,11 @@ function external_section_menu_custom(menuid)
console.crlf(); console.crlf();
} }
if (bbs.menu_exists("xtrnmenu_tail_" + menuid)) { if (!bbs.menu("xtrnmenu_tail_" + menuid, P_NOERROR) && !bbs.menu("xtrnmenu_tail", P_NOERROR)) {
bbs.menu("xtrnmenu_tail_" + menuid); bbs.menu("xtrn_tail", P_NOERROR);
} else if(bbs.menu_exists("xtrn_tail")) {
bbs.menu("xtrn_tail");
} }
// synchronize with node database, checks for messages,
// interruption, etc. (AKA node_sync), clears the current console
// line if there's a message to print when clearline is true.
bbs.node_sync(); bbs.node_sync();
// print a mnemonics string, command keys highlighted with
// tilde (~) characters; prints "Which or Quit"
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