Fix grid scrolling.

This commit is contained in:
StackZ
2020-12-17 19:27:54 +01:00
parent ded6d4234d
commit a82491a63d
2 changed files with 6 additions and 20 deletions
+5 -19
View File
@@ -106,22 +106,14 @@ void StoreUtils::GridLogic(std::unique_ptr<Store> &store, std::vector<std::uniqu
if (store->GetEntry() + 5 < (int)entries.size() - 1) {
store->SetEntry(store->GetEntry() + 5);
if (entries.size() > 15) {
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
store->SetScreenIndx(store->GetScreenIndx() + 1);
}
}
if (entries.size() > 15) store->SetScreenIndx((store->GetEntry() / 5) - 2);
} else {
if (store->GetEntry() < (int)entries.size() - 1) {
store->SetEntry(entries.size() - 1);
store->SetBox(10 + (store->GetEntry() % 5));
if (entries.size() > 15) {
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
store->SetScreenIndx(store->GetScreenIndx() + 1);
}
}
if (entries.size() > 15) store->SetScreenIndx((store->GetEntry() / 5) - 2);
}
}
@@ -143,9 +135,7 @@ void StoreUtils::GridLogic(std::unique_ptr<Store> &store, std::vector<std::uniqu
store->SetBox(10);
store->SetEntry(store->GetEntry() + 1);
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
store->SetScreenIndx(store->GetScreenIndx() + 1);
}
store->SetScreenIndx((store->GetEntry() / 5) - 2);
}
}
}
@@ -160,9 +150,7 @@ void StoreUtils::GridLogic(std::unique_ptr<Store> &store, std::vector<std::uniqu
store->SetBox(4);
store->SetEntry(store->GetEntry() - 1);
if (store->GetScreenIndx() > 0) {
store->SetScreenIndx(store->GetScreenIndx() - 1);
}
store->SetScreenIndx((store->GetEntry() / 5));
}
}
}
@@ -172,9 +160,7 @@ void StoreUtils::GridLogic(std::unique_ptr<Store> &store, std::vector<std::uniqu
if (store->GetEntry() > 4) {
store->SetEntry(store->GetEntry() - 5);
if (store->GetScreenIndx() > 0) {
store->SetScreenIndx(store->GetScreenIndx() - 1);
}
store->SetScreenIndx((store->GetEntry() / 5));
}
} else {