UniStore V2 grid fixes.

This commit is contained in:
StackZ
2020-06-20 15:52:59 +02:00
parent 05e6e7bd55
commit 7de012c2a2
+7 -5
View File
@@ -145,13 +145,13 @@ void UniStoreV2::DrawGrid(void) const {
} }
temp = {nullptr, nullptr}; temp = {nullptr, nullptr};
} else { } else {
GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesGrid[i].x+26, this->StoreBoxesGrid[i].y+1); GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesGrid[i].x+1, this->StoreBoxesGrid[i].y+1);
} }
} else { } else {
GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesGrid[i].x+26, this->StoreBoxesGrid[i].y+1); GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesGrid[i].x+1, this->StoreBoxesGrid[i].y+1);
} }
} else { } else {
GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesGrid[i].x+26, this->StoreBoxesGrid[i].y+1); GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesGrid[i].x+1, this->StoreBoxesGrid[i].y+1);
} }
} }
} }
@@ -491,9 +491,11 @@ void UniStoreV2::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
if (hDown & KEY_LEFT) { if (hDown & KEY_LEFT) {
// Try to go to next page. // Try to go to next page.
if (this->selectedBox == 0 || this->selectedBox == 5 || this->selectedBox == 11) { if (this->selectedBox == 0 || this->selectedBox == 5 || this->selectedBox == 10) {
if (this->storePage > 0) { if (this->storePage > 0) {
this->storePage--; this->storePage--;
} else {
if (this->selectedBox > 0) this->selectedBox--;
} }
} else { } else {
if (this->selectedBox > 0) this->selectedBox--; if (this->selectedBox > 0) this->selectedBox--;
@@ -501,7 +503,7 @@ void UniStoreV2::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
} }
if (hDown & KEY_UP) { if (hDown & KEY_UP) {
if (this->selectedBox > 4 + (this->storePage * STORE_ENTRIES)) this->selectedBox -= 5; if (this->selectedBox > 4) this->selectedBox -= 5;
} }
if (hDown & KEY_DOWN) { if (hDown & KEY_DOWN) {