brmbar-qt4: Add LIMIT_BALANCE(=-200) as a lower limit of user credit

This commit is contained in:
Petr Baudis 2015-06-04 22:57:20 +02:00
parent 84881dece3
commit 1c0e51a246
2 changed files with 15 additions and 0 deletions

View file

@ -58,6 +58,8 @@ Item {
if (acct.acctype == "cash") { //Copied from BarButton.onButtonClick
shop.sellItemCash(dbid)
status_text.setStatus("Sold! Put " + price + " Kč in the money box.", "#ffff7c")
} else if (!shop.canSellItem(dbid, acct.id)) {
status_text.setStatus("NOT SOLD! "+acct.name+"'s credit is TOO LOW: "+shop.balance_user(acct.id), "#ff4444")
} else {
var balance = shop.sellItem(dbid, acct.id)
status_text.setStatus("Sold! "+acct.name+"'s credit is "+balance+".", "#ffff7c")