Always update the ingredient icons (Fixes #3220)

move
scrawl 9 years ago
parent 27577ce765
commit 04d51d5871

@ -67,46 +67,29 @@ namespace MWGui
{ {
MWMechanics::Alchemy::Result result = mAlchemy->create (mNameEdit->getCaption ()); MWMechanics::Alchemy::Result result = mAlchemy->create (mNameEdit->getCaption ());
if (result == MWMechanics::Alchemy::Result_NoName) switch (result)
{ {
case MWMechanics::Alchemy::Result_NoName:
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage37}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage37}");
return; break;
} case MWMechanics::Alchemy::Result_NoMortarAndPestle:
// check if mortar & pestle is available (always needed)
if (result == MWMechanics::Alchemy::Result_NoMortarAndPestle)
{
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage45}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage45}");
return; break;
} case MWMechanics::Alchemy::Result_LessThanTwoIngredients:
// make sure 2 or more ingredients were selected
if (result == MWMechanics::Alchemy::Result_LessThanTwoIngredients)
{
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage6a}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage6a}");
return; break;
} case MWMechanics::Alchemy::Result_Success:
if (result == MWMechanics::Alchemy::Result_NoEffects)
{
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage8}");
MWBase::Environment::get().getSoundManager()->playSound("potion fail", 1.f, 1.f);
return;
}
if (result == MWMechanics::Alchemy::Result_Success)
{
MWBase::Environment::get().getWindowManager()->messageBox("#{sPotionSuccess}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sPotionSuccess}");
MWBase::Environment::get().getSoundManager()->playSound("potion success", 1.f, 1.f); MWBase::Environment::get().getSoundManager()->playSound("potion success", 1.f, 1.f);
} break;
else if (result == MWMechanics::Alchemy::Result_RandomFailure) case MWMechanics::Alchemy::Result_NoEffects:
{ case MWMechanics::Alchemy::Result_RandomFailure:
// potion failed
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage8}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage8}");
MWBase::Environment::get().getSoundManager()->playSound("potion fail", 1.f, 1.f); MWBase::Environment::get().getSoundManager()->playSound("potion fail", 1.f, 1.f);
break;
} }
// reduce count of the ingredients // remove ingredient slots that have been fully used up
for (int i=0; i<4; ++i) for (int i=0; i<4; ++i)
if (mIngredients[i]->isUserString("ToolTipType")) if (mIngredients[i]->isUserString("ToolTipType"))
{ {

Loading…
Cancel
Save