Implement GamepadUI interface and build configuration

- Add GAMEPADUI preprocessor definition to client_base.vpc
- Add gamepadui to gamedlls build group in groups.vgc
- Merge missing IGamepadUI interface calls into cdll_client_int.cpp
- Add IsSteamDeck override for -gamepadui command line support
This commit is contained in:
Star1xr 2026-05-15 17:23:12 +03:00
parent 075fd045c7
commit 72ec1e308a
4 changed files with 2761 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -353,6 +353,24 @@ class IClientPurchaseInterfaceV2 *g_pClientPurchaseInterface = (class IClientPur
static ConVar *g_pcv_ThreadMode = NULL;
// GAMEPADUI TODO - put this somewhere better. (Madi)
#if defined( GAMEPADUI )
const bool IsSteamDeck()
{
if ( CommandLine()->FindParm( "-gamepadui" ) )
return true;
if ( CommandLine()->FindParm( "-nogamepadui" ) )
return false;
const char *pszSteamDeckEnv = getenv( "SteamDeck" );
if ( pszSteamDeckEnv && *pszSteamDeckEnv )
return atoi( pszSteamDeckEnv ) != 0;
return false;
}
#endif
//-----------------------------------------------------------------------------
// Purpose: interface for gameui to modify voice bans
@ -1348,6 +1366,11 @@ void CHLClient::HudUpdate( bool bActive )
g_pSixenseInput->SixenseFrame( 0, NULL );
}
#endif
#if defined(GAMEPADUI)
if (g_pGamepadUI != nullptr)
g_pGamepadUI->OnUpdate( frametime );
#endif // GAMEPADUI
}
//-----------------------------------------------------------------------------
@ -1711,6 +1734,11 @@ void CHLClient::LevelInitPostEntity( )
IGameSystem::LevelInitPostEntityAllSystems();
C_PhysPropClientside::RecreateAll();
internalCenterPrint->Clear();
#if defined(GAMEPADUI)
if (g_pGamepadUI != nullptr)
g_pGamepadUI->OnLevelInitializePostEntity();
#endif // GAMEPADUI
}
//-----------------------------------------------------------------------------
@ -1777,6 +1805,11 @@ void CHLClient::LevelShutdown( void )
StopAllRumbleEffects();
#if defined(GAMEPADUI)
if (g_pGamepadUI != nullptr)
g_pGamepadUI->OnLevelShutdown();
#endif // GAMEPADUI
gHUD.LevelShutdown();
internalCenterPrint->Clear();

View File

@ -51,7 +51,7 @@ $Configuration
$Compiler
{
$AdditionalIncludeDirectories ".\;$BASE;$SRCDIR\vgui2\include;$SRCDIR\vgui2\controls;$SRCDIR\game\shared;.\game_controls;$SRCDIR\thirdparty\sixensesdk\include"
$PreprocessorDefinitions "$BASE;NO_STRING_T;CLIENT_DLL;VECTOR;VERSION_SAFE_STEAM_API_INTERFACES;PROTECTED_THINGS_ENABLE;strncpy=use_Q_strncpy_instead;_snprintf=use_Q_snprintf_instead"
$PreprocessorDefinitions "$BASE;NO_STRING_T;CLIENT_DLL;VECTOR;VERSION_SAFE_STEAM_API_INTERFACES;PROTECTED_THINGS_ENABLE;strncpy=use_Q_strncpy_instead;_snprintf=use_Q_snprintf_instead;GAMEPADUI"
$PreprocessorDefinitions "$BASE;ENABLE_CHROMEHTMLWINDOW;fopen=dont_use_fopen" [$WIN32]
$PreprocessorDefinitions "$BASE;ENABLE_CHROMEHTMLWINDOW;" [$OSXALL]
$PreprocessorDefinitions "$BASE;ENABLE_CHROMEHTMLWINDOW;USE_WEBM_FOR_REPLAY;" [$LINUXALL]

View File

@ -12,6 +12,7 @@ $Group "gamedlls"
{
"client"
"server"
"gamepadui"
}