forked from mirror/openmw-tes3mp
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,13 +83,19 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
const int coinSpacing = 10;
|
const int coinSpacing = 10;
|
||||||
int curX = mCoinBox->getWidth()/2 - (coinSpacing*(mCoinCount - 1) + 16*mCoinCount)/2;
|
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];
|
MyGUI::ImageBox* image = mCoins[i];
|
||||||
image->detachFromWidget();
|
image->detachFromWidget();
|
||||||
image->attachToWidget(mCoinBox);
|
image->attachToWidget(mCoinBox);
|
||||||
image->setCoord(MyGUI::IntCoord(curX,0,16,16));
|
if (i < mCoinCount)
|
||||||
curX += 16+coinSpacing;
|
{
|
||||||
|
mCoins[i]->setVisible(true);
|
||||||
|
image->setCoord(MyGUI::IntCoord(curX,0,16,16));
|
||||||
|
curX += 16+coinSpacing;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mCoins[i]->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,14 +184,6 @@ namespace MWGui
|
||||||
|
|
||||||
mCoinCount = std::min(sMaxCoins, availableAttributes);
|
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();
|
mSpentAttributes.clear();
|
||||||
resetCoins();
|
resetCoins();
|
||||||
|
|
||||||
|
|
|
@ -559,6 +559,8 @@ namespace MWGui
|
||||||
Box * b = dynamic_cast<Box*>(parent);
|
Box * b = dynamic_cast<Box*>(parent);
|
||||||
if (b)
|
if (b)
|
||||||
b->notifyChildrenSizeChanged();
|
b->notifyChildrenSizeChanged();
|
||||||
|
else
|
||||||
|
break;
|
||||||
parent = parent->getParent();
|
parent = parent->getParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,6 @@
|
||||||
<UserString key="HStretch" value="true"/>
|
<UserString key="HStretch" value="true"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget type="Widget"/>
|
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<!-- Available effects -->
|
<!-- Available effects -->
|
||||||
|
|
Loading…
Reference in a new issue