本文整理汇总了C++中KeyValues::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyValues::GetName方法的具体用法?C++ KeyValues::GetName怎么用?C++ KeyValues::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyValues
的用法示例。
在下文中一共展示了KeyValues::GetName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseModelResInfo
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseModelPanel::ParseModelResInfo( KeyValues *inResourceData )
{
m_bForcePos = ( inResourceData->GetInt( "force_pos", 0 ) == 1 );
m_BMPResData.m_pszModelName = ReadAndAllocStringValue( inResourceData, "modelname" );
m_BMPResData.m_pszModelName_HWM = ReadAndAllocStringValue( inResourceData, "modelname_hwm" );
m_BMPResData.m_pszVCD = ReadAndAllocStringValue( inResourceData, "vcd" );
m_BMPResData.m_angModelPoseRot.Init( inResourceData->GetFloat( "angles_x", 0.0f ), inResourceData->GetFloat( "angles_y", 0.0f ), inResourceData->GetFloat( "angles_z", 0.0f ) );
m_BMPResData.m_vecOriginOffset.Init( inResourceData->GetFloat( "origin_x", 110.0 ), inResourceData->GetFloat( "origin_y", 5.0 ), inResourceData->GetFloat( "origin_z", 5.0 ) );
m_BMPResData.m_vecFramedOriginOffset.Init( inResourceData->GetFloat( "frame_origin_x", 110.0 ), inResourceData->GetFloat( "frame_origin_y", 5.0 ), inResourceData->GetFloat( "frame_origin_z", 5.0 ) );
m_BMPResData.m_vecViewportOffset.Init();
m_BMPResData.m_nSkin = inResourceData->GetInt( "skin", -1 );
m_BMPResData.m_bUseSpotlight = ( inResourceData->GetInt( "spotlight", 0 ) == 1 );
m_angPlayer = m_BMPResData.m_angModelPoseRot;
m_vecPlayerPos = m_BMPResData.m_vecOriginOffset;
for ( KeyValues *pData = inResourceData->GetFirstSubKey(); pData != NULL; pData = pData->GetNextKey() )
{
if ( !Q_stricmp( pData->GetName(), "animation" ) )
{
ParseModelAnimInfo( pData );
}
else if ( !Q_stricmp( pData->GetName(), "attached_model" ) )
{
ParseModelAttachInfo( pData );
}
}
}
示例2: PrecacheFileWeaponInfoDatabase
void PrecacheFileWeaponInfoDatabase( IFileSystem *filesystem, const unsigned char *pICEKey )
{
if ( m_WeaponInfoDatabase.Count() )
return;
KeyValues *manifest = new KeyValues( "weaponscripts" );
manifest->UsesEscapeSequences( true );
if ( manifest->LoadFromFile( filesystem, "scripts/weapon_manifest.txt", "GAME" ) )
{
for ( KeyValues *sub = manifest->GetFirstSubKey(); sub != NULL ; sub = sub->GetNextKey() )
{
if ( !Q_stricmp( sub->GetName(), "file" ) )
{
char fileBase[512];
Q_FileBase( sub->GetString(), fileBase, sizeof(fileBase) );
WEAPON_FILE_INFO_HANDLE tmp;
#ifdef CLIENT_DLL
if ( ReadWeaponDataFromFileForSlot( filesystem, fileBase, &tmp, pICEKey ) )
{
gWR.LoadWeaponSprites( tmp );
}
#else
ReadWeaponDataFromFileForSlot( filesystem, fileBase, &tmp, pICEKey );
#endif
}
else
{
Error( "Expecting 'file', got %s\n", sub->GetName() );
}
}
}
manifest->deleteThis();
}
示例3: LoadFromKeyValues
void CRoomTemplate::LoadFromKeyValues( const char *pRoomName, KeyValues *pKeyValues )
{
m_nTilesX = pKeyValues->GetInt( "TilesX", 1 );
m_nTilesY = pKeyValues->GetInt( "TilesY", 1 );
SetSpawnWeight( pKeyValues->GetInt( "SpawnWeight", MIN_SPAWN_WEIGHT ) );
SetFullName( pRoomName );
Q_strncpy( m_Description, pKeyValues->GetString( "RoomTemplateDescription", "" ), m_nMaxDescriptionLength );
Q_strncpy( m_Soundscape, pKeyValues->GetString( "Soundscape", "" ), m_nMaxSoundscapeLength );
SetTileType( pKeyValues->GetInt( "TileType", ASW_TILETYPE_UNKNOWN ) );
m_Tags.RemoveAll();
// search through all the exit subsections
KeyValues *pkvSubSection = pKeyValues->GetFirstSubKey();
bool bClearedExits = false;
while ( pkvSubSection )
{
// mission details
if ( Q_stricmp(pkvSubSection->GetName(), "EXIT")==0 )
{
if ( !bClearedExits )
{
// if we haven't cleared previous exits yet then do so now
m_Exits.PurgeAndDeleteElements();
bClearedExits = true;
}
CRoomTemplateExit *pExit = new CRoomTemplateExit();
pExit->m_iXPos = pkvSubSection->GetInt("XPos");
pExit->m_iYPos = pkvSubSection->GetInt("YPos");
pExit->m_ExitDirection = (ExitDirection_t) pkvSubSection->GetInt("ExitDirection");
pExit->m_iZChange = pkvSubSection->GetInt("ZChange");
Q_strncpy( pExit->m_szExitTag, pkvSubSection->GetString( "ExitTag" ), sizeof( pExit->m_szExitTag ) );
pExit->m_bChokepointGrowSource = !!pkvSubSection->GetInt("ChokeGrow", 0);
// discard exits outside the room bounds
if ( pExit->m_iXPos < 0 || pExit->m_iYPos < 0 || pExit->m_iXPos >= m_nTilesX || pExit->m_iYPos >= m_nTilesY )
{
delete pExit;
}
else
{
m_Exits.AddToTail(pExit);
}
}
else if ( Q_stricmp(pkvSubSection->GetName(), "Tags")==0 && TagList() )
{
for ( KeyValues *sub = pkvSubSection->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() )
{
if ( !Q_stricmp( sub->GetName(), "tag" ) )
{
AddTag( sub->GetString() );
}
}
}
pkvSubSection = pkvSubSection->GetNextKey();
}
}
示例4: PhysParseSurfaceData
void PhysParseSurfaceData( IPhysicsSurfaceProps *pProps, IFileSystem *pFileSystem )
{
KeyValues *manifest = new KeyValues( SURFACEPROP_MANIFEST_FILE );
if ( manifest->LoadFromFile( pFileSystem, SURFACEPROP_MANIFEST_FILE, "GAME" ) )
{
for ( KeyValues *sub = manifest->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() )
{
if ( !Q_stricmp( sub->GetName(), "file" ) )
{
// Add
AddSurfacepropFile( sub->GetString(), pProps, pFileSystem );
continue;
}
Warning( "surfaceprops::Init: Manifest '%s' with bogus file type '%s', expecting 'file'\n",
SURFACEPROP_MANIFEST_FILE, sub->GetName() );
}
}
else
{
Error( "Unable to load manifest file '%s'\n", SURFACEPROP_MANIFEST_FILE );
}
manifest->deleteThis();
}
示例5: AddLevelContainer
bool VMFExporter::AddLevelContainer()
{
KeyValues *pLevelContainerKeys = new KeyValues( "LevelContainer" );
if ( !pLevelContainerKeys->LoadFromFile( g_pFullFileSystem, "tilegen/roomtemplates/levelcontainer.vmf.no_func_detail", "GAME" ) )
return false;
m_bWritingLevelContainer = true;
// set the extents of the map
m_pMapLayout->GetExtents(m_iMapExtents_XMin, m_iMapExtents_XMax, m_iMapExtents_YMin, m_iMapExtents_YMax);
Msg( "Layout extents: Topleft: %f %f - Lower right: %f %f\n", m_iMapExtents_XMin, m_iMapExtents_YMin, m_iMapExtents_XMax, m_iMapExtents_YMax );
// adjust to be relative to the centre of the map
int half_map_size = MAP_LAYOUT_TILES_WIDE * 0.5f;
m_iMapExtents_XMin -= half_map_size;
m_iMapExtents_XMax -= half_map_size;
m_iMapExtents_YMin -= half_map_size;
m_iMapExtents_YMax -= half_map_size;
// pad them by 2 blocks, so the player doesn't move his camera into the wall when at an edge block
m_iMapExtents_XMin -= 2;
m_iMapExtents_XMax += 2;
m_iMapExtents_YMin -= 2;
m_iMapExtents_YMax += 2;
Msg( " Adjusted to: Topleft: %d %d - Lower right: %d %d\n", m_iMapExtents_XMin, m_iMapExtents_YMin, m_iMapExtents_XMax, m_iMapExtents_YMax );
// find world keys
KeyValues *pWorldKeys = NULL;
for ( KeyValues *pKeys = pLevelContainerKeys; pKeys; pKeys = pKeys->GetNextKey() )
{
const char *szName = pKeys->GetName();
if ( !Q_stricmp( szName, "world" ) )
{
pWorldKeys = pKeys;
break;
}
}
if ( !pWorldKeys || !ProcessWorld( pWorldKeys ) )
{
Q_snprintf( m_szLastExporterError, sizeof(m_szLastExporterError), "Failed to copy level container\n" );
return false;
}
m_bWritingLevelContainer = false;
for ( KeyValues *pKeys = pWorldKeys->GetFirstSubKey(); pKeys; pKeys = pKeys->GetNextKey() )
{
const char *szName = pKeys->GetName();
if ( !Q_stricmp( szName, "solid" ) )
{
m_pExportWorldKeys->AddSubKey( pKeys->MakeCopy() );
}
}
pLevelContainerKeys->deleteThis();
m_pTemplateKeys->deleteThis();
m_pTemplateKeys = NULL;
return true;
}
示例6:
bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, bool show)
{
KeyValues *SubKey = NULL;
int count = 0;
cell_t players[] = {client};
#if SOURCE_ENGINE == SE_CSGO
CCSUsrMsg_VGUIMenu *pMsg;
if ((pMsg = (CCSUsrMsg_VGUIMenu *)g_UserMsgs.StartProtobufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
}
#else
bf_write *pBitBuf = NULL;
if ((pBitBuf = g_UserMsgs.StartBitBufMessage(m_VGUIMenu, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
}
#endif
if (data)
{
SubKey = data->GetFirstSubKey();
while (SubKey)
{
count++;
SubKey = SubKey->GetNextKey();
}
SubKey = data->GetFirstSubKey();
}
#if SOURCE_ENGINE == SE_CSGO
pMsg->set_name(name);
pMsg->set_show(show);
while (SubKey)
{
CCSUsrMsg_VGUIMenu_Subkey *key = pMsg->add_subkeys();
key->set_name(SubKey->GetName());
key->set_str(SubKey->GetString());
SubKey = SubKey->GetNextKey();
}
#else
pBitBuf->WriteString(name);
pBitBuf->WriteByte((show) ? 1 : 0);
pBitBuf->WriteByte(count);
while (SubKey)
{
pBitBuf->WriteString(SubKey->GetName());
pBitBuf->WriteString(SubKey->GetString());
SubKey = SubKey->GetNextKey();
}
#endif
g_UserMsgs.EndMessage();
return true;
}
示例7: PrecacheFileWeaponInfoDatabase
void PrecacheFileWeaponInfoDatabase( IFileSystem *filesystem, const unsigned char *pICEKey )
{
if ( m_WeaponInfoDatabase.Count() )
return;
#if !defined( _XBOX )
FileFindHandle_t findHandle;
const char *pFilename = filesystem->FindFirstEx( "scripts/weapon_*.txt", IsXbox() ? "XGAME" : "GAME", &findHandle );
while ( pFilename != NULL )
{
char fileBase[512];
Q_FileBase( pFilename, fileBase, sizeof(fileBase) );
WEAPON_FILE_INFO_HANDLE tmp;
#ifdef CLIENT_DLL
if ( ReadWeaponDataFromFileForSlot( filesystem, fileBase, &tmp, pICEKey ) )
{
gWR.LoadWeaponSprites( tmp );
}
#else
ReadWeaponDataFromFileForSlot( filesystem, fileBase, &tmp, pICEKey );
#endif
pFilename = filesystem->FindNext( findHandle );
}
filesystem->FindClose( findHandle );
#else
#define WEAPON_SCRIPT_MANIFEST_FILE "scripts/_weapon_manifest.txt"
// Use a manifest file on the xbox
KeyValues *manifest = new KeyValues( "weaponscripts" );
if ( manifest->LoadFromFile( filesystem, WEAPON_SCRIPT_MANIFEST_FILE, "XGAME" ) )
{
for ( KeyValues *sub = manifest->GetFirstSubKey(); sub != NULL ; sub = sub->GetNextKey() )
{
if ( !Q_stricmp( sub->GetName(), "file" ) )
{
char fileBase[512];
Q_FileBase( sub->GetString(), fileBase, sizeof(fileBase) );
WEAPON_FILE_INFO_HANDLE tmp;
#ifdef CLIENT_DLL
if ( ReadWeaponDataFromFileForSlot( filesystem, fileBase, &tmp, pICEKey ) )
{
gWR.LoadWeaponSprites( tmp );
}
#else
ReadWeaponDataFromFileForSlot( filesystem, fileBase, &tmp, pICEKey );
#endif
}
else
{
Error( "Expecting 'file', got %s\n", sub->GetName() );
}
}
}
manifest->deleteThis();
#endif
}
示例8: BaseInit
//-----------------------------------------------------------------------------
// Purpose:
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CSoundEmitterSystemBase::BaseInit()
{
if ( m_SoundKeyValues.Count() > 0 )
{
BaseShutdown();
}
KeyValues *manifest = new KeyValues( MANIFEST_FILE );
if ( manifest->LoadFromFile( filesystem, MANIFEST_FILE, "GAME" ) )
{
for ( KeyValues *sub = manifest->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() )
{
if ( !Q_stricmp( sub->GetName(), "precache_file" ) )
{
// Add and always precache
AddSoundsFromFile( sub->GetString(), true );
continue;
}
else if ( !Q_stricmp( sub->GetName(), "declare_file" ) )
{
// Add but don't precache
AddSoundsFromFile( sub->GetString(), false );
continue;
}
Warning( "CSoundEmitterSystemBase::BaseInit: Manifest '%s' with bogus file type '%s', expecting 'declare_file' or 'precache_file'\n",
MANIFEST_FILE, sub->GetName() );
}
}
else
{
Error( "Unable to load manifest file '%s'\n", MANIFEST_FILE );
}
// Only print total once, on server
#if !defined( CLIENT_DLL )
int missing = CheckForMissingWavFiles( false );
if ( missing > 0 )
{
DevMsg( 1, "CSoundEmitterSystem: Registered %i sounds ( %i missing .wav files referenced )\n",
m_Sounds.Count(), missing );
}
else
{
DevMsg( 1, "CSoundEmitterSystem: Registered %i sounds\n",
m_Sounds.Count() );
}
#endif
return true;
}
示例9: AddSoundsFromFile
//-----------------------------------------------------------------------------
// Purpose:
// Input : *filename -
//-----------------------------------------------------------------------------
void CSoundEmitterSystemBase::AddSoundsFromFile( const char *filename, bool precachealways )
{
CSoundScriptFile sf;
Assert( Q_strlen( filename ) < sizeof( sf.filename ) );
Q_strncpy( sf.filename, filename, sizeof( sf.filename ) );
sf.dirty = false;
sf.precachealways = precachealways;
int scriptindex = m_SoundKeyValues.AddToTail( sf );
// Open the soundscape data file, and abort if we can't
KeyValues *kv = new KeyValues( filename );
if ( kv->LoadFromFile( filesystem, filename, "GAME" ) )
{
// parse out all of the top level sections and save their names
KeyValues *pKeys = kv;
while ( pKeys )
{
if ( pKeys->GetFirstSubKey() )
{
CSoundEntry entry;
entry.m_bRemoved = false;
entry.m_nScriptFileIndex = scriptindex;
entry.m_bPrecacheAlways = precachealways;
int lookup = m_Sounds.Find( pKeys->GetName() );
if ( lookup != m_Sounds.InvalidIndex() )
{
DevMsg( "CSoundEmitterSystem::AddSoundsFromFile(%s): Entry %s duplicated, skipping\n", filename, pKeys->GetName() );
}
else
{
InitSoundInternalParameters( pKeys->GetName(), pKeys, entry.m_SoundParams );
m_Sounds.Insert( pKeys->GetName(), entry );
}
}
pKeys = pKeys->GetNextKey();
}
}
else
{
Msg( "CSoundEmitterSystem::AddSoundsFromFile: No such file %s\n", filename );
// Discard
m_SoundKeyValues.Remove( scriptindex );
kv->deleteThis();
return;
}
Assert( scriptindex >= 0 );
}
示例10: ParseMaterialVars
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CMaterialSubRect::ParseMaterialVars( KeyValues &keyValues )
{
KeyValues *pKeyValues = &keyValues;
// I'm not quite sure how this can happen, but we'll see...
const char *pShaderName = pKeyValues->GetName();
if ( !pShaderName )
{
DevWarning( 1, "CMaterialSubRect::InitializeShader: Shader not specified in material %s.\n", GetName() );
Assert( 0 );
pShaderName = IsPC() ? "Wireframe_DX6" : "Wireframe_DX9";
}
// Verify we have the correct "shader." There is only one type.
if ( !Q_strcmp( pShaderName, "Subrect" ) )
{
KeyValues *pVar = pKeyValues->GetFirstSubKey();
while ( pVar )
{
if ( !Q_strcmp( pVar->GetName(), "$Pos" ) )
{
sscanf( pVar->GetString(), "%f %f", &m_vecOffset.x, &m_vecOffset.y );
}
if ( !Q_strcmp( pVar->GetName(), "$Size" ) )
{
sscanf( pVar->GetString(), "%f %f", &m_vecSize.x, &m_vecSize.y );
}
if ( !Q_strcmp( pVar->GetName(), "$Material" ) )
{
m_pMaterialPage = static_cast<IMaterialInternal*>( MaterialSystem()->FindMaterial( pVar->GetString(), TEXTURE_GROUP_DECAL ) );
m_pMaterialPage = m_pMaterialPage->GetRealTimeVersion(); //always work with the realtime material internally
}
// if ( !Q_strcmp( pVar->GetName(), "$decalscale" ) )
// {
// m_flDecalScale = pVar->GetFloat();
// }
// Add var to list.
IMaterialVar *pNewVar = CreateMaterialVarFromKeyValue( this, pVar );
if ( pNewVar )
{
m_aMaterialVars.AddToTail( pNewVar );
}
// Continue getting the keys until they are all found.
pVar = pVar->GetNextKey();
}
}
}
示例11: HandleRemoveEnitity
bool CMapAdd::HandleRemoveEnitity( KeyValues *mapaddValue)
{
if(AllocPooledString(mapaddValue->GetName()) == AllocPooledString("remove:sphere"))
{
Vector RemoveVector = Vector(0,0,0);
CBaseEntity *ppEnts[256];
// CBaseEntity *ppCandidates[256];
RemoveVector.x = mapaddValue->GetFloat("x", RemoveVector.x);
RemoveVector.y = mapaddValue->GetFloat("y", RemoveVector.y);
RemoveVector.z = mapaddValue->GetFloat("z", RemoveVector.z);
int nEntCount = UTIL_EntitiesInSphere( ppEnts, 256, RemoveVector, mapaddValue->GetFloat("radius", 0), 0 );
//Look through the entities it found
KeyValues *pEntKeyValues = mapaddValue->FindKey("entities");
if(pEntKeyValues)
{
KeyValues *pEntKeyValuesRemove = pEntKeyValues->GetFirstValue();
while(pEntKeyValuesRemove)
{
int i;
for ( i = 0; i < nEntCount; i++ )
{
if ( ppEnts[i] == NULL )
continue;
if(AllocPooledString(pEntKeyValuesRemove->GetName()) == AllocPooledString("classname")) // || ( AllocPooledString(pEntKeyValuesRemove->GetName()) == ppEnts[i]->GetEntityName())
{
if(AllocPooledString(pEntKeyValuesRemove->GetString()) == AllocPooledString(ppEnts[i]->GetClassname()))
{
UTIL_Remove(ppEnts[i]);
continue;
}
}
if(AllocPooledString(pEntKeyValuesRemove->GetName()) == AllocPooledString("targetname")) // || ( AllocPooledString(pEntKeyValuesRemove->GetName()) == ppEnts[i]->GetEntityName())
{
if(AllocPooledString(pEntKeyValuesRemove->GetString()) == ppEnts[i]->GetEntityName())
{
UTIL_Remove(ppEnts[i]);
continue;
}
}
}
pEntKeyValuesRemove = pEntKeyValuesRemove->GetNextValue();
}
}
return true;
}
return false;
}
示例12: OverrideDefaultsForModel
void OverrideDefaultsForModel( const char *keyname, simplifyparams_t ¶ms )
{
KeyValues *pKeys = g_pModelConfig;
while ( pKeys )
{
if ( !Q_stricmp( pKeys->GetName(), keyname ) )
{
for ( KeyValues *pData = pKeys->GetFirstSubKey(); pData; pData = pData->GetNextKey() )
{
if ( !Q_stricmp( pData->GetName(), "tolerance" ) )
{
params.tolerance = pData->GetFloat();
if (!g_bQuiet)
{
Msg("%s: tolerance set to %.2f\n", keyname, params.tolerance );
}
}
else if ( !Q_stricmp( pData->GetName(), "addAABB" ) )
{
params.addAABBToSimplifiedHull = pData->GetInt() ? true : false;
if (!g_bQuiet)
{
Msg("%s: AABB %s\n", keyname, params.addAABBToSimplifiedHull ? "on" : "off" );
}
}
else if ( !Q_stricmp( pData->GetName(), "singleconvex" ) )
{
params.forceSingleConvex = pData->GetInt() ? true : false;
if (!g_bQuiet)
{
Msg("%s: Forced to single convex\n", keyname );
}
}
else if ( !Q_stricmp( pData->GetName(), "mergeconvex" ) )
{
params.mergeConvexTolerance = pData->GetFloat();
params.mergeConvexElements = params.mergeConvexTolerance > 0 ? true : false;
if (!g_bQuiet)
{
Msg("%s: Merge convex %.2f\n", keyname, params.mergeConvexTolerance );
}
}
}
return;
}
pKeys = pKeys->GetNextKey();
}
}
示例13: BuildCheckdirList
void BuildCheckdirList()
{
vprint( 0, "Checking for dirlist\n" );
// Search for unusedcontent.cfg file
if ( g_pFileSystem->FileExists( UNUSEDCONTENT_CFG, "GAME") )
{
KeyValues *kv = new KeyValues( UNUSEDCONTENT_CFG );
if ( kv )
{
if ( kv->LoadFromFile( g_pFileSystem, UNUSEDCONTENT_CFG, "GAME" ) )
{
for ( KeyValues *sub = kv->GetFirstSubKey(); sub; sub = sub->GetNextKey() )
{
if ( !Q_stricmp( sub->GetName(), "dir" ) )
{
AddCheckdir( sub->GetString() );
}
else if ( !Q_stricmp( sub->GetName(), "ignore" ) )
{
AddIgnoredir( sub->GetString() );
}
else
{
vprint( 1, "Unknown subkey '%s' in %s\n", sub->GetName(), UNUSEDCONTENT_CFG );
}
}
}
kv->deleteThis();
}
}
else
{
int c = ARRAYSIZE( directories_to_check );
int i;
for ( i = 0; i < c; ++i )
{
AddCheckdir( directories_to_check[ i ] );
}
// add the list of dirs to ignore from the others lists
c = ARRAYSIZE( directories_to_ignore );
for ( i = 0; i < c; ++i )
{
AddIgnoredir( directories_to_ignore[ i ] );
}
}
}
示例14: SetupList
// fills in the target list panel with buttons for each of the entries in the desired list
bool SwarmopediaTopics::SetupList(SwarmopediaPanel *pPanel, const char *szDesiredList)
{
// look through our KeyValues for the desired list
KeyValues *pkvList = GetSubkeyForList(szDesiredList);
if (!pkvList)
{
Msg("Swarmopedia error: Couldn't find list %s\n", szDesiredList);
return false;
}
// now go through every LISTENTRY in the subkey we found, adding it to the list panel
int iPlayerUnlockLevel = 999; // todo: have this check a convar that measures how far through the jacob campaign the player has got
while ( pkvList )
{
if (Q_stricmp(pkvList->GetName(), "LISTENTRY")==0)
{
const char *szEntryName = pkvList->GetString("Name");
const char *szArticleTarget = pkvList->GetString("ArticleTarget");
const char *szListTarget = pkvList->GetString("ListTarget");
int iEntryUnlockLevel = pkvList->GetInt("UnlockLevel");
int iSectionHeader = pkvList->GetInt("SectionHeader");
if (iEntryUnlockLevel == 0 || iEntryUnlockLevel < iPlayerUnlockLevel)
{
pPanel->AddListEntry(szEntryName, szArticleTarget, szListTarget, iSectionHeader);
}
}
pkvList = pkvList->GetNextKey();
}
return true;
}
示例15: ReorderObjectives
// sets priority of objective entities based on the order the rooms were listed in the mission/objective txt
void VMFExporter::ReorderObjectives( const CRoomTemplate *pTemplate, KeyValues *pTemplateKeys )
{
KeyValues *pKeys = m_pTemplateKeys;
while ( pKeys )
{
if ( !Q_stricmp( pKeys->GetName(), "entity" ) && !Q_strnicmp( pKeys->GetString( "classname" ), "asw_objective", 13 ) )
{
if ( pKeys->GetFloat( "Priority" ) != 0 ) // if level designer has already set priority, then don't override it
{
pKeys = pKeys->GetNextKey();
continue;
}
int iPriority = 100;
// We no longer have a requested rooms array, so this code is not valid. Need to replace it with something else to ensure priorities are set correctly.
// for ( int i = 0; i < m_pMapLayout->m_pRequestedRooms.Count(); i++ )
// {
// if ( m_pMapLayout->m_pRequestedRooms[i]->m_pRoomTemplate == pTemplate )
// {
// iPriority = m_pMapLayout->m_pRequestedRooms[i]->m_iMissionTextOrder;
// }
// }
pKeys->SetFloat( "Priority", iPriority );
}
pKeys = pKeys->GetNextKey();
}
}