informative edittoggle

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5687 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2010-09-11 14:38:51 +00:00
parent e02f72d31f
commit e4bc0ea4c6
5 changed files with 32 additions and 31 deletions
+10 -6
View File
@@ -79,10 +79,14 @@ void correctsel() // ensures above invaria
if(sel.xs<=0 || sel.ys<=0) selset = false;
}
bool noteditmode()
bool noteditmode(const char* func)
{
correctsel();
if(!editmode) conoutf("this function is only allowed in edit mode");
if(!editmode)
{
if(func && func[0]!='\0') conoutf("\f4[\f3%s\f4]\f5 is only allowed in edit mode", func);
else conoutf("this function is only allowed in edit mode");
}
return !editmode;
}
@@ -92,9 +96,9 @@ bool noselection()
return !selset;
}
#define EDITSEL if(noteditmode() || noselection()) return;
#define EDITSELMP if(noteditmode() || noselection() || multiplayer()) return;
#define EDITMP if(noteditmode() || multiplayer()) return;
#define EDITSEL if(noteditmode("EDITSEL") || noselection()) return;
#define EDITSELMP if(noteditmode("EDITSELMP") || noselection() || multiplayer()) return;
#define EDITMP if(noteditmode("EDITMP") || multiplayer()) return;
void selectpos(int x, int y, int xs, int ys)
{
@@ -470,7 +474,7 @@ void perlin(int scale, int seed, int psize)
VARF(fullbright, 0, 0, 1,
if(fullbright)
{
if(noteditmode()) return;
if(noteditmode("fullbright")) return;
fullbrightlight();
}
else calclight();