|
|
|
@ -23,6 +23,8 @@ namespace MWGui
|
|
|
|
|
getWidget(mOkButton, "OkButton");
|
|
|
|
|
getWidget(mClassImage, "ClassImage");
|
|
|
|
|
getWidget(mLevelText, "LevelText");
|
|
|
|
|
getWidget(mLevelDescription, "LevelDescription");
|
|
|
|
|
getWidget(mCoinBox, "Coins");
|
|
|
|
|
|
|
|
|
|
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &LevelupDialog::onOkButtonClicked);
|
|
|
|
|
|
|
|
|
@ -80,11 +82,13 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
void LevelupDialog::resetCoins ()
|
|
|
|
|
{
|
|
|
|
|
int curX = mMainWidget->getWidth()/2 - (16 + 2) * 1.5;
|
|
|
|
|
int curX = 0;
|
|
|
|
|
for (int i=0; i<3; ++i)
|
|
|
|
|
{
|
|
|
|
|
MyGUI::ImageBox* image = mCoins[i];
|
|
|
|
|
image->setCoord(MyGUI::IntCoord(curX,250,16,16));
|
|
|
|
|
image->detachFromWidget();
|
|
|
|
|
image->attachToWidget(mCoinBox);
|
|
|
|
|
image->setCoord(MyGUI::IntCoord(curX,0,16,16));
|
|
|
|
|
curX += 24+2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -95,6 +99,9 @@ namespace MWGui
|
|
|
|
|
for (unsigned int i=0; i<mSpentAttributes.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
MyGUI::ImageBox* image = mCoins[i];
|
|
|
|
|
image->detachFromWidget();
|
|
|
|
|
image->attachToWidget(mMainWidget);
|
|
|
|
|
|
|
|
|
|
int attribute = mSpentAttributes[i];
|
|
|
|
|
|
|
|
|
|
int xdiff = mAttributeMultipliers[attribute]->getCaption() == "" ? 0 : 30;
|
|
|
|
@ -113,8 +120,6 @@ namespace MWGui
|
|
|
|
|
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(player).getCreatureStats (player);
|
|
|
|
|
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
|
|
|
|
|
|
|
|
|
center();
|
|
|
|
|
|
|
|
|
|
mSpentAttributes.clear();
|
|
|
|
|
resetCoins();
|
|
|
|
|
|
|
|
|
@ -128,16 +133,25 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
mClassImage->setImageTexture ("textures\\levelup\\" + cls->mId + ".dds");
|
|
|
|
|
|
|
|
|
|
/// \todo replace this with INI-imported texts
|
|
|
|
|
int level = creatureStats.getLevel ()+1;
|
|
|
|
|
mLevelText->setCaptionWithReplacing("#{sLevelUpMenu1} " + boost::lexical_cast<std::string>(level));
|
|
|
|
|
|
|
|
|
|
std::string levelupdescription;
|
|
|
|
|
if(level>20)
|
|
|
|
|
levelupdescription=world->getFallback("Level_Up_Default");
|
|
|
|
|
else
|
|
|
|
|
levelupdescription=world->getFallback("Level_Up_Level"+boost::lexical_cast<std::string>(level));
|
|
|
|
|
|
|
|
|
|
mLevelDescription->setCaption (levelupdescription);
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<8; ++i)
|
|
|
|
|
{
|
|
|
|
|
MyGUI::TextBox* text = mAttributeMultipliers[i];
|
|
|
|
|
int mult = pcStats.getLevelupAttributeMultiplier (i);
|
|
|
|
|
text->setCaption(mult <= 1 ? "" : "x" + boost::lexical_cast<std::string>(mult));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
center();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LevelupDialog::onOkButtonClicked (MyGUI::Widget* sender)
|
|
|
|
|