Revert "initial GamepadUI from EZ2"

This reverts commit 19ce478dd0.
This commit is contained in:
2024-10-19 21:07:07 +03:00
parent 8dbab45f13
commit f7e0e02932
49 changed files with 49 additions and 11335 deletions

View File

@@ -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;