Merge branch 'spellgc' into 'master'

Add Player Gold Counter to Spell Creation Window(Updated)

See merge request OpenMW/openmw!4737
This commit is contained in:
Skyhasacat 2025-08-02 22:19:56 +00:00
commit 8f7367c752
3 changed files with 12 additions and 0 deletions

View File

@ -352,6 +352,7 @@ namespace MWGui
getWidget(mAvailableEffectsList, "AvailableEffects"); getWidget(mAvailableEffectsList, "AvailableEffects");
getWidget(mUsedEffectsView, "UsedEffects"); getWidget(mUsedEffectsView, "UsedEffects");
getWidget(mPriceLabel, "PriceLabel"); getWidget(mPriceLabel, "PriceLabel");
getWidget(mPlayerGold, "PlayerGold");
getWidget(mBuyButton, "BuyButton"); getWidget(mBuyButton, "BuyButton");
getWidget(mCancelButton, "CancelButton"); getWidget(mCancelButton, "CancelButton");
@ -370,6 +371,10 @@ namespace MWGui
mPtr = actor; mPtr = actor;
mNameEdit->setCaption({}); mNameEdit->setCaption({});
MWWorld::Ptr player = MWMechanics::getPlayer();
int playerGold = player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId);
mPlayerGold->setCaptionWithReplacing(MyGUI::utility::toString(playerGold));
startEditing(); startEditing();
} }

View File

@ -175,6 +175,7 @@ namespace MWGui
MyGUI::Button* mBuyButton; MyGUI::Button* mBuyButton;
MyGUI::Button* mCancelButton; MyGUI::Button* mCancelButton;
MyGUI::TextBox* mPriceLabel; MyGUI::TextBox* mPriceLabel;
MyGUI::TextBox* mPlayerGold;
ESM::Spell mSpell; ESM::Spell mSpell;
}; };

View File

@ -68,6 +68,12 @@
<Widget type="HBox" position="0 336 558 60"> <Widget type="HBox" position="0 336 558 60">
<Property key="Padding" value="16"/> <Property key="Padding" value="16"/>
<Widget type="AutoSizedTextBox" skin="NormalText" name="PlayerGoldTextBox">
<Property key="Caption" value="#{sGold}"/>
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="TextToolTip"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="PlayerGold"/>
<Widget type="Spacer"/> <Widget type="Spacer"/>
<Widget type="AutoSizedTextBox" skin="NormalText"> <Widget type="AutoSizedTextBox" skin="NormalText">