add warning if you try to install a billion mods

This commit is contained in:
HJfod 2024-04-29 15:31:35 +03:00
parent 5266ba9655
commit 8fabdf545e

View file

@ -860,6 +860,19 @@ void ModPopup::onEnable(CCObject*) {
}
void ModPopup::onInstall(CCObject*) {
// A futile attempt to try and prevent users from blindly installing
// everything on the index
if (m_source.asServer() && Loader::get()->getAllMods().size() > 10) {
if (!Mod::get()->setSavedValue("shown-dont-install-everything-warning", true)) {
FLAlertLayer::create(
"Warning",
"Installing too many mods can lead to <cr>instability</c>, <cr>bugs</c>, and "
"<cr>crashes</c>. <cy>You should only install mods you need!</c>",
"OK"
)->show();
return;
}
}
server::ModDownloadManager::get()->startDownload(m_source.getID(), std::nullopt);
this->onClose(nullptr);
}