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