show context (e.g. filename) on cubescript errors

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6400 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2011-04-30 20:27:37 +00:00
parent 0210cc02e0
commit bb978c8e9b
3 changed files with 60 additions and 10 deletions
+8 -4
View File
@@ -214,7 +214,9 @@ struct mitemmanual : mitem
{
gmenu *oldmenu = curmenu;
push("arg1", text);
setcontext("menu", curmenu->name);
int result = execute(action);
resetcontext();
pop("arg1");
if(result >= 0 && oldmenu == curmenu)
{
@@ -741,10 +743,10 @@ struct mitemcheckbox : mitem
checked = !checked;
if(action && action[0])
{
push("arg1", checked ? "1" : "0");
execute(action);
pop("arg1");
}
push("arg1", checked ? "1" : "0");
execute(action);
pop("arg1");
}
}
virtual void init()
@@ -1166,8 +1168,10 @@ void gmenu::open()
if(!allowinput) menusel = 0;
if(!forwardkeys) player1->stopmoving();
if(items.inrange(menusel)) items[menusel]->focus(true);
setcontext("menu", name);
init();
if(initaction) execute(initaction);
resetcontext();
}
void gmenu::close()