Commit b5c1a605 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Spinning cursors (10 patterns now) are configurable in text.dat

Inspired by the cool progress cursor displayed by 'git-size', the spinning
cursors in the Synchronet terminal server are now configurable via text.dat
strings (SpinningCursor0 - 9), no maximum length.
Increased the cursor "spin" rate from 4 to 5 times per second.
The first character of the spin pattern is chosen at random between 0 and 4
but the direction of increment is also from left to right.
parent 8bf25ec7
Pipeline #42 passed with stage
in 10 minutes and 23 seconds
......@@ -44,7 +44,8 @@
/****************************************************************************/
char sbbs_t::getkey(long mode)
{
uchar ch,coldkey,c=0,spin=sbbs_random(5);
uchar ch, coldkey, spin = sbbs_random(10);
ulong c = sbbs_random(5);
time_t last_telnet_cmd=0;
long term = term_supports();
......@@ -70,145 +71,11 @@ char sbbs_t::getkey(long mode)
}
if(mode&K_SPIN) {
if(term&NO_EXASCII) {
switch(c++) {
case 0:
outchar(BS);
outchar('|');
break;
case 1:
outchar(BS);
outchar('/');
break;
case 2:
outchar(BS);
outchar('-');
break;
case 3:
outchar(BS);
outchar('\\');
c=0;
break;
}
} else {
switch(spin) {
case 0:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('/');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('\\');
c=0;
break;
}
break;
case 1:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('');
break;
case 4:
outchar(BS);
outchar('');
break;
case 5:
outchar(BS);
outchar('');
c=0;
break;
}
break;
case 2:
switch(c++) {
case 0:
outchar(BS);
outchar('-');
break;
case 1:
outchar(BS);
outchar('=');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('=');
c=0;
break;
}
break;
case 3:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('');
c=0;
break;
}
break;
case 4:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('');
c=0;
break;
}
break;
}
}
char* cursor = text[SpinningCursor0 + spin];
outchar('\b');
outchar(cursor[(c++) % strlen(cursor)]);
}
ch=inkey(mode,mode&K_SPIN ? 250:1000);
ch=inkey(mode,mode&K_SPIN ? 200:1000);
if(sys_status&SS_ABORT)
return(0);
now=time(NULL);
......
......@@ -843,6 +843,16 @@ enum {
,NodeConnectionRaw
,MouseTerminalQ
,TerminalMouse
,SpinningCursor0
,SpinningCursor1
,SpinningCursor2
,SpinningCursor3
,SpinningCursor4
,SpinningCursor5
,SpinningCursor6
,SpinningCursor7
,SpinningCursor8
,SpinningCursor9
,TOTAL_TEXT
};
......
/* $Id: text_defaults.c,v 1.80 2020/08/04 04:26:03 rswindell Exp $ */
/* Synchronet default text strings */
/* Automatically generated by textgen $ */
......@@ -1375,4 +1373,14 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x44\x6f\x65\x73\x20\x79\x6f\x75\x72\x20\x74\x65\x72\x6d\x69\x6e\x61\x6c\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x6d\x6f\x75\x73\x65"
"\x20\x72\x65\x70\x6f\x72\x74\x69\x6e\x67" // 831 MouseTerminalQ
,"\x28\x6d\x6f\x75\x73\x65\x29\x20" // 832 TerminalMouse
,"\x2d\x3e\x29\x7c\x28\x3c\x2d\x3c\x28\x7c\x29\x3e" // 833 SpinningCursor0
,"\xb3\x2f\xc4\x5c" // 834 SpinningCursor1
,"\xb0\xb1\xb2\xdb\xb2\xb1" // 835 SpinningCursor2
,"\x2d\x3d\xf0\x3d" // 836 SpinningCursor3
,"\xda\xc0\xd9\xbf" // 837 SpinningCursor4
,"\xdc\xde\xdf\xdd" // 838 SpinningCursor5
,"\x2d\x3e\x29\x7c\x28\x3c\x2d\x3c\x28\x7c\x29\x3e" // 839 SpinningCursor6
,"\xb3\x2f\xc4\x5c" // 840 SpinningCursor7
,"\xb0\xb1\xb2\xdb\xb2\xb1" // 841 SpinningCursor8
,"\x2d\x3d\xf0\x3d" // 842 SpinningCursor9
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment