From 17ddd732474ecb32225bc05cf92013aabf5b242d Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 17 Jul 2022 23:02:08 -0600 Subject: [PATCH] Allow for WFC status to be MLTEV --- art/themes/luciano_blocktronics/theme.hjson | 9 ++++++++- art/themes/luciano_blocktronics/wfc.ans | Bin 3055 -> 3055 bytes core/menu_module.js | 2 +- core/wfc.js | 15 +++++++++++---- docs/_docs/modding/wfc.md | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/art/themes/luciano_blocktronics/theme.hjson b/art/themes/luciano_blocktronics/theme.hjson index 6bc9b7af..fc3a7682 100644 --- a/art/themes/luciano_blocktronics/theme.hjson +++ b/art/themes/luciano_blocktronics/theme.hjson @@ -297,7 +297,7 @@ statusAvailableIndicators: [ "N", "Y" ] statusVisibleIndicators: [ "N", "Y" ] - nodeStatusSelectionFormat: "|00|10{realName}" + nodeStatusSelectionFormat: "|00|10{realName}\n{serverName}" } 0: { mci: { @@ -322,6 +322,13 @@ width: 73 itemFormat: "|00|07{nodeId} {levelIndicator} |02{timestamp} {message:<51.50}" } + + MT3: { + mode: preview + autoScroll: false + height: 5 + width: 12 + } } } } diff --git a/art/themes/luciano_blocktronics/wfc.ans b/art/themes/luciano_blocktronics/wfc.ans index 9c1e6ede43aa7c319f0b9df2d1ef10cdd35f8654..3588cabf411e39dc50d934db3fbbb89df4f3a316 100644 GIT binary patch delta 28 kcmaDa{$6}T5eu_#i1Fl)EMl9xS*+Qa%?-^bpX62p0GFu=TL1t6 delta 28 kcmaDa{$6}T5esvOkMZP>EMl9xS*+Qa&5VpEpX62p0GEgfRsaA1 diff --git a/core/menu_module.js b/core/menu_module.js index fd234934..eb98ef29 100644 --- a/core/menu_module.js +++ b/core/menu_module.js @@ -685,7 +685,7 @@ exports.MenuModule = class MenuModule extends PluginModule { } if (appendMultiLine && view instanceof MultiLineEditTextView) { - view.addText(text); + view.setAnsi(text); } else { view.setText(text); } diff --git a/core/wfc.js b/core/wfc.js index 5635d043..d1ce530a 100644 --- a/core/wfc.js +++ b/core/wfc.js @@ -14,6 +14,9 @@ const UserProps = require('./user_property'); const Log = require('./logger'); const Config = require('./config.js').get; const { Errors } = require('./enig_error'); +const { pipeToAnsi } = require('./color_codes'); +const MultiLineEditTextView = + require('./multi_line_edit_text_view').MultiLineEditTextView; // deps const async = require('async'); @@ -112,7 +115,6 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { return this._confirmKickSelectedNode(cb); }, kickNodeYes: (formData, extraArgs, cb) => { - //this._startRefreshing(); return this._kickSelectedNode(cb); }, kickNodeNo: (formData, extraArgs, cb) => { @@ -232,9 +234,14 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { if (item) { const nodeStatusSelectionFormat = this.config.nodeStatusSelectionFormat || '{text}'; - nodeStatusSelectionView.setText( - stringFormat(nodeStatusSelectionFormat, item) - ); + + const s = stringFormat(nodeStatusSelectionFormat, item); + + if (nodeStatusSelectionView instanceof MultiLineEditTextView) { + nodeStatusSelectionView.setAnsi(pipeToAnsi(s, this.client)); + } else { + nodeStatusSelectionView.setText(s); + } } } diff --git a/docs/_docs/modding/wfc.md b/docs/_docs/modding/wfc.md index be691413..31c93365 100644 --- a/docs/_docs/modding/wfc.md +++ b/docs/_docs/modding/wfc.md @@ -92,7 +92,7 @@ The following MCI codes are available: * `freeMemoryBytes`: Free system memory in bytes. * `systemAvgLoad`: System average load. * `systemCurrentLoad`: System current load. - * `newPrivateMail`: Number of new **privae** mail for current user. + * `newPrivateMail`: Number of new **private** mail for current user. * `newMessagesAddrTo`: Number of new messages **addressed to the current user**. * `availIndicator`: Is the current user availalbe? Displayed via `statusAvailableIndicators` or system theme. See also [Themes](../art/themes.md). * `visIndicator`: Is the current user visible? Displayed via `statusVisibleIndicators` or system theme. See also [Themes](../art/themes.md).