mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Fix broken coin placement in levelup dialog + possible memleak
This commit is contained in:
parent
4894699eba
commit
5977860e09
3 changed files with 11 additions and 12 deletions
|
@ -83,14 +83,20 @@ namespace MWGui
|
|||
{
|
||||
const int coinSpacing = 10;
|
||||
int curX = mCoinBox->getWidth()/2 - (coinSpacing*(mCoinCount - 1) + 16*mCoinCount)/2;
|
||||
for (unsigned int i=0; i<mCoinCount; ++i)
|
||||
for (unsigned int i=0; i<sMaxCoins; ++i)
|
||||
{
|
||||
MyGUI::ImageBox* image = mCoins[i];
|
||||
image->detachFromWidget();
|
||||
image->attachToWidget(mCoinBox);
|
||||
if (i < mCoinCount)
|
||||
{
|
||||
mCoins[i]->setVisible(true);
|
||||
image->setCoord(MyGUI::IntCoord(curX,0,16,16));
|
||||
curX += 16+coinSpacing;
|
||||
}
|
||||
else
|
||||
mCoins[i]->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
void LevelupDialog::assignCoins()
|
||||
|
@ -178,14 +184,6 @@ namespace MWGui
|
|||
|
||||
mCoinCount = std::min(sMaxCoins, availableAttributes);
|
||||
|
||||
for (unsigned int i = 0; i < sMaxCoins; i++)
|
||||
{
|
||||
if (i < mCoinCount)
|
||||
mCoins[i]->attachToWidget(mCoinBox);
|
||||
else
|
||||
mCoins[i]->detachFromWidget();
|
||||
}
|
||||
|
||||
mSpentAttributes.clear();
|
||||
resetCoins();
|
||||
|
||||
|
|
|
@ -559,6 +559,8 @@ namespace MWGui
|
|||
Box * b = dynamic_cast<Box*>(parent);
|
||||
if (b)
|
||||
b->notifyChildrenSizeChanged();
|
||||
else
|
||||
break;
|
||||
parent = parent->getParent();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,6 @@
|
|||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
<Widget type="Widget"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Available effects -->
|
||||
|
|
Loading…
Reference in a new issue