Don't start showing the hint for each solved number.

* Instead, only keep it visible when the user made it visible.
* Minor cleanup.
This commit is contained in:
Axel Dörfler 2012-09-23 11:23:29 +02:00
parent 19559d24fc
commit baeb048bd1
1 changed files with 5 additions and 8 deletions

View File

@ -889,7 +889,7 @@ SudokuView::MouseDown(BPoint where)
fLastField = field; fLastField = field;
} }
if (value + 1 != fValueHintValue) if (value + 1 != fValueHintValue && fValueHintValue != ~0UL)
_SetValueHintValue(value + 1); _SetValueHintValue(value + 1);
if (wasCompleted != fField->IsValueCompleted(value + 1)) if (wasCompleted != fField->IsValueCompleted(value + 1))
@ -1208,17 +1208,14 @@ SudokuView::_DrawHints(uint32 x, uint32 y)
for (uint32 j = 0; j < fBlockSize; j++) { for (uint32 j = 0; j < fBlockSize; j++) {
for (uint32 i = 0; i < fBlockSize; i++) { for (uint32 i = 0; i < fBlockSize; i++) {
uint32 value = j * fBlockSize + i; uint32 value = j * fBlockSize + i;
if (hintMask & (1UL << value)) { if ((hintMask & (1UL << value)) != 0) {
// if (value + 1 == fValueHintValue)
// SetHighColor(kValueHintBackgroundColor);
// else
SetHighColor(kHintColor); SetHighColor(kHintColor);
}else { } else {
if (!showAll) if (!showAll)
continue; continue;
if ((fHintFlags & kMarkValidHints) == 0 if ((fHintFlags & kMarkValidHints) == 0
|| validMask & (1UL << value)) || (validMask & (1UL << value)) != 0)
SetHighColor(110, 110, 80); SetHighColor(110, 110, 80);
else else
SetHighColor(180, 180, 120); SetHighColor(180, 180, 120);