forked from mirror/openmw-tes3mp
Remove duplicate disposition code
This commit is contained in:
parent
e8c6a3b225
commit
c5613e384e
2 changed files with 5 additions and 14 deletions
|
@ -384,7 +384,7 @@ namespace MWGui
|
||||||
delete (*it);
|
delete (*it);
|
||||||
mLinks.clear();
|
mLinks.clear();
|
||||||
|
|
||||||
updateOptions();
|
updateDisposition();
|
||||||
|
|
||||||
restock();
|
restock();
|
||||||
}
|
}
|
||||||
|
@ -579,13 +579,10 @@ namespace MWGui
|
||||||
updateHistory();
|
updateHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::updateOptions()
|
void DialogueWindow::updateDisposition()
|
||||||
{
|
{
|
||||||
//Clear the list of topics
|
|
||||||
mTopicsList->clear();
|
|
||||||
|
|
||||||
bool dispositionVisible = false;
|
bool dispositionVisible = false;
|
||||||
if (mPtr.getClass().isNpc())
|
if (!mPtr.isEmpty() && mPtr.getClass().isNpc())
|
||||||
{
|
{
|
||||||
dispositionVisible = true;
|
dispositionVisible = true;
|
||||||
mDispositionBar->setProgressRange(100);
|
mDispositionBar->setProgressRange(100);
|
||||||
|
@ -626,12 +623,6 @@ namespace MWGui
|
||||||
void DialogueWindow::onFrame(float dt)
|
void DialogueWindow::onFrame(float dt)
|
||||||
{
|
{
|
||||||
checkReferenceAvailable();
|
checkReferenceAvailable();
|
||||||
if(!mPtr.isEmpty() && mPtr.getTypeName() == typeid(ESM::NPC).name())
|
updateDisposition();
|
||||||
{
|
|
||||||
int disp = MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr);
|
|
||||||
mDispositionBar->setProgressRange(100);
|
|
||||||
mDispositionBar->setProgressPosition(disp);
|
|
||||||
mDispositionText->setCaption(MyGUI::utility::toString(disp)+std::string("/100"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ namespace MWGui
|
||||||
virtual void onReferenceUnavailable();
|
virtual void onReferenceUnavailable();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateOptions();
|
void updateDisposition();
|
||||||
void restock();
|
void restock();
|
||||||
|
|
||||||
bool mEnabled;
|
bool mEnabled;
|
||||||
|
|
Loading…
Reference in a new issue