Only clear dialogue history if the dialogue window is closed (bug #5358)

pull/578/head
Capostrophic 5 years ago
parent b42d097739
commit 9dbdbbaea7

@ -1,6 +1,7 @@
0.47.0
------
Bug #5358: ForceGreeting always resets the dialogue window completely
0.46.0
------

@ -354,7 +354,10 @@ namespace MWGui
void DialogueWindow::onByeClicked(MyGUI::Widget* _sender)
{
if (exit())
{
resetHistory();
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
}
}
void DialogueWindow::onSelectListItem(const std::string& topic, int id)
@ -418,9 +421,7 @@ namespace MWGui
bool sameActor = (mPtr == actor);
if (!sameActor)
{
for (DialogueText* text : mHistoryContents)
delete text;
mHistoryContents.clear();
// The history is not reset here
mKeywords.clear();
mTopicsList->clear();
for (Link* link : mLinks)
@ -475,6 +476,13 @@ namespace MWGui
mDeleteLater.clear();
}
void DialogueWindow::resetHistory()
{
for (DialogueText* text : mHistoryContents)
delete text;
mHistoryContents.clear();
}
void DialogueWindow::setKeywords(std::list<std::string> keyWords)
{
if (mKeywords == keyWords && isCompanion() == mIsCompanion)
@ -655,6 +663,7 @@ namespace MWGui
void DialogueWindow::onGoodbyeActivated()
{
resetHistory();
MWBase::Environment::get().getDialogueManager()->goodbyeSelected();
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
resetReference();
@ -709,6 +718,7 @@ namespace MWGui
void DialogueWindow::onReferenceUnavailable()
{
resetHistory();
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
}

@ -156,6 +156,7 @@ namespace MWGui
void updateDisposition();
void restock();
void deleteLater();
void resetHistory();
bool mIsCompanion;
std::list<std::string> mKeywords;

Loading…
Cancel
Save