bugfix in quantity form
This commit is contained in:
parent
e43dca60f2
commit
9ba22bc0dd
|
@ -960,24 +960,29 @@ static void AppendQuantityDigit(UInt16 digit)
|
||||||
{
|
{
|
||||||
Char digitText[2];
|
Char digitText[2];
|
||||||
|
|
||||||
if (StrLen(gQuantity) > 2) {
|
if (! gQuantityTouched) {
|
||||||
// If the current quantity already exceeds 2 digits, issue a warning
|
// This is the first time the quantity is being touched; replace it
|
||||||
// beep instead of appending the digit.
|
// outright instead of appending the digit.
|
||||||
|
StrIToA(gQuantity, digit);
|
||||||
|
UpdateQuantityDisplay();
|
||||||
|
gQuantityTouched = true;
|
||||||
|
|
||||||
|
} else if (StrLen(gQuantity) > 2) {
|
||||||
|
// The current quantity already exceeds 2 digits; issue a warning beep
|
||||||
|
// instead of appending the digit.
|
||||||
SndPlaySystemSound(sndWarning);
|
SndPlaySystemSound(sndWarning);
|
||||||
|
|
||||||
} else if (gQuantityTouched && StrCompare(gQuantity, "0") != 0) {
|
} else if (StrCompare(gQuantity, "0") == 0) {
|
||||||
|
// The current quantity is zero; replace it outright instead of
|
||||||
|
// appending the digit.
|
||||||
|
StrIToA(gQuantity, digit);
|
||||||
|
UpdateQuantityDisplay();
|
||||||
|
|
||||||
|
} else {
|
||||||
// Okay, we can append the digit.
|
// Okay, we can append the digit.
|
||||||
StrIToA(digitText, digit);
|
StrIToA(digitText, digit);
|
||||||
StrCat(gQuantity, digitText);
|
StrCat(gQuantity, digitText);
|
||||||
UpdateQuantityDisplay();
|
UpdateQuantityDisplay();
|
||||||
|
|
||||||
} else {
|
|
||||||
// Either this is the first time the quantity is being touched, or else
|
|
||||||
// the quantity is currently zero. Replace it outright instead of
|
|
||||||
// appending the digit.
|
|
||||||
StrIToA(gQuantity, digit);
|
|
||||||
UpdateQuantityDisplay();
|
|
||||||
gQuantityTouched = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue