mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Fix grid scrolling.
This commit is contained in:
+5
-19
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user