diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 81aad7bb9..f1523bf30 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -803,6 +803,13 @@ enum events { EVENT_DISPLAYLOADINGSCREEN }; +enum sysstrs { + STR_MAPNAME, + STR_MAPFILENAME, + STR_PLAYERNAME, + STR_VERSION +}; + // store global game definitions diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 557138a9d..8dec9a0e3 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -451,6 +451,7 @@ static const char *keyw[] = "writearraytofile", // 319 "readarrayfromfile", // 320 "starttrackvar", // 321 + "qgetsysstr", // 322 "" }; @@ -4061,6 +4062,7 @@ repeatcase: case CON_QSTRCAT: case CON_QSTRCPY: case CON_QSTRLEN: + case CON_QGETSYSSTR: case CON_HEADSPRITESTAT: case CON_PREVSPRITESTAT: case CON_NEXTSPRITESTAT: @@ -4963,6 +4965,11 @@ static void AddDefaultDefinitions(void) AddDefinition("EVENT_KILLIT",EVENT_KILLIT,LABEL_DEFINE); AddDefinition("EVENT_LOADACTOR",EVENT_LOADACTOR,LABEL_DEFINE); + AddDefinition("STR_MAPNAME",STR_MAPNAME,LABEL_DEFINE); + AddDefinition("STR_MAPFILENAME",STR_MAPFILENAME,LABEL_DEFINE); + AddDefinition("STR_PLAYERNAME",STR_PLAYERNAME,LABEL_DEFINE); + AddDefinition("STR_VERSION",STR_VERSION,LABEL_DEFINE); + AddDefinition("NO",0,LABEL_DEFINE|LABEL_ACTION|LABEL_AI|LABEL_MOVE); AddDefinition("PROJ_BOUNCES",PROJ_BOUNCES,LABEL_DEFINE); diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 6b9fdc4e3..58f0575ce 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -811,4 +811,5 @@ enum keywords CON_WRITEARRAYTOFILE, // 319 CON_READARRAYFROMFILE, // 320 CON_STARTTRACKVAR, // 321 + CON_QGETSYSSTR, // 322 }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 2988a3813..b92283a04 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5106,6 +5106,7 @@ static int parse(void) case CON_GETPNAME: case CON_QSTRCAT: case CON_QSTRCPY: + case CON_QGETSYSSTR: case CON_CHANGESPRITESTAT: case CON_CHANGESPRITESECT: insptr++; @@ -5129,6 +5130,27 @@ static int parse(void) } else OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,i); break; + case CON_QGETSYSSTR: + if (fta_quotes[i] != NULL) + switch(j) + { + case STR_MAPNAME: + Bstrcpy(fta_quotes[i],map[ud.volume_number*MAXLEVELS + ud.level_number].name); + break; + case STR_MAPFILENAME: + Bstrcpy(fta_quotes[i],map[ud.volume_number*MAXLEVELS + ud.level_number].filename); + break; + case STR_PLAYERNAME: + Bstrcpy(fta_quotes[i],g_player[g_p].user_name); + break; + case STR_VERSION: + Bstrcpy(fta_quotes[i],HEAD2); + break; + default: + OSD_Printf("%s %d unknown str ID %d %d\n",__FILE__,__LINE__,i,j); + } + else OSD_Printf("%s %d null quote %d %d\n",__FILE__,__LINE__,i,j); + break; case CON_QSTRCAT: if (fta_quotes[i] != NULL && fta_quotes[j] != NULL) Bstrncat(fta_quotes[i],fta_quotes[j],(MAXQUOTELEN-1)-Bstrlen(fta_quotes[i]));