Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit e97d4610 authored by rswindell's avatar rswindell

The FILL @-code now takes the centered (C) modifier into account, so if the

current column is > 0, it'll maintain that same margin on the right-edge of the
screen (shortening the fill length).
This allows you to create nice dynamic horizontal lines/dividers with margins.
parent caaf6f01
...@@ -144,7 +144,7 @@ int sbbs_t::show_atcode(const char *instr) ...@@ -144,7 +144,7 @@ int sbbs_t::show_atcode(const char *instr)
*p=0; *p=0;
} }
cp = atcode(sp, str2, sizeof(str2), &pmode); cp = atcode(sp, str2, sizeof(str2), &pmode, centered);
if(cp==NULL) if(cp==NULL)
return(0); return(0);
...@@ -210,7 +210,7 @@ static const char* getpath(scfg_t* cfg, const char* path) ...@@ -210,7 +210,7 @@ static const char* getpath(scfg_t* cfg, const char* path)
return path; return path;
} }
const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode) const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode, bool centered)
{ {
char* tp = NULL; char* tp = NULL;
uint i; uint i;
...@@ -613,7 +613,9 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode) ...@@ -613,7 +613,9 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode)
if(strncmp(sp, "FILL:", 5) == 0) { if(strncmp(sp, "FILL:", 5) == 0) {
sp += 5; sp += 5;
while(*sp && online && column < cols - 1) long margin = centered ? column : 1;
if(margin < 1) margin = 1;
while(*sp && online && column < cols - margin)
bputs(sp, P_TRUNCATE); bputs(sp, P_TRUNCATE);
return nulstr; return nulstr;
} }
......
...@@ -815,7 +815,7 @@ public: ...@@ -815,7 +815,7 @@ public:
/* atcodes.cpp */ /* atcodes.cpp */
int show_atcode(const char *code); int show_atcode(const char *code);
const char* atcode(char* sp, char* str, size_t maxlen, long* pmode = NULL); const char* atcode(char* sp, char* str, size_t maxlen, long* pmode = NULL, bool centered = false);
/* getnode.cpp */ /* getnode.cpp */
int getsmsg(int usernumber, bool clearline = false); int getsmsg(int usernumber, bool clearline = false);
......
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