Skip to content
Snippets Groups Projects
Commit 4540ad04 authored by Eric Oulashin's avatar Eric Oulashin Committed by Rob Swindell
Browse files

DDMsgReader: Bug fix for going to a specific message in the message list...

parent e4b6cfaa
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!323DDMsgReader: Bug fix for going to a specific message in the message list...
...@@ -146,6 +146,8 @@ ...@@ -146,6 +146,8 @@
* optional. * optional.
* 2023-08-26 Eric Oulashin Version 1.77a * 2023-08-26 Eric Oulashin Version 1.77a
* When saving a message on the local BBS PC without all the headers, the date is now included * When saving a message on the local BBS PC without all the headers, the date is now included
* 2023-08-30 Eric Oulashin Version 1.78
* Bug fix for going to a specific message in the message list (especially for lightbar mode)
*/ */
   
"use strict"; "use strict";
...@@ -252,8 +254,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a'); ...@@ -252,8 +254,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a');
   
   
// Reader version information // Reader version information
var READER_VERSION = "1.77a"; var READER_VERSION = "1.78";
var READER_DATE = "2023-08-26"; var READER_DATE = "2023-08-30";
   
// Keyboard key codes for displaying on the screen // Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24); var UP_ARROW = ascii(24);
...@@ -3466,7 +3468,7 @@ function DigDistMsgReader_ListMessages_Traditional(pAllowChgSubBoard) ...@@ -3466,7 +3468,7 @@ function DigDistMsgReader_ListMessages_Traditional(pAllowChgSubBoard)
var returnObj = this.EditExistingMsg(msgNum-1); var returnObj = this.EditExistingMsg(msgNum-1);
else else
{ {
console.print("\x01n\r\n\x01h\x01yThat message isn't editable.\n"); console.print("\x01n\r\n\x01h\x01yThat message isn't editable.\x01n");
console.crlf(); console.crlf();
console.pause(); console.pause();
} }
...@@ -3479,7 +3481,7 @@ function DigDistMsgReader_ListMessages_Traditional(pAllowChgSubBoard) ...@@ -3479,7 +3481,7 @@ function DigDistMsgReader_ListMessages_Traditional(pAllowChgSubBoard)
} }
} }
// G: Go to a specific message by # (place that message on the top) // G: Go to a specific message by # (place that message on the top)
else if (retvalObj.userInput == "G") else if (retvalObj.userInput == this.msgListKeys.goToMsg)
{ {
var msgNum = this.PromptForMsgNum(curpos, "\x01n" + replaceAtCodesInStr(this.text.goToMsgNumPromptText), false, ERROR_PAUSE_WAIT_MS, false); var msgNum = this.PromptForMsgNum(curpos, "\x01n" + replaceAtCodesInStr(this.text.goToMsgNumPromptText), false, ERROR_PAUSE_WAIT_MS, false);
if (msgNum > 0) if (msgNum > 0)
...@@ -3743,6 +3745,11 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard) ...@@ -3743,6 +3745,11 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard)
// Create a DDLightbarMenu for the message list and list messages // Create a DDLightbarMenu for the message list and list messages
// and let the user choose one // and let the user choose one
var msgListMenu = this.CreateLightbarMsgListMenu(); var msgListMenu = this.CreateLightbarMsgListMenu();
// numMessages & numMessagesPerPage are used with msgListMenu.CalcPageForItemAndSetTopItemIdx() when
// going to a specific message. They're optional, but it can be faster to get them just once instead of
// every time.
var numMessages = msgListMenu.NumItems();
var numMessagesPerPage = msgListMenu.GetNumItemsPerPage();
var msgHeader = null; var msgHeader = null;
var drawMenu = true; var drawMenu = true;
var continueOn = true; var continueOn = true;
...@@ -3948,7 +3955,7 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard) ...@@ -3948,7 +3955,7 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard)
else else
drawMenu = false; // No need to re-draw the menu drawMenu = false; // No need to re-draw the menu
} }
// G: Go to a specific message by # (highlight or place that message on the top) // G: Go to a specific message by # (highlight or place that message on the top, or in the page if can't put it on top)
else if (lastUserInputUpper == this.msgListKeys.goToMsg) else if (lastUserInputUpper == this.msgListKeys.goToMsg)
{ {
// Move the cursor to the bottom of the screen and // Move the cursor to the bottom of the screen and
...@@ -3974,6 +3981,7 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard) ...@@ -3974,6 +3981,7 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard)
{ {
this.lightbarListSelectedMsgIdx = chosenMsgIndex; this.lightbarListSelectedMsgIdx = chosenMsgIndex;
msgListMenu.selectedItemIdx = this.lightbarListSelectedMsgIdx; msgListMenu.selectedItemIdx = this.lightbarListSelectedMsgIdx;
msgListMenu.CalcPageForItemAndSetTopItemIdx(numMessagesPerPage, numMessages);
} }
else else
{ {
...@@ -9352,17 +9360,16 @@ function DigDistMsgReader_PromptForMsgNum(pCurPos, pPromptText, pClearToEOLAfter ...@@ -9352,17 +9360,16 @@ function DigDistMsgReader_PromptForMsgNum(pCurPos, pPromptText, pClearToEOLAfter
console.print("\x01n"); console.print("\x01n");
console.gotoxy(pCurPos.x + promptTextLen, pCurPos.y); console.gotoxy(pCurPos.x + promptTextLen, pCurPos.y);
var clearLen = lastErrorLen - promptTextLen; var clearLen = lastErrorLen - promptTextLen;
for (var counter = 0; counter < clearLen; ++counter) printf("%-*s", clearLen, "");
console.print(" ");
} }
} }
console.gotoxy(pCurPos.x + promptTextLen, pCurPos.y); console.gotoxy(pCurPos.x + promptTextLen, pCurPos.y);
} }
msgNum = console.getnum(this.HighestMessageNum()); msgNum = console.getnum(this.NumMessages()); // this.HighestMessageNum()
// If the message number is invalid, then output an error message. // If the message number is invalid, then output an error message.
if (msgNum != 0) if (msgNum != 0)
{ {
if (!this.IsValidMessageNum(msgNum)) if (!this.IsValidMessageNum(msgNum) && msgNum != -1) // msgNum would be -1 if the user pressed Q to quit
{ {
// Output an error message that the message number is invalid // Output an error message that the message number is invalid
if (useCurPos) if (useCurPos)
...@@ -9395,8 +9402,7 @@ function DigDistMsgReader_PromptForMsgNum(pCurPos, pPromptText, pClearToEOLAfter ...@@ -9395,8 +9402,7 @@ function DigDistMsgReader_PromptForMsgNum(pCurPos, pPromptText, pClearToEOLAfter
} }
else else
continueAskingMsgNum = false; continueAskingMsgNum = false;
} } while (continueAskingMsgNum);
while (continueAskingMsgNum)
return msgNum; return msgNum;
} }
   
......
Digital Distortion Message Reader Digital Distortion Message Reader
Version 1.77a Version 1.78
Release date: 2023-08-26 Release date: 2023-08-30
by by
......
...@@ -5,6 +5,8 @@ Revision History (change log) ...@@ -5,6 +5,8 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
1.78 2023-08-30 Bug fix for going to a specific message in the message
list (especially for lightbar mode)
1.77a 2023-08-26 When saving a message on the local BBS PC without all the 1.77a 2023-08-26 When saving a message on the local BBS PC without all the
headers, the date is now included headers, the date is now included
1.77 2023-08-20 Including all message headers when saving a message (sysop 1.77 2023-08-20 Including all message headers when saving a message (sysop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment