Skip to content

Commit

Permalink
even more efficient colors in scanmap
Browse files Browse the repository at this point in the history
  • Loading branch information
manicpop committed Sep 30, 2024
1 parent b740c7b commit 36b93de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions mbmgemp/GECMDS.C
Original file line number Diff line number Diff line change
Expand Up @@ -3023,7 +3023,7 @@ int i,j;
prfmsg(PLUSDASH);
for (i=0; i<MAXY; ++i)
{
prf(" \33[0;31m|");
prf(" |");
for (j=0; j<MAXX; ++j)
{
if (mapc[i][j] == '1')
Expand All @@ -3037,13 +3037,17 @@ for (i=0; i<MAXY; ++i)
}
else
{
prf("\33[1;37m%c\33[0;31m",map[i][j]);
if (map[i][j] == ' ')
prf(" "); /* prevent excessive color codes */
else
prf("\33[1;37m%c\33[0;31m",map[i][j]);
}
}
prf("|\r");
}

prfmsg(PLUSDASH);
prf("\33[1;37m");

}

Expand All @@ -3067,7 +3071,7 @@ sptr = &scantab[usrnum];
prfmsg(PLUSFULL);
for (i=0; i<MAXY; ++i)
{
prf(" \33[0;31m|");
prf(" |");
for (j=0; j<MAXX; ++j)
{
if (mapc[i][j] == '1')
Expand All @@ -3081,7 +3085,10 @@ for (i=0; i<MAXY; ++i)
}
else
{
prf("\33[1;37m%c\33[0;31m",map[i][j]);
if (map[i][j] == ' ')
prf(" ");
else
prf("\33[1;37m%c\33[0;31m",map[i][j]);
}
}
prf("|");
Expand All @@ -3090,7 +3097,7 @@ for (i=0; i<MAXY; ++i)
othusn = sptr->ship[shp].shipno;
if (ff == 0)
{
prf("\33[1;37m %c %s %4d %4d %s\r",sptr->ship[shp].letter,spr("%6ld",(long)(sptr->ship[shp].dist)),
prf("\33[1;37m %c %s %4d %4d %s\33[0;31m\r",sptr->ship[shp].letter,spr("%6ld",(long)(sptr->ship[shp].dist)),
sptr->ship[shp].bearing,sptr->ship[shp].heading,showarp(sptr->ship[shp].speed));

if (!waruptr->options[SCANNAMES])
Expand All @@ -3101,7 +3108,7 @@ for (i=0; i<MAXY; ++i)
}
else
{
prf(" \33[0;36m%s\r",username(warshpoff(othusn)));
prf(" \33[0;36m%s\33[0;31m\r",username(warshpoff(othusn)));
shp++;
ff = 0;
}
Expand All @@ -3113,6 +3120,7 @@ for (i=0; i<MAXY; ++i)
}

prfmsg(PLUSDASH);
prf("\33[1;37m");

}

Expand Down
4 changes: 2 additions & 2 deletions mbmgemp/MBMGEMSG.MSG
Original file line number Diff line number Diff line change
Expand Up @@ -3285,10 +3285,10 @@ SCANWRM {
Scanning wormhole %d: %s
} T

PLUSDASH {  +------------------------------+
PLUSDASH {  +------------------------------+
} T

PLUSFULL {  +------------------------------+ Ship Distance Bearing Heading Speed
PLUSFULL {  +------------------------------+ Ship Distance Bearing Heading Speed
} T

ADMIN01 {
Expand Down

0 comments on commit 36b93de

Please sign in to comment.