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