Skip to content

Commit

Permalink
feat: customize missing mod message regarding mod autodownloading set…
Browse files Browse the repository at this point in the history
…ting value
  • Loading branch information
Alystrasz committed Nov 5, 2023
1 parent 05e4b17 commit 9d6e95c
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ void function OnServerSelected_Threaded( var button )
file.lastSelectedServer = server

// Count mods that have been successfully downloaded
bool autoDownloadAllowed = GetConVarInt( "cl_mod_download" ) == 1
int downloadedMods = 0;

foreach ( RequiredModInfo mod in server.requiredMods )
Expand All @@ -974,14 +975,20 @@ void function OnServerSelected_Threaded( var button )
bool modIsVerified = NSIsModDownloadable( mod.name, mod.version )

// Display an error message if not
if (!modIsVerified)
if (!modIsVerified || !autoDownloadAllowed)
{
DialogData dialogData
dialogData.header = "#ERROR"
dialogData.message = format( "Missing mod \"%s\" v%s", mod.name, mod.version )
dialogData.message += "\n(mod is not verified, and couldn't be downloaded automatically)"
dialogData.image = $"ui/menu/common/dialog_error"

// Specify error
if (!modIsVerified) {
dialogData.message += "\n(mod is not verified, and couldn't be downloaded automatically)"
} else if (!autoDownloadAllowed) {
dialogData.message += "\n(automatic mod downloading is disabled)"
}

#if PC_PROG
AddDialogButton( dialogData, "#DISMISS" )

Expand Down

0 comments on commit 9d6e95c

Please sign in to comment.