add optional pre-access function for SVARs

allows a SVAR to be assembled when needed

also:

* mapmsg is now a SVAR
* getmapmsg was removed (now: $mapmsg)
* new editsvar script to edit any SVAR in the console buffer
* nonfunctional menu removed

DOCREF mapmsg getmapmsg editsvar
This commit is contained in:
ac-stef
2015-02-23 18:52:34 +01:00
parent 02869f988a
commit f75f0c0af4
6 changed files with 47 additions and 46 deletions
+8 -13
View File
@@ -315,23 +315,18 @@ void inputcommand(char *init, char *action, char *prompt)
}
COMMAND(inputcommand, "sss");
void mapmsg(char *s)
{
SVARFF(mapmsg,
{ // read mapmsg
hdr.maptitle[127] = '\0';
mapmsg = exchangestr(mapmsg, hdr.maptitle);
},
{ // set new mapmsg
string text;
filterrichtext(text, s);
filterrichtext(text, mapmsg);
filtertext(text, text, FTXT__MAPMSG);
copystring(hdr.maptitle, text, 128);
if(editmode) unsavededits++;
}
COMMAND(mapmsg, "s");
void getmapmsg(void)
{
string text;
copystring(text, hdr.maptitle, 128);
result(text);
}
COMMAND(getmapmsg, "");
});
#if !defined(WIN32) && !defined(__APPLE__)
#include <X11/Xlib.h>