Menu-FN: Show the updater only when we've got 0/X packages installed for

the current game.
This commit is contained in:
Marco Cawthorne 2021-01-24 00:11:08 +01:00
parent 09b11284b3
commit 085607e022
2 changed files with 37 additions and 1 deletions

View File

@ -117,7 +117,7 @@ m_init(void)
Music_MenuStart();
}
if (game_updatesavailable() == 1 || autocvar_menu_updating) {
if (game_updateinstallcount() == 0 || autocvar_menu_updating) {
shaderforname("logo_avi", "{\n{\nvideomap av:media/logo.avi\n}\n}");
g_menupage = PAGE_UPDATES;
}

View File

@ -90,6 +90,42 @@ game_updatesavailable(void)
return 0;
}
int
game_updateinstallcount(void)
{
int count;
/* look for the valid packages in the gameinfo pkgname */
int pkgcount = tokenize(games[gameinfo_current].pkgname);
for (int i = 0i; i < pkgcount; i++) {
int id = game_getpackageid(argv(i));
string status = getpackagemanagerinfo(id, GPMI_INSTALLED);
switch (status) {
case "":
break;
case "pending":
break;
case "enabled":
count++;
break;
case "present":
count++;
break;
case "corrupt":
count++;
break;
default:
/* we're currently installing stuff */
break;
}
}
/* everything is installed */
return count;
}
#if 0
/* get installing id */
void