Don't show disposition bar for creatures

deque
scrawl 11 years ago
parent 4aab4e1c26
commit 44fd526c98

@ -586,13 +586,32 @@ namespace MWGui
//Clear the list of topics //Clear the list of topics
mTopicsList->clear(); mTopicsList->clear();
if (mPtr.getTypeName() == typeid(ESM::NPC).name()) bool dispositionVisible = false;
if (mPtr.getClass().isNpc())
{ {
dispositionVisible = true;
mDispositionBar->setProgressRange(100); mDispositionBar->setProgressRange(100);
mDispositionBar->setProgressPosition(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr)); mDispositionBar->setProgressPosition(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr));
mDispositionText->eraseText(0, mDispositionText->getTextLength()); mDispositionText->eraseText(0, mDispositionText->getTextLength());
mDispositionText->addText("#B29154"+boost::lexical_cast<std::string>(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr))+std::string("/100")+"#B29154"); mDispositionText->addText("#B29154"+boost::lexical_cast<std::string>(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr))+std::string("/100")+"#B29154");
} }
bool dispositionWasVisible = mDispositionBar->getVisible();
if (dispositionVisible && !dispositionWasVisible)
{
mDispositionBar->setVisible(true);
float offset = mDispositionBar->getHeight()+5;
mTopicsList->setCoord(mTopicsList->getCoord() + MyGUI::IntCoord(0,offset,0,-offset));
mTopicsList->adjustSize();
}
else if (!dispositionVisible && dispositionWasVisible)
{
mDispositionBar->setVisible(false);
float offset = mDispositionBar->getHeight()+5;
mTopicsList->setCoord(mTopicsList->getCoord() - MyGUI::IntCoord(0,offset,0,-offset));
mTopicsList->adjustSize();
}
} }
void DialogueWindow::goodbye() void DialogueWindow::goodbye()

@ -170,7 +170,7 @@ namespace MWGui
BookPage* mHistory; BookPage* mHistory;
Widgets::MWList* mTopicsList; Widgets::MWList* mTopicsList;
MyGUI::ScrollBar* mScrollBar; MyGUI::ScrollBar* mScrollBar;
MyGUI::ProgressPtr mDispositionBar; MyGUI::Progress* mDispositionBar;
MyGUI::EditBox* mDispositionText; MyGUI::EditBox* mDispositionText;
PersuasionDialog mPersuasionDialog; PersuasionDialog mPersuasionDialog;

@ -13,6 +13,7 @@
<Property key="Colour" value="0000FF"/> <Property key="Colour" value="0000FF"/>
<Property key="Static" value="1"/> <Property key="Static" value="1"/>
<Property key="WordWrap" value="true"/> <Property key="WordWrap" value="true"/>
<Property key="TextShadow" value="true"/>
<Child type="TextBox" skin="MW_DispEdit" offset="0 0 0 -4" align="Stretch" name="Client"/> <Child type="TextBox" skin="MW_DispEdit" offset="0 0 0 -4" align="Stretch" name="Client"/>
</Skin> </Skin>

Loading…
Cancel
Save