forked from teamnwah/openmw-tes3coop
Fix a 'Good Beast' companion window
This commit is contained in:
parent
9be27193a3
commit
eaff7e30aa
2 changed files with 10 additions and 4 deletions
|
@ -391,8 +391,8 @@ namespace MWGui
|
||||||
// No greetings found. The dialogue window should not be shown.
|
// No greetings found. The dialogue window should not be shown.
|
||||||
// If this is a companion, we must show the companion window directly (used by BM_bear_be_unique).
|
// If this is a companion, we must show the companion window directly (used by BM_bear_be_unique).
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
|
||||||
if (isCompanion())
|
if (isCompanion(actor))
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Companion, mPtr);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Companion, actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,8 +698,13 @@ namespace MWGui
|
||||||
|
|
||||||
bool DialogueWindow::isCompanion()
|
bool DialogueWindow::isCompanion()
|
||||||
{
|
{
|
||||||
return !mPtr.getClass().getScript(mPtr).empty()
|
return isCompanion(mPtr);
|
||||||
&& mPtr.getRefData().getLocals().getIntVar(mPtr.getClass().getScript(mPtr), "companion");
|
}
|
||||||
|
|
||||||
|
bool DialogueWindow::isCompanion(const MWWorld::Ptr& actor)
|
||||||
|
{
|
||||||
|
return !actor.getClass().getScript(actor).empty()
|
||||||
|
&& actor.getRefData().getLocals().getIntVar(actor.getClass().getScript(actor), "companion");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::onPersuadeResult(const std::string &title, const std::string &text)
|
void DialogueWindow::onPersuadeResult(const std::string &title, const std::string &text)
|
||||||
|
|
|
@ -133,6 +133,7 @@ namespace MWGui
|
||||||
protected:
|
protected:
|
||||||
void updateTopics();
|
void updateTopics();
|
||||||
void updateTopicsPane();
|
void updateTopicsPane();
|
||||||
|
bool isCompanion(const MWWorld::Ptr& actor);
|
||||||
bool isCompanion();
|
bool isCompanion();
|
||||||
|
|
||||||
void onPersuadeResult(const std::string& title, const std::string& text);
|
void onPersuadeResult(const std::string& title, const std::string& text);
|
||||||
|
|
Loading…
Reference in a new issue