Add proportionality support for GameUI panels (#35)

* Add proportionality support for GameUI panels

* Add Android platform define

* Fix button wrong state on fast clicking

Co-authored-by: JusicP <slender87844@gmail.com>
This commit is contained in:
nillerusr
2022-01-09 17:04:47 +03:00
committed by GitHub
co-authored by JusicP
parent 1f3436945f
commit 9d77bb17c5
20 changed files with 296 additions and 150 deletions
+10 -10
View File
@@ -161,16 +161,6 @@ public:
SetPaintBackgroundEnabled( false );
// the image has the same name as the config file
char szMaterial[ MAX_PATH ];
Q_snprintf( szMaterial, sizeof(szMaterial), "chapters/%s", chapterConfigFile );
char *ext = strstr( szMaterial, "." );
if ( ext )
{
*ext = 0;
}
m_pLevelPic->SetImage( szMaterial );
KeyValues *pKeys = NULL;
if ( GameUI().IsConsoleUI() )
{
@@ -178,6 +168,16 @@ public:
}
LoadControlSettings( "Resource/NewGameChapterPanel.res", NULL, pKeys );
// the image has the same name as the config file
char szMaterial[MAX_PATH];
Q_snprintf(szMaterial, sizeof(szMaterial), "chapters/%s", chapterConfigFile);
char* ext = strstr(szMaterial, ".");
if (ext)
{
*ext = 0;
}
m_pLevelPic->SetImage(szMaterial);
int px, py;
m_pLevelPicBorder->GetPos( px, py );
SetSize( m_pLevelPicBorder->GetWide(), py + m_pLevelPicBorder->GetTall() );