本文整理汇总了C++中KeyValues::ProcessResolutionKeys方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyValues::ProcessResolutionKeys方法的具体用法?C++ KeyValues::ProcessResolutionKeys怎么用?C++ KeyValues::ProcessResolutionKeys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyValues
的用法示例。
在下文中一共展示了KeyValues::ProcessResolutionKeys方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadSchemeFromFileEx
// first scheme loaded becomes the default scheme, and all subsequent loaded scheme are derivitives of that
HScheme CSchemeManager::LoadSchemeFromFileEx( VPANEL sizingPanel, const char *fileName, const char *tag)
{
// Look to see if we've already got this scheme...
HScheme hScheme = FindLoadedScheme(fileName);
if (hScheme != 0)
{
CScheme *pScheme = static_cast< CScheme * >( GetIScheme( hScheme ) );
if ( IsPC() && pScheme )
{
pScheme->ReloadFontGlyphs();
}
return hScheme;
}
KeyValues *data;
data = new KeyValues("Scheme");
data->UsesEscapeSequences( true ); // VGUI uses this
// look first in skins directory
bool result = data->LoadFromFile( g_pFullFileSystem, fileName, "SKIN" );
if (!result)
{
result = data->LoadFromFile( g_pFullFileSystem, fileName, "GAME" );
if ( !result )
{
// look in any directory
result = data->LoadFromFile( g_pFullFileSystem, fileName, NULL );
}
}
if (!result)
{
data->deleteThis();
return 0;
}
if ( IsX360() )
{
data->ProcessResolutionKeys( g_pSurface->GetResolutionKey() );
}
if ( IsPC() )
{
ConVarRef cl_hud_minmode( "cl_hud_minmode", true );
if ( cl_hud_minmode.IsValid() && cl_hud_minmode.GetBool() )
{
data->ProcessResolutionKeys( "_minmode" );
}
}
CScheme *newScheme = new CScheme();
newScheme->LoadFromFile( sizingPanel, fileName, tag, data );
return m_Schemes.AddToTail(newScheme);
}
示例2: LoadControlSettings
// Load the control settings
void CBaseModFrame::LoadControlSettings( const char *dialogResourceName, const char *pathID, KeyValues *pPreloadedKeyValues, KeyValues *pConditions )
{
// Use the keyvalues they passed in or load them using special hook for flyouts generation
KeyValues *rDat = pPreloadedKeyValues;
if ( !rDat )
{
// load the resource data from the file
rDat = new KeyValues(dialogResourceName);
// check the skins directory first, if an explicit pathID hasn't been set
bool bSuccess = false;
if ( !IsX360() && !pathID )
{
bSuccess = rDat->LoadFromFile( g_pFullFileSystem, dialogResourceName, "SKIN" );
}
if ( !bSuccess )
{
bSuccess = rDat->LoadFromFile( g_pFullFileSystem, dialogResourceName, pathID );
}
if ( bSuccess )
{
if ( IsX360() )
{
rDat->ProcessResolutionKeys( surface()->GetResolutionKey() );
}
if ( pConditions && pConditions->GetFirstSubKey() )
{
GetBuildGroup()->ProcessConditionalKeys( rDat, pConditions );
}
}
}
// Find the auto-generated-chapter hook
if ( KeyValues *pHook = rDat->FindKey( "FlmChapterXXautogenerated" ) )
{
const int numMaxAutogeneratedFlyouts = 20;
for ( int k = 1; k <= numMaxAutogeneratedFlyouts; ++ k )
{
KeyValues *pFlyoutInfo = pHook->MakeCopy();
CFmtStr strName( "FlmChapter%d", k );
pFlyoutInfo->SetName( strName );
pFlyoutInfo->SetString( "fieldName", strName );
pFlyoutInfo->SetString( "ResourceFile", CFmtStr( "FlmChapterXXautogenerated_%d/%s", k, pHook->GetString( "ResourceFile" ) ) );
rDat->AddSubKey( pFlyoutInfo );
}
rDat->RemoveSubKey( pHook );
pHook->deleteThis();
}
BaseClass::LoadControlSettings( dialogResourceName, pathID, rDat, pConditions );
if ( rDat != pPreloadedKeyValues )
{
rDat->deleteThis();
}
}
示例3: ProcessResolutionKeys
bool KeyValues::ProcessResolutionKeys(const char *pResString)
{
if (!pResString)
return false;
KeyValues *pSubKey = GetFirstSubKey();
if (!pSubKey)
return false;
for ( ; pSubKey != NULL; pSubKey = pSubKey->GetNextKey())
{
pSubKey->ProcessResolutionKeys(pResString);
if (Q_stristr(pSubKey->GetName(), pResString) != NULL)
{
char normalKeyName[128];
V_strncpy(normalKeyName, pSubKey->GetName(), sizeof(normalKeyName));
char *pString = Q_stristr(normalKeyName, pResString);
if (pString && !Q_stricmp(pString, pResString))
{
*pString = '\0';
KeyValues *pKey = FindKey(normalKeyName);
if (pKey)
{
RemoveSubKey(pKey);
}
pSubKey->SetName(normalKeyName);
}
}
}
return true;
}
示例4: LoadControlSettings
//-----------------------------------------------------------------------------
// Purpose: loads the control settings from file
//-----------------------------------------------------------------------------
void BuildGroup::LoadControlSettings(const char *controlResourceName, const char *pathID, KeyValues *pPreloadedKeyValues)
{
// make sure the file is registered
RegisterControlSettingsFile(controlResourceName, pathID);
// Use the keyvalues they passed in or load them.
KeyValues *rDat = pPreloadedKeyValues;
if ( !rDat )
{
// load the resource data from the file
rDat = new KeyValues(controlResourceName);
// check the skins directory first, if an explicit pathID hasn't been set
bool bSuccess = false;
if (!pathID)
{
bSuccess = rDat->LoadFromFile(g_pFullFileSystem, controlResourceName, "SKIN");
}
if (!bSuccess)
{
bSuccess = rDat->LoadFromFile(g_pFullFileSystem, controlResourceName, pathID);
}
if ( bSuccess )
{
if ( IsX360() )
{
rDat->ProcessResolutionKeys( surface()->GetResolutionKey() );
}
if ( IsPC() )
{
ConVarRef cl_hud_minmode( "cl_hud_minmode", true );
if ( cl_hud_minmode.IsValid() && cl_hud_minmode.GetBool() )
{
rDat->ProcessResolutionKeys( "_minmode" );
}
}
}
}
// save off the resource name
delete [] m_pResourceName;
m_pResourceName = new char[strlen(controlResourceName) + 1];
strcpy(m_pResourceName, controlResourceName);
if (pathID)
{
delete [] m_pResourcePathID;
m_pResourcePathID = new char[strlen(pathID) + 1];
strcpy(m_pResourcePathID, pathID);
}
// delete any controls not in both files
DeleteAllControlsCreatedByControlSettingsFile();
// loop through the resource data sticking info into controls
ApplySettings(rDat);
if (m_pParentPanel)
{
m_pParentPanel->InvalidateLayout();
m_pParentPanel->Repaint();
}
if ( rDat != pPreloadedKeyValues )
{
rDat->deleteThis();
}
}