Finished enchanting

actorid
Glorf 12 years ago
parent 7b7d3353a6
commit ae3e4ecf8b

@ -32,6 +32,7 @@ namespace MWGui
getWidget(mTypeButton, "TypeButton");
getWidget(mBuyButton, "BuyButton");
getWidget(mPrice, "PriceLabel");
getWidget(mPriceText, "PriceTextLabel");
setWidgets(mAvailableEffectsList, mUsedEffectsView);
@ -94,19 +95,34 @@ namespace MWGui
mPtr = actor;
startEditing ();
mPrice->setVisible(true);
}
void EnchantingDialog::startSelfEnchanting(MWWorld::Ptr soulgem)
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
MWWorld::Ptr gem = soulgem;
mEnchanting.setSelfEnchanting(true);
mEnchanting.setEnchanter(player);
mPtr = player;
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 ()

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

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

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

Loading…
Cancel
Save