mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 07:51:43 +00:00
Added page tags and find page by tag
* Added tutorial mode defines to this branch
This commit is contained in:
parent
33a94ba2b8
commit
e1e94c3af2
7 changed files with 44 additions and 0 deletions
|
@ -1727,6 +1727,8 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
|
|||
textprompts[num]->page[pagenum].hidehud = textprompts[num]->page[metapagenum].hidehud;
|
||||
}
|
||||
}
|
||||
else if (fastcmp(word, "TAG"))
|
||||
strncpy(textprompts[num]->page[pagenum].tag, word2, 25);
|
||||
else if (fastcmp(word, "NEXTPROMPT"))
|
||||
textprompts[num]->page[pagenum].nextprompt = usi;
|
||||
else if (fastcmp(word, "NEXTPAGE"))
|
||||
|
|
|
@ -129,6 +129,9 @@ extern INT16 titlemap;
|
|||
extern boolean hidetitlepics;
|
||||
extern INT16 bootmap; //bootmap for loading a map on startup
|
||||
|
||||
extern INT16 tutorialmap; // map to load for tutorial
|
||||
extern boolean tutorialmode; // are we in a tutorial right now?
|
||||
|
||||
extern boolean looptitle;
|
||||
|
||||
// CTF colors.
|
||||
|
@ -171,6 +174,7 @@ extern cutscene_t *cutscenes[128];
|
|||
|
||||
typedef struct
|
||||
{
|
||||
char tag[25]; // page tag (24 chars due to texture concatenating)
|
||||
char name[32]; // narrator name
|
||||
char iconname[8]; // narrator icon lump
|
||||
boolean rightside; // narrator side, false = left, true = right
|
||||
|
|
|
@ -2233,6 +2233,36 @@ void F_StartTextPrompt(INT32 promptnum, INT32 pagenum, mobj_t *mo, UINT16 postex
|
|||
F_EndTextPrompt(true, false); // run the post-effects immediately
|
||||
}
|
||||
|
||||
void F_StartTextPromptByNamedTag(char *tag, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime)
|
||||
{
|
||||
INT32 promptnum, pagenum;
|
||||
char realtag[25];
|
||||
|
||||
strncpy(realtag, tag, 25);
|
||||
realtag[24] = 0;
|
||||
|
||||
// \todo hardcoded tutorial mode behavior: concat control mode (fps, platform, custom) to end of input tag
|
||||
if (tutorialmode)
|
||||
strncat(realtag, "FPS", 25);
|
||||
|
||||
for (promptnum = 0; promptnum < MAX_PROMPTS; promptnum++)
|
||||
{
|
||||
if (!textprompts[promptnum])
|
||||
continue;
|
||||
|
||||
for (pagenum = 0; pagenum < textprompts[promptnum]->numpages && pagenum < MAX_PAGES; pagenum++)
|
||||
{
|
||||
if (!strncmp(realtag, textprompts[promptnum]->page[pagenum].tag, 25))
|
||||
{
|
||||
F_StartTextPrompt(promptnum, pagenum, mo, postexectag, blockcontrols, freezerealtime);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CONS_Debug(DBG_GAMELOGIC, "Text prompt: Can't find a page with named tag %s\n", realtag);
|
||||
}
|
||||
|
||||
void F_TextPromptDrawer(void)
|
||||
{
|
||||
// reuse:
|
||||
|
|
|
@ -53,6 +53,7 @@ void F_CutsceneDrawer(void);
|
|||
void F_EndCutScene(void);
|
||||
|
||||
void F_StartTextPrompt(INT32 promptnum, INT32 pagenum, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime);
|
||||
void F_StartTextPromptByNamedTag(char *tag, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime);
|
||||
void F_TextPromptDrawer(void);
|
||||
void F_EndTextPrompt(boolean forceexec, boolean noexec);
|
||||
boolean F_GetPromptHideHudAll(void);
|
||||
|
|
|
@ -127,6 +127,9 @@ INT16 titlemap = 0;
|
|||
boolean hidetitlepics = false;
|
||||
INT16 bootmap; //bootmap for loading a map on startup
|
||||
|
||||
INT16 tutorialmap = 0; // map to load for tutorial
|
||||
boolean tutorialmode = false; // are we in a tutorial right now?
|
||||
|
||||
boolean looptitle = false;
|
||||
|
||||
UINT8 skincolor_redteam = SKINCOLOR_RED;
|
||||
|
|
|
@ -1541,6 +1541,7 @@ static void P_LoadRawSideDefs2(void *data)
|
|||
}
|
||||
|
||||
case 443: // Calls a named Lua function
|
||||
case 459: // Control text prompt (named tag)
|
||||
{
|
||||
char process[8*3+1];
|
||||
memset(process,0,8*3+1);
|
||||
|
|
|
@ -3771,9 +3771,12 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
boolean blockcontrols = !(line->flags & ML_EFFECT2);
|
||||
boolean freezerealtime = !(line->flags & ML_EFFECT3);
|
||||
//boolean freezethinkers = (line->flags & ML_EFFECT4);
|
||||
boolean callbynamedtag = (line->flags & ML_TFERLINE);
|
||||
|
||||
if (closetextprompt)
|
||||
F_EndTextPrompt(false, false);
|
||||
else if (callbynamedtag && sides[line->sidenum[0]].text && sides[line->sidenum[0]].text[0])
|
||||
F_StartTextPromptByNamedTag(sides[line->sidenum[0]].text, mo, runpostexec ? postexectag : 0, blockcontrols, freezerealtime);
|
||||
else
|
||||
F_StartTextPrompt(promptnum, pagenum, mo, runpostexec ? postexectag : 0, blockcontrols, freezerealtime);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue