diff --git a/art/themes/luciano_blocktronics/STATUS.ANS b/art/themes/luciano_blocktronics/STATUS.ANS index dc2b0ca8..e1618621 100644 Binary files a/art/themes/luciano_blocktronics/STATUS.ANS and b/art/themes/luciano_blocktronics/STATUS.ANS differ diff --git a/art/themes/luciano_blocktronics/theme.hjson b/art/themes/luciano_blocktronics/theme.hjson index 5cdf0223..a9e2bdc3 100644 --- a/art/themes/luciano_blocktronics/theme.hjson +++ b/art/themes/luciano_blocktronics/theme.hjson @@ -249,10 +249,10 @@ mainMenuWaitingForCaller: { config: { quickLogTimestampFormat: "|01|02MM|08/|02DD hh:mm:ssa" - nowDateTimeFormat: "|00|11dddd|08, |11MMMM Do YYYY |08/ |11h|08:|11mm|08:|11ss|03a" + nowDateTimeFormat: "|00|11ddd|08, |11MMMM Do YYYY|08, |11h|08:|11mm|08:|11ss|03a" lastLoginDateTimeFormat: "|00|10ddd hh|08:|10mm|02a" - mainInfoFormat10: "|00|11{now} {currentUserName} |08- |03mail|08: |11{newPrivateMail}|03 prv|08, |11{newMessagesAddrTo}|03 addr to" + mainInfoFormat10: "|00|11{now} {currentUserName} |08- |03Prv|08:|11{newPrivateMail} |03Addr|08:|11{newMessagesAddrTo} |08- |03Avail|08:|11{availIndicator} |03Vis|08:|11{visIndicator}" mainInfoFormat11: "|00|10{callsToday:>5}" mainInfoFormat12: "|00|10{postsToday:>5}" mainInfoFormat13: "|00|10{uploadsToday:>2} |08/ |10{uploadBytesToday!sizeWithoutAbbr} |02{uploadBytesToday!sizeAbbr}" @@ -288,6 +288,8 @@ error: |00|12 fatal: |00|28 } + statusAvailableIndicators: [ "N", "Y" ] + statusVisibleIndicators: [ "N", "Y" ] } 0: { mci: { diff --git a/core/predefined_mci.js b/core/predefined_mci.js index 130276de..78938443 100644 --- a/core/predefined_mci.js +++ b/core/predefined_mci.js @@ -192,6 +192,14 @@ const PREDEFINED_MCI_GENERATORS = { NP : function userNewPrivateMailCount(client) { return StatLog.getUserStatNumByClient(client, UserProps.NewPrivateMailCount); }, + IA : function userStatusAvailableIndicator(client) { + const indicators = client.currentTheme.helpers.getStatusAvailIndicators(); + return client.user.isAvailable() ? (indicators[0] || 'Y') : (indicators[1] || 'N'); + }, + IV : function userStatusVisibleIndicator(client) { + const indicators = client.currentTheme.helpers.getStatusVisibleIndicators(); + return client.user.isVisible() ? (indicators[0] || 'Y') : (indicators[1] || 'N'); + }, // // Date/Time diff --git a/core/theme.js b/core/theme.js index a511ba33..f3bdcd27 100644 --- a/core/theme.js +++ b/core/theme.js @@ -348,7 +348,15 @@ exports.ThemeManager = class ThemeManager { getDateTimeFormat : function(style = 'short') { const format = Config().theme.dateTimeFormat[style] || 'MM/DD/YYYY h:mm a'; return _.get(theme, `customization.defaults.dateTimeFormat.${style}`, format); - } + }, + getStatusAvailIndicators : function() { + const format = Config().theme.statusAvailableIndicators || [ 'Y', 'N' ]; + return _.get(theme, 'customization.defaults.statusAvailableIndicators', format); + }, + getStatusVisibleIndicators : function() { + const format = Config().theme.statusVisibleIndicators || [ 'Y', 'N' ]; + return _.get(theme, 'customization.defaults.statusVisibleIndicators', format); + }, }; } diff --git a/core/wfc.js b/core/wfc.js index be5b5e65..aaf6bce8 100644 --- a/core/wfc.js +++ b/core/wfc.js @@ -53,6 +53,9 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { } } + // initSequence -> MenuModule.displayArtAndPrepViewController() (make common) + // main, help, log, ... + mciReady(mciData, cb) { super.mciReady(mciData, err => { if (err) { @@ -118,9 +121,9 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { } _applyOpVisibility() { - const vis = this.config.opVisibility || 'current'; this.restoreUserIsVisible = this.client.user.isVisible(); + const vis = this.config.opVisibility || 'current'; switch (vis) { case 'hidden' : this.client.user.setVisibility(false); break; case 'visible' : this.client.user.setVisibility(true); break; @@ -175,6 +178,20 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { ); } + _getStatusStrings(isAvailable, isVisible) { + const availIndicators = Array.isArray(this.config.statusAvailableIndicators) ? + this.config.statusAvailableIndicators : + this.client.currentTheme.helpers.getStatusAvailableIndicators(); + const visIndicators = Array.isArray(this.config.statusVisibleIndicators) ? + this.config.statusVisibleIndicators : + this.client.currentTheme.helpers.getStatusVisibleIndicators(); + + return [ + isAvailable ? (availIndicators[1] || 'Y') : (availIndicators[0] || 'N'), + isVisible ? (visIndicators[1] || 'Y') : (visIndicators[0] || 'N'), + ]; + } + _refreshStats(cb) { const fileAreaStats = StatLog.getSystemStat(SysProps.FileBaseAreaStats) || {}; const sysMemStats = StatLog.getSystemStat(SysProps.SystemMemoryStats) || {}; @@ -183,6 +200,10 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { const now = moment(); + const [availIndicator, visIndicator] = this._getStatusStrings( + this.client.user.isAvailable(), this.client.user.isVisible() + ); + this.stats = { // Date/Time nowDate : now.format(this.getDateFormat()), @@ -216,6 +237,8 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { // Current currentUserName : this.client.user.username, currentUserRealName : this.client.user.getProperty(UserProps.RealName) || this.client.user.username, + availIndicator : availIndicator, + visIndicator : visIndicator, lastLoginUserName : lastLoginStats.userName, lastLoginRealName : lastLoginStats.realName, lastLoginDate : moment(lastLoginStats.timestamp).format(this.getDateFormat()), @@ -247,7 +270,11 @@ exports.getModule = class WaitingForCallerModule extends MenuModule { ac.action = 'Logging In'; } + const [availIndicator, visIndicator] = this._getStatusStrings(ac.isAvailable, ac.isVisible); + return Object.assign(ac, { + availIndicator, + visIndicator, timeOn : _.upperFirst((ac.timeOn || moment.duration(0)).humanize()), // make friendly }); }); diff --git a/docs/_docs/art/mci.md b/docs/_docs/art/mci.md index a1a807d8..8c2bb7ef 100644 --- a/docs/_docs/art/mci.md +++ b/docs/_docs/art/mci.md @@ -107,6 +107,8 @@ There are many predefined MCI codes that can be used anywhere on the system (pla | `NT` | Total *new* users *today* | | `NM` | Count of new messages **address to the current user** across all message areas in which they have access | | `NP` | Count of new private mail to the current user | +| `IA` | Indicator as to rather the current user is **available** or not. See also `getStatusAvailIndicators()` in [Themes](themes.md) | +| `IV` | Indicator as to rather the curent user is **visible** or not. See also `getStatusVisibleIndicators()` in [Themes](themes.md) | Some additional special case codes also exist: diff --git a/docs/_docs/art/themes.md b/docs/_docs/art/themes.md index f7b234de..ad311566 100644 --- a/docs/_docs/art/themes.md +++ b/docs/_docs/art/themes.md @@ -51,6 +51,8 @@ Override system defaults. | `dateFormat` | Sets the [moment.js](https://momentjs.com/docs/#/displaying/) style `short` and/or `long` format for dates. | | `timeFormat` | Sets the [moment.js](https://momentjs.com/docs/#/displaying/) style `short` and/or `long` format for times. | | `dateTimeFormat` | Sets the [moment.js](https://momentjs.com/docs/#/displaying/) style `short` and/or `long` format for date/time combinations. | +| `getStatusAvailIndicators` | An array[2] of **availability** status indicators. Defaults to `[ 'Y', 'N' ]`. | +| `getStatusVisibleIndicators` | An array[2] of **visibility** status indicators. Defaults to `[ 'Y', 'N' ]`. | Example: ```hjson diff --git a/docs/_docs/modding/wfc.md b/docs/_docs/modding/wfc.md index eb632b31..ea56c2f6 100644 --- a/docs/_docs/modding/wfc.md +++ b/docs/_docs/modding/wfc.md @@ -80,4 +80,7 @@ The following MCI codes are available: * `systemAvgLoad`: System average load. * `systemCurrentLoad`: System current load. * `newPrivateMail`: Number of new **privae** mail for current user. - * `newMessagesAddrTo`: Number of new messages **addressed to the current user**. \ No newline at end of file + * `newMessagesAddrTo`: Number of new messages **addressed to the current user**. + + +:information_source: While [Standard MCI](../art/mci.md) codes work on any menu, they will **not** refresh. For values that may change over time, please use the custom format values above. \ No newline at end of file