1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-31 14:36:39 +00:00

Print a fallback text when no topic response is found

This commit is contained in:
Emanuel Guevel 2013-01-20 15:57:34 +01:00
parent 43e85ea0c6
commit 736e471613

View file

@ -249,12 +249,12 @@ namespace MWDialogue
const ESM::Dialogue& dialogue = *dialogues.find (topic); const ESM::Dialogue& dialogue = *dialogues.find (topic);
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
if (const ESM::DialInfo *info = filter.search (dialogue, true)) if (const ESM::DialInfo *info = filter.search (dialogue, true))
{ {
parseText (info->mResponse); parseText (info->mResponse);
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
if (dialogue.mType==ESM::Dialogue::Persuasion) if (dialogue.mType==ESM::Dialogue::Persuasion)
{ {
std::string modifiedTopic = "s" + topic; std::string modifiedTopic = "s" + topic;
@ -278,6 +278,13 @@ namespace MWDialogue
mLastTopic = topic; mLastTopic = topic;
mLastDialogue = *info; mLastDialogue = *info;
} }
else
{
// no response found, print a fallback text
win->addTitle (topic);
win->addText ("");
}
} }
void DialogueManager::updateTopics() void DialogueManager::updateTopics()