From 485ed903c4d8f17f18fb3170df77851b06e338a0 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 11 May 2019 19:49:11 +0300 Subject: [PATCH] Enchanting window stays open after a failed attempt (feature #5034) --- CHANGELOG.md | 1 + apps/openmw/mwgui/enchantingdialog.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be672229..9380019ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,6 +115,7 @@ Feature #5010: Native graphics herbalism support Feature #5031: Make GetWeaponType function return different values for tools Feature #5033: Magic armor mitigation for creatures + Feature #5034: Make enchanting window stay open after a failed attempt Feature #5036: Allow scripted faction leaving Task #4686: Upgrade media decoder to a more current FFmpeg API Task #4695: Optimize Distant Terrain memory consumption diff --git a/apps/openmw/mwgui/enchantingdialog.cpp b/apps/openmw/mwgui/enchantingdialog.cpp index fbdc1bf80..7768aa945 100644 --- a/apps/openmw/mwgui/enchantingdialog.cpp +++ b/apps/openmw/mwgui/enchantingdialog.cpp @@ -366,13 +366,19 @@ namespace MWGui { MWBase::Environment::get().getWindowManager()->playSound("enchant success"); MWBase::Environment::get().getWindowManager()->messageBox ("#{sEnchantmentMenu12}"); + MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting); } else { MWBase::Environment::get().getWindowManager()->playSound("enchant fail"); MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage34}"); + if (!mEnchanting.getGem().isEmpty() && !mEnchanting.getGem().getRefData().getCount()) + { + setSoulGem(MWWorld::Ptr()); + mEnchanting.nextCastStyle(); + updateLabels(); + updateEffectsView(); + } } - - MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting); } }