mirror of
https://github.com/wiiu-env/AromaUpdater.git
synced 2024-11-23 21:29:20 +01:00
Fix package selection on page 2
This commit is contained in:
parent
804fe518e4
commit
9a1cf20366
@ -8,27 +8,26 @@ ApplicationState::eSubState UpdaterState::UpdateShowVersionsMenu(Input *input) {
|
||||
if (selectedOptionX != oldX) {
|
||||
selectedOptionY = 0;
|
||||
} else {
|
||||
proccessMenuNavigationY(input, mTotalPackageCount);
|
||||
auto &curPage = mVersionInfo[selectedOptionX];
|
||||
proccessMenuNavigationY(input, curPage.getPackagesCount(mOnlyRequired));
|
||||
}
|
||||
|
||||
int32_t offset = 0;
|
||||
bool stop = false;
|
||||
if (entrySelected(input)) {
|
||||
for (auto &base : mVersionInfo) {
|
||||
auto &curPage = mVersionInfo[selectedOptionX];
|
||||
for (auto &cat : curPage.getMutableCategory()) {
|
||||
if (stop) { break; }
|
||||
for (auto &cat : base.getMutableCategory()) {
|
||||
if (stop) { break; }
|
||||
for (auto &package : cat.getMutablePackages()) {
|
||||
if (!package.getRequired() && mOnlyRequired) {
|
||||
continue;
|
||||
}
|
||||
if (offset == selectedOptionY) {
|
||||
package.toggleSelect();
|
||||
stop = true;
|
||||
break;
|
||||
}
|
||||
offset++;
|
||||
for (auto &package : cat.getMutablePackages()) {
|
||||
if (!package.getRequired() && mOnlyRequired) {
|
||||
continue;
|
||||
}
|
||||
if (offset == selectedOptionY) {
|
||||
package.toggleSelect();
|
||||
stop = true;
|
||||
break;
|
||||
}
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -454,6 +454,14 @@ namespace VersionCheck {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
const size_t getPackagesCount(bool required) const {
|
||||
size_t result = 0;
|
||||
for (auto &cur : category) {
|
||||
result += cur.getPackagesCount(required);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
using VersionInfo = std::vector<BaseCategory>;
|
||||
|
Loading…
Reference in New Issue
Block a user