diff --git a/loader/src/ui/mods/list/ModList.cpp b/loader/src/ui/mods/list/ModList.cpp index 123b1ac1..7863d99b 100644 --- a/loader/src/ui/mods/list/ModList.cpp +++ b/loader/src/ui/mods/list/ModList.cpp @@ -15,9 +15,9 @@ static size_t getDisplayPageSize(ModListSource* src, ModListDisplay display) { $execute { listenForSettingChanges("infinite-local-mods-list", [](bool value) { - InstalledModListSource::get(InstalledModListType::All)->reset(); - InstalledModListSource::get(InstalledModListType::OnlyErrors)->reset(); - InstalledModListSource::get(InstalledModListType::OnlyOutdated)->reset(); + InstalledModListSource::get(InstalledModListType::All)->clearCache(); + InstalledModListSource::get(InstalledModListType::OnlyErrors)->clearCache(); + InstalledModListSource::get(InstalledModListType::OnlyOutdated)->clearCache(); // Updates is technically a server mod list :-) So I left it out here }); } @@ -601,6 +601,16 @@ void ModList::updateDisplay(ModListDisplay display) { ); } + // Make sure list isn't too small + // NOTE: Do NOT call `updateLayout` on m_list, it'll undo this! + if (m_list->m_contentLayer->getContentHeight() < m_list->getContentHeight()) { + auto diff = m_list->getContentHeight() - m_list->m_contentLayer->getContentHeight(); + m_list->m_contentLayer->setContentHeight(m_list->getContentHeight()); + for (auto child : CCArrayExt(m_list->m_contentLayer->getChildren())) { + child->setPositionY(child->getPositionY() + diff); + } + } + // Preserve relative scroll position m_list->m_contentLayer->setPositionY(( m_list->m_contentLayer->getContentHeight() - m_list->getContentHeight()