1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-19 17:09:40 +00:00

Merge remote-tracking branch 'scrawl/untilhealed'

This commit is contained in:
Marc Zinnschlag 2013-07-30 22:41:05 +02:00
commit 958b0c4915

View file

@ -216,7 +216,13 @@ namespace MWGui
void WaitDialog::setCanRest (bool canRest)
{
mUntilHealedButton->setVisible(canRest);
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
bool full = (stats.getFatigue().getCurrent() >= stats.getFatigue().getModified())
&& (stats.getHealth().getCurrent() >= stats.getHealth().getModified())
&& (stats.getMagicka().getCurrent() >= stats.getMagicka().getModified());
mUntilHealedButton->setVisible(canRest && !full);
mWaitButton->setCaptionWithReplacing (canRest ? "#{sRest}" : "#{sWait}");
mRestText->setCaptionWithReplacing (canRest ? "#{sRestMenu3}" : "#{sRestIllegal}");