mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-12-11 12:51:27 +00:00
This commit is contained in:
commit
a61f76dc89
7 changed files with 38 additions and 15 deletions
|
@ -87,14 +87,16 @@ conversation // Starts a dialog.
|
||||||
|
|
||||||
page // Starts a new page. Pages are automatically numbered starting at 1.
|
page // Starts a new page. Pages are automatically numbered starting at 1.
|
||||||
{
|
{
|
||||||
name = <string>; // Name that goes in the upper left hand corner
|
name = <string>; // Name that goes in the upper left hand corner
|
||||||
panel = <string>; // Name of lump to render as the background.
|
panel = <string>; // Name of lump to render as the background.
|
||||||
voice = <string>; // Narration sound lump.
|
voice = <string>; // Narration sound lump.
|
||||||
dialog = <string>; // Dialog of the page.
|
dialog = <string>; // Dialog of the page.
|
||||||
drop = <integer>; // mobj for the object to drop if the actor is
|
goodbye = <string>; // Custom goodbye message. If omitted then the
|
||||||
// killed.
|
// generic goodbyes will be displayed instead.
|
||||||
link = <integer>; // Page to jump to if all ifitem conditions are
|
drop = <integer>; // mobj for the object to drop if the actor is
|
||||||
// satisified.
|
// killed.
|
||||||
|
link = <integer>; // Page to jump to if all ifitem conditions are
|
||||||
|
// satisified.
|
||||||
|
|
||||||
// jumps to the specified page if the player has the specified amount
|
// jumps to the specified page if the player has the specified amount
|
||||||
// or more of item in their inventory. This can be repeated as many
|
// or more of item in their inventory. This can be repeated as many
|
||||||
|
|
|
@ -584,6 +584,7 @@ xx(Dialog)
|
||||||
xx(Ifitem)
|
xx(Ifitem)
|
||||||
xx(Choice)
|
xx(Choice)
|
||||||
xx(Link)
|
xx(Link)
|
||||||
|
xx(Goodbye)
|
||||||
|
|
||||||
// Special menus
|
// Special menus
|
||||||
xx(Mainmenu)
|
xx(Mainmenu)
|
||||||
|
|
|
@ -556,6 +556,7 @@ FStrifeDialogueNode::~FStrifeDialogueNode ()
|
||||||
{
|
{
|
||||||
if (SpeakerName != NULL) delete[] SpeakerName;
|
if (SpeakerName != NULL) delete[] SpeakerName;
|
||||||
if (Dialogue != NULL) delete[] Dialogue;
|
if (Dialogue != NULL) delete[] Dialogue;
|
||||||
|
if (Goodbye != nullptr) delete[] Goodbye;
|
||||||
FStrifeDialogueReply *tokill = Children;
|
FStrifeDialogueReply *tokill = Children;
|
||||||
while (tokill != NULL)
|
while (tokill != NULL)
|
||||||
{
|
{
|
||||||
|
@ -743,10 +744,25 @@ public:
|
||||||
++i;
|
++i;
|
||||||
V_FreeBrokenLines (ReplyLines);
|
V_FreeBrokenLines (ReplyLines);
|
||||||
}
|
}
|
||||||
char goodbye[25];
|
const char *goodbyestr = CurNode->Goodbye;
|
||||||
mysnprintf(goodbye, countof(goodbye), "TXT_RANDOMGOODBYE_%d", 1+(pr_randomspeech() % NUM_RANDOM_GOODBYES));
|
if (goodbyestr == nullptr)
|
||||||
const char *goodbyestr = GStrings[goodbye];
|
{
|
||||||
if (goodbyestr == NULL) goodbyestr = "Bye.";
|
char goodbye[25];
|
||||||
|
mysnprintf(goodbye, countof(goodbye), "TXT_RANDOMGOODBYE_%d", 1 + (pr_randomspeech() % NUM_RANDOM_GOODBYES));
|
||||||
|
goodbyestr = GStrings[goodbye];
|
||||||
|
}
|
||||||
|
else if (strncmp(goodbyestr, "RANDOM_", 7) == 0)
|
||||||
|
{
|
||||||
|
FString byetext;
|
||||||
|
|
||||||
|
byetext.Format("TXT_%s_%02d", goodbyestr, 1 + (pr_randomspeech() % NUM_RANDOM_LINES));
|
||||||
|
goodbyestr = GStrings[byetext];
|
||||||
|
}
|
||||||
|
else if (goodbyestr[0] == '$')
|
||||||
|
{
|
||||||
|
goodbyestr = GStrings(goodbyestr + 1);
|
||||||
|
}
|
||||||
|
if (goodbyestr == nullptr) goodbyestr = "Bye.";
|
||||||
mResponses.Push(mResponseLines.Size());
|
mResponses.Push(mResponseLines.Size());
|
||||||
mResponseLines.Push(FString(goodbyestr));
|
mResponseLines.Push(FString(goodbyestr));
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ struct FStrifeDialogueNode
|
||||||
FSoundID SpeakerVoice;
|
FSoundID SpeakerVoice;
|
||||||
FTextureID Backdrop;
|
FTextureID Backdrop;
|
||||||
char *Dialogue;
|
char *Dialogue;
|
||||||
|
char *Goodbye = nullptr; // must init to null for binary scripts to work as intended
|
||||||
|
|
||||||
FStrifeDialogueReply *Children;
|
FStrifeDialogueReply *Children;
|
||||||
};
|
};
|
||||||
|
|
|
@ -286,6 +286,7 @@ class USDFParser : public UDMFParserBase
|
||||||
|
|
||||||
FString SpeakerName;
|
FString SpeakerName;
|
||||||
FString Dialogue;
|
FString Dialogue;
|
||||||
|
FString Goodbye;
|
||||||
|
|
||||||
while (!sc.CheckToken('}'))
|
while (!sc.CheckToken('}'))
|
||||||
{
|
{
|
||||||
|
@ -331,7 +332,9 @@ class USDFParser : public UDMFParserBase
|
||||||
node->ItemCheckNode = CheckInt(key);
|
node->ItemCheckNode = CheckInt(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NAME_Goodbye:
|
||||||
|
Goodbye = CheckString(key);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -354,6 +357,7 @@ class USDFParser : public UDMFParserBase
|
||||||
}
|
}
|
||||||
node->SpeakerName = ncopystring(SpeakerName);
|
node->SpeakerName = ncopystring(SpeakerName);
|
||||||
node->Dialogue = ncopystring(Dialogue);
|
node->Dialogue = ncopystring(Dialogue);
|
||||||
|
node->Goodbye = ncopystring(Goodbye);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,6 @@ void DMovePoly::Serialize(FSerializer &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize (arc);
|
Super::Serialize (arc);
|
||||||
arc("angle", m_Angle)
|
arc("angle", m_Angle)
|
||||||
("speed", m_Speed);
|
|
||||||
("speedv", m_Speedv);
|
("speedv", m_Speedv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,7 @@ IMPLEMENT_CLASS (DSeqPolyNode)
|
||||||
void DSeqPolyNode::Serialize(FSerializer &arc)
|
void DSeqPolyNode::Serialize(FSerializer &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize (arc);
|
Super::Serialize (arc);
|
||||||
//arc << m_Poly;
|
arc("poly", m_Poly);
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPLEMENT_CLASS (DSeqSectorNode)
|
IMPLEMENT_CLASS (DSeqSectorNode)
|
||||||
|
|
Loading…
Reference in a new issue