- Moved Strife conversation data into FLevelLocals.
This commit is contained in:
parent
0e5986769e
commit
0a6b6173de
10 changed files with 91 additions and 82 deletions
|
|
@ -40,12 +40,15 @@
|
|||
#include "actor.h"
|
||||
#include "a_pickups.h"
|
||||
#include "w_wad.h"
|
||||
#include "g_levellocals.h"
|
||||
|
||||
#define Zd 1
|
||||
#define St 2
|
||||
|
||||
class USDFParser : public UDMFParserBase
|
||||
{
|
||||
FLevelLocals *Level;
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Checks an actor type (different representation depending on namespace)
|
||||
|
|
@ -300,7 +303,7 @@ class USDFParser : public UDMFParserBase
|
|||
FStrifeDialogueNode *node = new FStrifeDialogueNode;
|
||||
FStrifeDialogueReply **replyptr = &node->Children;
|
||||
|
||||
node->ThisNodeNum = StrifeDialogues.Push(node);
|
||||
node->ThisNodeNum = Level->StrifeDialogues.Push(node);
|
||||
node->ItemCheckNode = -1;
|
||||
|
||||
FString SpeakerName;
|
||||
|
|
@ -403,7 +406,7 @@ class USDFParser : public UDMFParserBase
|
|||
PClassActor *type = nullptr;
|
||||
int dlgid = -1;
|
||||
FName clsid = NAME_None;
|
||||
unsigned int startpos = StrifeDialogues.Size();
|
||||
unsigned int startpos = Level->StrifeDialogues.Size();
|
||||
|
||||
while (!sc.CheckToken('}'))
|
||||
{
|
||||
|
|
@ -455,11 +458,11 @@ class USDFParser : public UDMFParserBase
|
|||
sc.ScriptMessage("No valid actor type defined in conversation.");
|
||||
return false;
|
||||
}
|
||||
SetConversation(dlgid, type, startpos);
|
||||
for(;startpos < StrifeDialogues.Size(); startpos++)
|
||||
Level->SetConversation(dlgid, type, startpos);
|
||||
for(;startpos < Level->StrifeDialogues.Size(); startpos++)
|
||||
{
|
||||
StrifeDialogues[startpos]->SpeakerType = type;
|
||||
StrifeDialogues[startpos]->MenuClassName = clsid;
|
||||
Level->StrifeDialogues[startpos]->SpeakerType = type;
|
||||
Level->StrifeDialogues[startpos]->MenuClassName = clsid;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -471,8 +474,9 @@ class USDFParser : public UDMFParserBase
|
|||
//===========================================================================
|
||||
|
||||
public:
|
||||
bool Parse(int lumpnum, FileReader &lump, int lumplen)
|
||||
bool Parse(FLevelLocals *l, int lumpnum, FileReader &lump, int lumplen)
|
||||
{
|
||||
Level = l;
|
||||
sc.OpenMem(Wads.GetLumpFullName(lumpnum), lump.Read(lumplen));
|
||||
sc.SetCMode(true);
|
||||
// Namespace must be the first field because everything else depends on it.
|
||||
|
|
@ -512,7 +516,7 @@ public:
|
|||
{
|
||||
sc.MustGetToken('=');
|
||||
sc.MustGetToken(TK_StringConst);
|
||||
LoadScriptFile(sc.String, true);
|
||||
LoadScriptFile(Level, sc.String, true);
|
||||
sc.MustGetToken(';');
|
||||
}
|
||||
else
|
||||
|
|
@ -526,13 +530,13 @@ public:
|
|||
|
||||
|
||||
|
||||
bool P_ParseUSDF(int lumpnum, FileReader &lump, int lumplen)
|
||||
bool P_ParseUSDF(FLevelLocals *l, int lumpnum, FileReader &lump, int lumplen)
|
||||
{
|
||||
USDFParser parse;
|
||||
|
||||
try
|
||||
{
|
||||
if (!parse.Parse(lumpnum, lump, lumplen))
|
||||
if (!parse.Parse(l, lumpnum, lump, lumplen))
|
||||
{
|
||||
// clean up the incomplete dialogue structures here
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue