engine: client: let loading custom menu dll with -menulib command line switch

This commit is contained in:
Alibek Omarov
2025-04-09 17:35:33 +03:00
parent 71d31330f9
commit 9054b11ebd
4 changed files with 13 additions and 1 deletions

View File

@@ -358,6 +358,7 @@ typedef struct host_parm_s
int window_center_y;
string gamedll;
string clientlib;
string menulib;
} host_parm_t;
extern host_parm_t host;

View File

@@ -328,6 +328,9 @@ void FS_Init( const char *basedir )
if( !Sys_GetParmFromCmdLine( "-clientlib", host.clientlib ))
host.clientlib[0] = 0;
if( !Sys_GetParmFromCmdLine( "-menulib", host.menulib ))
host.menulib[0] = 0;
}
/*

View File

@@ -177,6 +177,7 @@ static void Sys_PrintUsage( const char *exename )
O("-dll <path> ", "override server DLL path")
#if !XASH_DEDICATED
O("-clientlib <path> ", "override client DLL path")
O("-menulib <path> ", "override menu DLL path")
O("-console ", "run engine with console enabled")
O("-toconsole ", "run engine witn console open")
O("-oldfont ", "enable unused Quake font in Half-Life")

View File

@@ -228,7 +228,14 @@ void COM_GetCommonLibraryPath( ECommonLibraryType eLibType, char *out, size_t si
switch( eLibType )
{
case LIBRARY_GAMEUI:
COM_GenerateClientLibraryPath( "menu", out, size );
if( COM_CheckStringEmpty( host.menulib ))
{
Q_strncpy( out, host.menulib, size );
}
else
{
COM_GenerateClientLibraryPath( "menu", out, size );
}
break;
case LIBRARY_CLIENT:
if( COM_CheckStringEmpty( host.clientlib ))