- externalized the "You seem to have enough" string to language lump.

- allow all texts in conversations to reference the string table.
- fixed: If no dialogue is found for the current map, SCRIPT00 should still be loaded.


SVN r2577 (trunk)
This commit is contained in:
Christoph Oelckers 2010-08-24 09:53:10 +00:00
parent c058c644a4
commit f08c66d664
2 changed files with 37 additions and 3 deletions

View file

@ -207,7 +207,10 @@ void P_LoadStrifeConversations (MapData *map, const char *mapname)
if (!LoadScriptFile(scriptname_t, false, 2))
{
LoadScriptFile (scriptname_b, false, 1);
if (!LoadScriptFile (scriptname_b, false, 1))
{
LoadScriptFile ("SCRIPT00", false, 1);
}
}
}
}
@ -813,6 +816,18 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
toSay = "Go away!"; // Ok, it's lame - but it doesn't look like an error to the player. ;)
}
}
else
{
// handle string table replacement
if (toSay[0] == '$')
{
toSay = GStrings(toSay + 1);
}
}
if (toSay == NULL)
{
toSay = ".";
}
DialogueLines = V_BreakLines (SmallFont, screen->GetWidth()/CleanXfac - 24*2, toSay);
// Fill out the possible choices
@ -830,6 +845,12 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
for (j = 0; reply->ReplyLines[j].Width >= 0; ++j)
{
item.label = reply->ReplyLines[j].Text.LockBuffer();
// handle string table replacement
if (item.label[0] == '$')
{
item.label = GStrings(item.label + 1);
}
item.b.position = j == 0 ? i : 0;
item.c.extra = reply;
ConversationItems.Push (item);
@ -1207,13 +1228,19 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
}
else
{
replyText = "You seem to have enough!";
replyText = "$txt_haveenough";
}
// Update the quest log, if needed.
if (reply->LogString != NULL)
{
player->SetLogText(reply->LogString);
const char *log = reply->LogString;
if (log[0] == '$')
{
log = GStrings(log + 1);
}
player->SetLogText(log);
}
else if (reply->LogNumber != 0)
{
@ -1366,6 +1393,12 @@ static void TerminalResponse (const char *str)
{
if (str != NULL)
{
// handle string table replacement
if (str[0] == '$')
{
str = GStrings(str + 1);
}
if (StatusBar != NULL)
{
AddToConsole(-1, str);

View file

@ -1476,6 +1476,7 @@ TXT_RANDOM_PGUARD_10 = "If there is any honor inside that pathetic shell of a bo
TXT_RANDOMGOODBYE_1 = "Bye!";
TXT_RANDOMGOODBYE_2 = "Thanks, bye!";
TXT_RANDOMGOODBYE_3 = "See you later!";
TXT_HAVEENOUGH = "You seem to have enough!";
// Skills: