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

Address conflict with Synchronet internal mouse support

1. Don't enable mouse support if the user's terminal is configured to not
   support it.

2. After calling bbs.receive_file() which displays a menu and uses sbbs's
   internal mouse support, which enables a different mouse reporting mode,
   disable the console.mouse_mode (sbbs's internal mouse support) before
   re-enabling the mouse support for the avatar_chooser's own custom mouse
   mode. Fix fixes issue #414 reported by Nelgin.

3. Fixed a typo in a message displayed to user if avatar upload failed.
parent 2bb0ca81
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -95,7 +95,8 @@ Frame.prototype.blit = function (bin, w, h, x, y, str, sc) { ...@@ -95,7 +95,8 @@ Frame.prototype.blit = function (bin, w, h, x, y, str, sc) {
} }
function mouse_enable(enable) { function mouse_enable(enable) {
if (!console.term_supports(USER_ANSI)) return; if (!console.term_supports(USER_ANSI | USER_MOUSE)) return;
console.mouse_mode = MOUSE_MODE_OFF; // While we're not using Synchronet internal mouse support in this script
ansiterm.send('mouse', enable ? 'set' : 'clear', 'normal_tracking'); ansiterm.send('mouse', enable ? 'set' : 'clear', 'normal_tracking');
} }
...@@ -136,6 +137,7 @@ function upload_avatar() { ...@@ -136,6 +137,7 @@ function upload_avatar() {
bbs.receive_file(fn); bbs.receive_file(fn);
const success = avatar_lib.import_file(user.number, fn, 0); const success = avatar_lib.import_file(user.number, fn, 0);
file_remove(fn); file_remove(fn);
mouse_enable(true);
return success; return success;
} }
...@@ -750,7 +752,7 @@ function MainMenu(parent_frame) { ...@@ -750,7 +752,7 @@ function MainMenu(parent_frame) {
if (upload_avatar()) { if (upload_avatar()) {
console.putmsg('Your avatar has been updated.'); console.putmsg('Your avatar has been updated.');
} else { } else {
console.putmsg('An error was encountered. Your avatar has nto been updated.'); console.putmsg('An error was encountered. Your avatar has not been updated.');
} }
console.clear(LIGHTGRAY); console.clear(LIGHTGRAY);
frames.parent.invalidate(); frames.parent.invalidate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment