forked from mirror/openmw-tes3mp
Merge pull request #926 from bentsherman/master
Allow +/- buttons in trade window to decrease offer to 0
This commit is contained in:
commit
b2dc18e1aa
1 changed files with 7 additions and 7 deletions
|
@ -476,15 +476,15 @@ namespace MWGui
|
||||||
// prevent overflows, and prevent entering INT_MIN since abs(INT_MIN) is undefined
|
// prevent overflows, and prevent entering INT_MIN since abs(INT_MIN) is undefined
|
||||||
if (mCurrentBalance == INT_MAX || mCurrentBalance == INT_MIN+1)
|
if (mCurrentBalance == INT_MAX || mCurrentBalance == INT_MIN+1)
|
||||||
return;
|
return;
|
||||||
if(mCurrentBalance<=-1) mCurrentBalance -= 1;
|
if (mCurrentBalance < 0) mCurrentBalance -= 1;
|
||||||
if(mCurrentBalance>=1) mCurrentBalance += 1;
|
else mCurrentBalance += 1;
|
||||||
updateLabels();
|
updateLabels();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TradeWindow::onDecreaseButtonTriggered()
|
void TradeWindow::onDecreaseButtonTriggered()
|
||||||
{
|
{
|
||||||
if(mCurrentBalance<-1) mCurrentBalance += 1;
|
if (mCurrentBalance < 0) mCurrentBalance += 1;
|
||||||
if(mCurrentBalance>1) mCurrentBalance -= 1;
|
else mCurrentBalance -= 1;
|
||||||
updateLabels();
|
updateLabels();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,13 +495,13 @@ namespace MWGui
|
||||||
|
|
||||||
mPlayerGold->setCaptionWithReplacing("#{sYourGold} " + MyGUI::utility::toString(playerGold));
|
mPlayerGold->setCaptionWithReplacing("#{sYourGold} " + MyGUI::utility::toString(playerGold));
|
||||||
|
|
||||||
if (mCurrentBalance > 0)
|
if (mCurrentBalance < 0)
|
||||||
{
|
{
|
||||||
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalSold}");
|
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalCost}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalCost}");
|
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalSold}");
|
||||||
}
|
}
|
||||||
|
|
||||||
mTotalBalance->setValue(std::abs(mCurrentBalance));
|
mTotalBalance->setValue(std::abs(mCurrentBalance));
|
||||||
|
|
Loading…
Reference in a new issue