diff --git a/apps/openmw/mwgui/enchantingdialog.cpp b/apps/openmw/mwgui/enchantingdialog.cpp index af4a3e8ce3..acd9764e3b 100644 --- a/apps/openmw/mwgui/enchantingdialog.cpp +++ b/apps/openmw/mwgui/enchantingdialog.cpp @@ -50,7 +50,7 @@ namespace MWGui getWidget(mBuyButton, "BuyButton"); getWidget(mPrice, "PriceLabel"); getWidget(mPriceText, "PriceTextLabel"); - + getWidget(mPlayerGold, "PlayerGold"); setWidgets(mAvailableEffectsList, mUsedEffectsView); mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EnchantingDialog::onCancelButtonClicked); @@ -65,6 +65,10 @@ namespace MWGui { center(); MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mName); + + MWWorld::Ptr player = MWMechanics::getPlayer(); + int playerGold = player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId); + mPlayerGold->setCaptionWithReplacing(MyGUI::utility::toString(playerGold)); } void EnchantingDialog::setSoulGem(const MWWorld::Ptr& gem) diff --git a/apps/openmw/mwgui/enchantingdialog.hpp b/apps/openmw/mwgui/enchantingdialog.hpp index 4c720a11fc..616d8cb89c 100644 --- a/apps/openmw/mwgui/enchantingdialog.hpp +++ b/apps/openmw/mwgui/enchantingdialog.hpp @@ -70,6 +70,7 @@ namespace MWGui MyGUI::TextBox* mSuccessChance; MyGUI::TextBox* mPrice; MyGUI::TextBox* mPriceText; + MyGUI::TextBox* mPlayerGold; MWMechanics::Enchanting mEnchanting; ESM::EffectList mEffectList; diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp index d8302df87c..c9556a0e2c 100644 --- a/apps/openmw/mwgui/spellcreationdialog.cpp +++ b/apps/openmw/mwgui/spellcreationdialog.cpp @@ -30,7 +30,6 @@ namespace { - bool sortMagicEffects(short id1, short id2) { const MWWorld::Store& gmst @@ -352,6 +351,7 @@ namespace MWGui getWidget(mAvailableEffectsList, "AvailableEffects"); getWidget(mUsedEffectsView, "UsedEffects"); getWidget(mPriceLabel, "PriceLabel"); + getWidget(mPlayerGold, "PlayerGold"); getWidget(mBuyButton, "BuyButton"); getWidget(mCancelButton, "CancelButton"); @@ -370,6 +370,10 @@ namespace MWGui mPtr = actor; mNameEdit->setCaption({}); + MWWorld::Ptr player = MWMechanics::getPlayer(); + int playerGold = player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId); + mPlayerGold->setCaptionWithReplacing(MyGUI::utility::toString(playerGold)); + startEditing(); } diff --git a/apps/openmw/mwgui/spellcreationdialog.hpp b/apps/openmw/mwgui/spellcreationdialog.hpp index 6dfe61fc57..0887dd8c94 100644 --- a/apps/openmw/mwgui/spellcreationdialog.hpp +++ b/apps/openmw/mwgui/spellcreationdialog.hpp @@ -175,6 +175,7 @@ namespace MWGui MyGUI::Button* mBuyButton; MyGUI::Button* mCancelButton; MyGUI::TextBox* mPriceLabel; + MyGUI::TextBox* mPlayerGold; ESM::Spell mSpell; }; diff --git a/files/data/mygui/openmw_enchanting_dialog.layout b/files/data/mygui/openmw_enchanting_dialog.layout index c0e3ba0d21..839de8d399 100644 --- a/files/data/mygui/openmw_enchanting_dialog.layout +++ b/files/data/mygui/openmw_enchanting_dialog.layout @@ -138,6 +138,14 @@ + + + + + + + + diff --git a/files/data/mygui/openmw_spellcreation_dialog.layout b/files/data/mygui/openmw_spellcreation_dialog.layout index c284927a37..9ab895833a 100644 --- a/files/data/mygui/openmw_spellcreation_dialog.layout +++ b/files/data/mygui/openmw_spellcreation_dialog.layout @@ -41,7 +41,7 @@ - + @@ -68,6 +68,15 @@ + + + + + + + + + @@ -79,7 +88,6 @@ -