mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Merge branch 'dialogue' into 'master'
Don't regenerate the topics list unconditionally See merge request OpenMW/openmw!459
This commit is contained in:
commit
3e87c35005
2 changed files with 12 additions and 6 deletions
|
@ -451,6 +451,7 @@ namespace MWGui
|
||||||
setTitle(mPtr.getClass().getName(mPtr));
|
setTitle(mPtr.getClass().getName(mPtr));
|
||||||
|
|
||||||
updateTopics();
|
updateTopics();
|
||||||
|
updateTopicsPane(); // force update for new services
|
||||||
|
|
||||||
updateDisposition();
|
updateDisposition();
|
||||||
restock();
|
restock();
|
||||||
|
@ -487,12 +488,14 @@ namespace MWGui
|
||||||
mHistoryContents.clear();
|
mHistoryContents.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::setKeywords(std::list<std::string> keyWords)
|
bool DialogueWindow::setKeywords(std::list<std::string> keyWords)
|
||||||
{
|
{
|
||||||
if (mKeywords == keyWords && isCompanion() == mIsCompanion)
|
if (mKeywords == keyWords && isCompanion() == mIsCompanion)
|
||||||
return;
|
return false;
|
||||||
mIsCompanion = isCompanion();
|
mIsCompanion = isCompanion();
|
||||||
mKeywords = keyWords;
|
mKeywords = keyWords;
|
||||||
|
updateTopicsPane();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::updateTopicsPane()
|
void DialogueWindow::updateTopicsPane()
|
||||||
|
@ -556,6 +559,8 @@ namespace MWGui
|
||||||
mTopicsList->adjustSize();
|
mTopicsList->adjustSize();
|
||||||
|
|
||||||
updateHistory();
|
updateHistory();
|
||||||
|
// The topics list has been regenerated so topic formatting needs to be updated
|
||||||
|
updateTopicFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::updateHistory(bool scrollbar)
|
void DialogueWindow::updateHistory(bool scrollbar)
|
||||||
|
@ -758,8 +763,8 @@ namespace MWGui
|
||||||
|
|
||||||
void DialogueWindow::updateTopics()
|
void DialogueWindow::updateTopics()
|
||||||
{
|
{
|
||||||
setKeywords(MWBase::Environment::get().getDialogueManager()->getAvailableTopics());
|
// Topic formatting needs to be updated regardless of whether the topic list has changed
|
||||||
updateTopicsPane();
|
if (!setKeywords(MWBase::Environment::get().getDialogueManager()->getAvailableTopics()))
|
||||||
updateTopicFormat();
|
updateTopicFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,8 @@ namespace MWGui
|
||||||
|
|
||||||
void setPtr(const MWWorld::Ptr& actor) override;
|
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);
|
void addResponse (const std::string& title, const std::string& text, bool needMargin = true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue