1. Added CON command: cmenu <gamevar>

2. Added gamevar: current_menu(READONLY)

// Example: remove the episode selet screen
gamevar prev_menu 0 0
onevent EVENT_DISPLAYMENU
  ifvare current_menu 100 // Episode select
  {
    ifvare prev_menu 110 // Skill select
      cmenu 0 // Main menu
    else
      cmenu 110 // Skill select
  }

  setvarvar prev_menu current_menu
  // addlogvar current_menu
endevent


git-svn-id: https://svn.eduke32.com/eduke32@903 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hnt_ts 2008-07-25 18:10:33 +00:00
parent 7e4d003302
commit f5b049379c
4 changed files with 11 additions and 0 deletions

View file

@ -464,6 +464,7 @@ static const char *keyw[] =
"clearmapstate", // 328
"scriptsize", // 329
"definegamename", // 330
"cmenu", // 331
"<null>"
};
@ -3416,6 +3417,7 @@ static int parsecommand(void)
if (!CheckEventSync(current_event))
ReportError(WARNING_EVENTSYNC);
case CON_JUMP:
case CON_CMENU:
case CON_SOUNDVAR:
case CON_GLOBALSOUNDVAR:
case CON_STOPSOUNDVAR:

View file

@ -839,4 +839,5 @@ enum keywords
CON_CLEARMAPSTATE, // 328
CON_SCRIPTSIZE, // 329
CON_DEFINEGAMENAME, // 330
CON_CMENU, // 331
};

View file

@ -5719,6 +5719,12 @@ case CON_CHANGESPRITESECT:
hittype[g_i].temp_data[9]=0;
break;
}
case CON_CMENU:
insptr++;
j=GetGameVarID(*insptr++, g_i, g_p);
cmenu(j);
break;
case CON_SOUNDVAR:
case CON_STOPSOUNDVAR:

View file

@ -1341,6 +1341,7 @@ static void AddSystemVars()
AddGameVar("lastvisinc",(intptr_t)&lastvisinc, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_SYNCCHECK);
AddGameVar("numsectors",(intptr_t)&numsectors, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SHORTPTR | GAMEVAR_FLAG_READONLY);
AddGameVar("current_menu",(intptr_t)&current_menu, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY);
AddGameVar("numplayers",(intptr_t)&numplayers, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY);
AddGameVar("viewingrange",(intptr_t)&viewingrange, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
AddGameVar("yxaspect",(intptr_t)&yxaspect, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
@ -1488,6 +1489,7 @@ void ResetPointerVars(void)
aGameVars[GetGameID("lastvisinc")].lValue = (intptr_t)&lastvisinc;
aGameVars[GetGameID("numsectors")].lValue = (intptr_t)&numsectors;
aGameVars[GetGameID("numplayers")].lValue = (intptr_t)&numplayers;
aGameVars[GetGameID("current_menu")].lValue = (intptr_t)&current_menu;
aGameVars[GetGameID("viewingrange")].lValue = (intptr_t)&viewingrange;
aGameVars[GetGameID("yxaspect")].lValue = (intptr_t)&yxaspect;
aGameVars[GetGameID("gravitationalconstant")].lValue = (intptr_t)&gc;