show incompatibilities on top of problems list

This commit is contained in:
Cvolton 2024-02-15 21:40:54 +01:00
parent 98d572c0e5
commit 4c354ed460
No known key found for this signature in database

View file

@ -38,6 +38,7 @@ void ProblemsListPopup::createList(Mod* scrollTo) {
} }
CCArray* ProblemsListPopup::createCells(Mod* scrollTo, float& scrollValue) { CCArray* ProblemsListPopup::createCells(Mod* scrollTo, float& scrollValue) {
std::vector<ProblemsListCell*> veryTop;
std::vector<ProblemsListCell*> top; std::vector<ProblemsListCell*> top;
std::vector<ProblemsListCell*> middle; std::vector<ProblemsListCell*> middle;
std::vector<ProblemsListCell*> bottom; std::vector<ProblemsListCell*> bottom;
@ -50,6 +51,9 @@ CCArray* ProblemsListPopup::createCells(Mod* scrollTo, float& scrollValue) {
case geode::LoadProblem::Type::Recommendation: case geode::LoadProblem::Type::Recommendation:
middle.push_back(ProblemsListCell::create(problem, this, this->getCellSize())); middle.push_back(ProblemsListCell::create(problem, this, this->getCellSize()));
break; break;
case geode::LoadProblem::Type::OutdatedIncompatibility:
case geode::LoadProblem::Type::PresentIncompatibility:
veryTop.push_back(ProblemsListCell::create(problem, this, this->getCellSize()));
default: default:
top.push_back(ProblemsListCell::create(problem, this, this->getCellSize())); top.push_back(ProblemsListCell::create(problem, this, this->getCellSize()));
break; break;
@ -69,6 +73,10 @@ CCArray* ProblemsListPopup::createCells(Mod* scrollTo, float& scrollValue) {
scrollFound = true; scrollFound = true;
}; };
for (auto const& item : veryTop) {
tryFindScroll(item);
final->addObject(item);
}
for (auto const& item : top) { for (auto const& item : top) {
tryFindScroll(item); tryFindScroll(item);
final->addObject(item); final->addObject(item);