Change FRAME_ consts to ANSI_FRAME_ consts
This commit is contained in:
parent
1387a79672
commit
17f2265249
@ -1,5 +1,11 @@
|
||||
var FRAME_ANSI=(1<<1);
|
||||
|
||||
var ANSI_FRAME_LENGTH =22; /* Length of a frame */
|
||||
var ANSI_FRAME_WIDTH =80; /* Width of a frame */
|
||||
var ANSI_FRAME_HEADER =56; /* Size of page owner (length) */
|
||||
var ANSI_FRAME_PAGENUM =12; /* Size of page number (length with a-z) */
|
||||
var ANSI_FRAME_COST = 9; /* Size of cost (length without unit) */
|
||||
|
||||
// Our frame object
|
||||
function ANSIFrame() {
|
||||
this.version=1; // The version of this frame - in case we update functionality and we need to be
|
||||
@ -42,9 +48,9 @@ function ANSIFrame() {
|
||||
|
||||
cost = (this.isAccessible ? this.cost+FRAME_COSTUNIT : ' -')
|
||||
|
||||
header = '\1n'+this.pageownerlogo+' '.repeat(FRAME_HEADER-console.strlen(this.pageownerlogo))+'\1n '+
|
||||
(this.isAccessible ? '\1W' : '\1R')+'\1H'+this.page+' '.repeat(FRAME_PAGENUM-this.page.length)+' '+
|
||||
'\1G\1H'+' '.repeat(FRAME_COST-cost.toString().length+1)+cost+'\1n'+
|
||||
header = '\1n'+this.pageownerlogo+' '.repeat(ANSI_FRAME_HEADER-console.strlen(this.pageownerlogo))+'\1n '+
|
||||
(this.isAccessible ? '\1W' : '\1R')+'\1H'+this.page+' '.repeat(ANSI_FRAME_PAGENUM-this.page.length)+' '+
|
||||
'\1G\1H'+' '.repeat(ANSI_FRAME_COST-cost.toString().length+1)+cost+'\1n'+
|
||||
(console.screen_columns > 80 ? '\n\r' : '');
|
||||
}
|
||||
|
||||
@ -118,7 +124,7 @@ function ANSIFrame() {
|
||||
|
||||
for(p=0;p<text.length;p++) {
|
||||
// Look for a special character until the end of the frame width
|
||||
cte = (r*FRAME_WIDTH - ((r-1)*FRAME_WIDTH+c));
|
||||
cte = (r*ANSI_FRAME_WIDTH - ((r-1)*ANSI_FRAME_WIDTH+c));
|
||||
match = text.substr(p,cte).match(/[\r\n\x1b]/);
|
||||
//log(LOG_DEBUG,'SPECIAL CHAR ['+r+'x'+c+'] ['+p+'-'+cte+'] for: '+match);
|
||||
|
||||
@ -313,14 +319,14 @@ function ANSIFrame() {
|
||||
p += advance;
|
||||
}
|
||||
|
||||
if (c>FRAME_WIDTH) {
|
||||
if (c>ANSI_FRAME_WIDTH) {
|
||||
c = 1;
|
||||
r++;
|
||||
}
|
||||
|
||||
/*
|
||||
// @todo - If we are longer than FRAME_LENGTH, move the output into the next frame.
|
||||
if (r>FRAME_LENGTH) {
|
||||
// @todo - If we are longer than ANSI_FRAME_LENGTH, move the output into the next frame.
|
||||
if (r>ANSI_FRAME_LENGTH) {
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
@ -19,11 +19,6 @@ var MODE_RFNOTSENT =4; /* Response frame not sent */
|
||||
var MODE_RFSENT =5; /* Response frame sent */
|
||||
var MODE_RFERROR =6; /* Response frame error */
|
||||
|
||||
var FRAME_LENGTH =22; /* Length of a frame */
|
||||
var FRAME_WIDTH =80; /* Width of a frame */
|
||||
var FRAME_HEADER =56; /* Size of page owner (length) */
|
||||
var FRAME_PAGENUM =12; /* Size of page number (length with a-z) */
|
||||
var FRAME_COST = 9; /* Size of cost (length without unit) */
|
||||
var FRAME_COSTUNIT ='c'; /* Unit of cost */
|
||||
|
||||
var FRAME_TYPE_INFO ='i'; // Information Frame, requires no response after viewed
|
||||
|
@ -30,8 +30,8 @@ function edit(fo) {
|
||||
const frame = new Frame(1,1,console.screen_columns,console.screen_rows,BG_BLACK|LIGHTGRAY);
|
||||
frame.gotoxy(1,1);
|
||||
|
||||
header = '\1n'+fo.pageownerlogo+' '.repeat(FRAME_HEADER-console.strlen(fo.pageownerlogo))+'\1n '+
|
||||
'\1W\1H'+fo.page+' '.repeat(FRAME_PAGENUM-fo.page.length)+' '+
|
||||
header = '\1n'+fo.pageownerlogo+' '.repeat(ANSI_FRAME_HEADER-console.strlen(fo.pageownerlogo))+'\1n '+
|
||||
'\1W\1H'+fo.page+' '.repeat(ANSI_FRAME_PAGENUM-fo.page.length)+' '+
|
||||
'\1G\1H'+' Edit';
|
||||
frame.putmsg(header);
|
||||
frame.open();
|
||||
|
Loading…
Reference in New Issue
Block a user