1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Hide not installed translation mods to languages other than selected one

This commit is contained in:
Ivan Savenko
2023-10-22 00:07:21 +03:00
parent b50ebba1ba
commit adf58fa834
3 changed files with 23 additions and 4 deletions

View File

@@ -92,8 +92,21 @@ bool CModEntry::isInstalled() const
bool CModEntry::isVisible() const
{
if (getBaseValue("modType").toString() == "Compatibility" && isSubmod())
return false;
if (getBaseValue("modType").toString() == "Compatibility")
{
if (isSubmod())
return false;
}
if (getBaseValue("modType").toString() == "Translation")
{
// Do not show not installed translation mods to languages other than player language
if (localData.empty() && getBaseValue("language") != QString::fromStdString(settings["general"]["language"].String()) )
return false;
if (isSubmod())
return false;
}
return !localData.isEmpty() || !repository.isEmpty();
}