mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-24 03:47:18 +02:00
Fix installing mods from outside of mod view only installing mod
dependencies, and not actual requested mod
This commit is contained in:
parent
4682ae537d
commit
d7d60bf61b
@ -620,14 +620,7 @@ void CModListView::on_installButton_clicked()
|
|||||||
{
|
{
|
||||||
QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();
|
QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();
|
||||||
|
|
||||||
for(const auto & name : getModsToInstall(modName))
|
doInstallMod(modName);
|
||||||
{
|
|
||||||
auto mod = modStateModel->getMod(name);
|
|
||||||
if(mod.isAvailable())
|
|
||||||
downloadMod(mod);
|
|
||||||
else if(!modStateModel->isModEnabled(name))
|
|
||||||
enableModByName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->installButton->setEnabled(false);
|
ui->installButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
@ -969,11 +962,13 @@ void CModListView::on_screenshotsList_clicked(const QModelIndex & index)
|
|||||||
|
|
||||||
void CModListView::doInstallMod(const QString & modName)
|
void CModListView::doInstallMod(const QString & modName)
|
||||||
{
|
{
|
||||||
for(const auto & name : modStateModel->getMod(modName).getDependencies())
|
for(const auto & name : getModsToInstall(modName))
|
||||||
{
|
{
|
||||||
auto mod = modStateModel->getMod(name);
|
auto mod = modStateModel->getMod(name);
|
||||||
if(!mod.isInstalled())
|
if(mod.isAvailable())
|
||||||
downloadMod(mod);
|
downloadMod(mod);
|
||||||
|
else if(!modStateModel->isModEnabled(name))
|
||||||
|
enableModByName(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user