Merge branch 'grayscale_dialogue' into 'master'

Fix dialogue issues

Closes #6419 and #7047

See merge request OpenMW/openmw!2478
7098-improve-post-process-behavior-with-transparent-objects
psi29a 2 years ago
commit bc1e0d3522

@ -53,14 +53,14 @@ namespace MWBase
virtual bool startDialogue(const MWWorld::Ptr& actor, ResponseCallback* callback) = 0;
virtual bool inJournal(const std::string& topicId, const std::string& infoId) = 0;
virtual bool inJournal(const std::string& topicId, const std::string& infoId) const = 0;
virtual void addTopic(std::string_view topic) = 0;
virtual void addChoice(std::string_view text, int choice) = 0;
virtual const std::vector<std::pair<std::string, int>>& getChoices() = 0;
virtual const std::vector<std::pair<std::string, int>>& getChoices() const = 0;
virtual bool isGoodbye() = 0;
virtual bool isGoodbye() const = 0;
virtual void goodbye() = 0;
@ -89,7 +89,7 @@ namespace MWBase
};
virtual std::list<std::string> getAvailableTopics() = 0;
virtual int getTopicFlag(const std::string&) = 0;
virtual int getTopicFlag(const std::string&) const = 0;
virtual bool checkServiceRefused(ResponseCallback* callback, ServiceType service = ServiceType::Any) = 0;

@ -260,7 +260,7 @@ namespace MWDialogue
}
}
bool DialogueManager::inJournal(const std::string& topicId, const std::string& infoId)
bool DialogueManager::inJournal(const std::string& topicId, const std::string& infoId) const
{
const MWDialogue::Topic* topicHistory = nullptr;
MWBase::Journal* journal = MWBase::Environment::get().getJournal();
@ -293,8 +293,7 @@ namespace MWDialogue
const ESM::Dialogue& dialogue = *dialogues.find(topic);
const ESM::DialInfo* info = mChoice == -1 && mActorKnownTopics.count(topic) ? mActorKnownTopics[topic].mInfo
: filter.search(dialogue, true);
const ESM::DialInfo* info = filter.search(dialogue, true);
if (info)
{
@ -425,9 +424,12 @@ namespace MWDialogue
return keywordList;
}
int DialogueManager::getTopicFlag(const std::string& topicId)
int DialogueManager::getTopicFlag(const std::string& topicId) const
{
return mActorKnownTopics[topicId].mFlags;
auto known = mActorKnownTopics.find(topicId);
if (known != mActorKnownTopics.end())
return known->second.mFlags;
return 0;
}
void DialogueManager::keywordSelected(const std::string& keyword, ResponseCallback* callback)
@ -526,12 +528,12 @@ namespace MWDialogue
mChoices.emplace_back(text, choice);
}
const std::vector<std::pair<std::string, int>>& DialogueManager::getChoices()
const std::vector<std::pair<std::string, int>>& DialogueManager::getChoices() const
{
return mChoices;
}
bool DialogueManager::isGoodbye()
bool DialogueManager::isGoodbye() const
{
return mGoodbye;
}

@ -82,16 +82,16 @@ namespace MWDialogue
bool startDialogue(const MWWorld::Ptr& actor, ResponseCallback* callback) override;
std::list<std::string> getAvailableTopics() override;
int getTopicFlag(const std::string& topicId) override;
int getTopicFlag(const std::string& topicId) const override;
bool inJournal(const std::string& topicId, const std::string& infoId) override;
bool inJournal(const std::string& topicId, const std::string& infoId) const override;
void addTopic(std::string_view topic) override;
void addChoice(std::string_view text, int choice) override;
const std::vector<std::pair<std::string, int>>& getChoices() override;
const std::vector<std::pair<std::string, int>>& getChoices() const override;
bool isGoodbye() override;
bool isGoodbye() const override;
void goodbye() override;

Loading…
Cancel
Save