* Use standard MCI codes in FSE/etc.

* Add mod mixin for temp area/conf switch e.g. used by new scan, fse, so on
* string utils: renderSubstr(), renderStringLength(): Works with *rendered* text. That is, is smart enough to ignore ANSI and RA style pipe color codes
* string util pad() works with ANSI/RA pipe codes
* TextView can now display text with RA pipe codes and MCI codes
* Message conf/area welcome art #81
* Update luciano art with new MCI
This commit is contained in:
Bryan Ashby 2016-08-03 19:48:45 -06:00
parent 3d098e927a
commit 969cd35ece
11 changed files with 439 additions and 223 deletions

View file

@ -1,12 +1,15 @@
/* jslint node: true */
'use strict';
var assert = require('assert');
const messageArea = require('../core/message_area.js');
// deps
const assert = require('assert');
//
// A simple mixin for View Controller management
//
var ViewControllerManagement = function() {
exports.ViewControllerManagement = function() {
this.initViewControllers = function() {
this.viewControllers = {};
};
@ -27,4 +30,27 @@ var ViewControllerManagement = function() {
};
};
exports.ViewControllerManagement = ViewControllerManagement;
exports.MessageAreaConfTempSwitcher = function() {
this.tempMessageConfAndAreaSwitch = function(messageAreaTag) {
messageAreaTag = messageAreaTag || this.messageAreaTag;
if(!messageAreaTag) {
return; // nothing to do!
}
this.prevMessageConfAndArea = {
confTag : this.client.user.properties.message_conf_tag,
areaTag : this.client.user.properties.message_area_tag,
};
if(!messageArea.tempChangeMessageConfAndArea(this.client, this.messageAreaTag)) {
this.client.log.warn( { messageAreaTag : messageArea }, 'Failed to perform temporary message area/conf switch');
}
};
this.tempMessageConfAndAreaRestore = function() {
if(this.prevMessageConfAndArea) {
this.client.user.properties.message_conf_tag = this.prevMessageConfAndArea.confTag;
this.client.user.properties.message_area_tag = this.prevMessageConfAndArea.areaTag;
}
};
};