Finished enchanting

actorid
Glorf 12 years ago
parent 7b7d3353a6
commit ae3e4ecf8b

@ -32,6 +32,7 @@ namespace MWGui
getWidget(mTypeButton, "TypeButton"); getWidget(mTypeButton, "TypeButton");
getWidget(mBuyButton, "BuyButton"); getWidget(mBuyButton, "BuyButton");
getWidget(mPrice, "PriceLabel"); getWidget(mPrice, "PriceLabel");
getWidget(mPriceText, "PriceTextLabel");
setWidgets(mAvailableEffectsList, mUsedEffectsView); setWidgets(mAvailableEffectsList, mUsedEffectsView);
@ -94,19 +95,34 @@ namespace MWGui
mPtr = actor; mPtr = actor;
startEditing (); startEditing ();
mPrice->setVisible(true);
} }
void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem) void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem)
{ {
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
MWWorld::Ptr gem = soulgem;
mEnchanting.setSelfEnchanting(true); mEnchanting.setSelfEnchanting(true);
mEnchanting.setEnchanter(player); mEnchanting.setEnchanter(player);
mPtr = player; mPtr = player;
startEditing(); startEditing();
mEnchanting.setSoulGem(gem); mEnchanting.setSoulGem(soulgem);
MyGUI::ImageBox* image = mSoulBox->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(0, 0, 32, 32), MyGUI::Align::Default);
std::string path = std::string("icons\\");
path += MWWorld::Class::get(soulgem).getInventoryIcon(soulgem);
int pos = path.rfind(".");
path.erase(pos);
path.append(".dds");
image->setImageTexture (path);
image->setUserString ("ToolTipType", "ItemPtr");
image->setUserData(soulgem);
image->eventMouseButtonClick += MyGUI::newDelegate(this, &EnchantingDialog::onRemoveSoul);
mPrice->setVisible(false);
mPriceText->setVisible(false);
} }
void EnchantingDialog::onReferenceUnavailable () void EnchantingDialog::onReferenceUnavailable ()

@ -56,6 +56,7 @@ namespace MWGui
MyGUI::TextBox* mCastCost; MyGUI::TextBox* mCastCost;
MyGUI::TextBox* mCharge; MyGUI::TextBox* mCharge;
MyGUI::TextBox* mPrice; MyGUI::TextBox* mPrice;
MyGUI::TextBox* mPriceText;
MWMechanics::Enchanting mEnchanting; MWMechanics::Enchanting mEnchanting;
ESM::EffectList mEffectList; ESM::EffectList mEffectList;

@ -88,7 +88,8 @@ namespace MWMechanics
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
MWWorld::Class::get (player).getContainerStore (player).add (ref.getPtr()); MWWorld::Class::get (player).getContainerStore (player).add (ref.getPtr());
payForEnchantment(); if(!mSelfEnchanting)
payForEnchantment();
return true; return true;
} }

@ -97,11 +97,11 @@
<UserString key="HStretch" value="true"/> <UserString key="HStretch" value="true"/>
</Widget> </Widget>
<Widget type="AutoSizedTextBox" skin="NormalText"> <Widget type="AutoSizedTextBox" skin="NormalText" name="PriceTextLabel">
<Property key="Caption" value="#{sBarterDialog7}"/> <Property key="Caption" value="#{sBarterDialog7}"/>
</Widget> </Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="PriceLabel"> <Widget type="AutoSizedTextBox" skin="SandText" name="PriceLabel">
<Property key="Caption" value="30"/> <Property key="Caption" value="0"/>
</Widget> </Widget>

Loading…
Cancel
Save