1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:53:52 +00:00

Don't regenerate the topics list unconditionally

This commit is contained in:
Alexei Dobrohotov 2020-12-12 22:43:06 +03:00
parent daf6c9f88f
commit 817ac4cfbd
2 changed files with 12 additions and 6 deletions

View file

@ -451,6 +451,7 @@ namespace MWGui
setTitle(mPtr.getClass().getName(mPtr));
updateTopics();
updateTopicsPane(); // force update for new services
updateDisposition();
restock();
@ -487,12 +488,14 @@ namespace MWGui
mHistoryContents.clear();
}
void DialogueWindow::setKeywords(std::list<std::string> keyWords)
bool DialogueWindow::setKeywords(std::list<std::string> keyWords)
{
if (mKeywords == keyWords && isCompanion() == mIsCompanion)
return;
return false;
mIsCompanion = isCompanion();
mKeywords = keyWords;
updateTopicsPane();
return true;
}
void DialogueWindow::updateTopicsPane()
@ -556,6 +559,8 @@ namespace MWGui
mTopicsList->adjustSize();
updateHistory();
// The topics list has been regenerated so topic formatting needs to be updated
updateTopicFormat();
}
void DialogueWindow::updateHistory(bool scrollbar)
@ -758,8 +763,8 @@ namespace MWGui
void DialogueWindow::updateTopics()
{
setKeywords(MWBase::Environment::get().getDialogueManager()->getAvailableTopics());
updateTopicsPane();
// Topic formatting needs to be updated regardless of whether the topic list has changed
if (!setKeywords(MWBase::Environment::get().getDialogueManager()->getAvailableTopics()))
updateTopicFormat();
}

View file

@ -122,7 +122,8 @@ namespace MWGui
void setPtr(const MWWorld::Ptr& actor) override;
void setKeywords(std::list<std::string> keyWord);
/// @return true if stale keywords were updated successfully
bool setKeywords(std::list<std::string> keyWord);
void addResponse (const std::string& title, const std::string& text, bool needMargin = true);