mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-03 05:49:41 +03:00
@@ -2179,28 +2179,32 @@ void KeyValues::RecursiveMergeKeyValues( KeyValues *baseKV )
|
||||
}
|
||||
}
|
||||
|
||||
//Gamepadui
|
||||
bool IsGamepadUI()
|
||||
static int s_nSteamDeckCached = -1;
|
||||
|
||||
bool IsSteamDeck()
|
||||
{
|
||||
//we dont want to use shader editor AND gamepadui at the same time
|
||||
if (CommandLine()->FindParm("-shaderedit"))
|
||||
return false;
|
||||
|
||||
//we dont want tools AND gamepadui at the same time
|
||||
if (CommandLine()->FindParm("-tools"))
|
||||
return false;
|
||||
|
||||
if (CommandLine()->FindParm("-nogamepadui"))
|
||||
return false;
|
||||
|
||||
if (CommandLine()->FindParm("-gamepadui"))
|
||||
return true;
|
||||
|
||||
const char* pszSteamDeckEnv = getenv("SteamDeck");
|
||||
if (pszSteamDeckEnv && *pszSteamDeckEnv)
|
||||
return atoi(pszSteamDeckEnv) != 0;
|
||||
|
||||
return false;
|
||||
if (s_nSteamDeckCached == -1) {
|
||||
if ( CommandLine()->CheckParm( "-nogamepadui" ) != 0 )
|
||||
{
|
||||
s_nSteamDeckCached = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( CommandLine()->CheckParm( "-gamepadui" ) != 0 )
|
||||
{
|
||||
s_nSteamDeckCached = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *deck = getenv("SteamDeck");
|
||||
if ( deck == 0 || *deck == 0 )
|
||||
s_nSteamDeckCached = 0;
|
||||
else
|
||||
s_nSteamDeckCached = atoi(deck) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return s_nSteamDeckCached;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -2220,7 +2224,7 @@ bool EvaluateConditional( const char *str )
|
||||
bNot = true;
|
||||
|
||||
if ( Q_stristr( str, "$DECK" ) )
|
||||
return IsGamepadUI() ^ bNot;
|
||||
return IsSteamDeck() ^ bNot;
|
||||
|
||||
if ( Q_stristr( str, "$X360" ) )
|
||||
return IsX360() ^ bNot;
|
||||
|
||||
Reference in New Issue
Block a user