Header for script parsing functions. More...
#include "common.h"
#include "../game/q_shared.h"
#include "../game/q_shared.h"
Go to the source code of this file.
Data Structures | |
struct | value_s |
struct | terrainType_s |
Different terrain definitions for footsteps and particles. More... | |
struct | constListEntry_s |
list of script aliases to register More... | |
Defines | |
#define | MEMBER_SIZEOF(TYPE, MEMBER) sizeof(((TYPE *)0)->MEMBER) |
#define | V_BASETYPEMASK 0x3F |
Allow to add extra bit into the type. | |
#define | SND_VOLUME_FOOTSTEPS 0.2f |
Typedefs | |
typedef struct value_s | value_t |
typedef struct terrainType_s | terrainType_t |
Different terrain definitions for footsteps and particles. | |
typedef struct constListEntry_s | constListEntry_t |
list of script aliases to register | |
Enumerations | |
enum | valueTypes_t { V_NULL, V_BOOL, V_CHAR, V_INT, V_INT2, V_FLOAT = 5, V_POS, V_VECTOR, V_COLOR, V_RGBA, V_STRING = 10, V_TRANSLATION_STRING, V_LONGSTRING, V_ALIGN, V_BLEND, V_STYLE = 15, V_FADE, V_SHAPE_SMALL, V_SHAPE_BIG, V_DMGTYPE, V_DMGWEIGHT = 20, V_DATE, V_RELABS, V_CLIENT_HUNK, V_CLIENT_HUNK_STRING, V_TEAM, V_RACE, V_UFO, V_UFOCRASHED, V_AIRCRAFTTYPE, V_NUM_TYPES } |
possible values for parsing functions More... | |
enum | align_t { ALIGN_UL, ALIGN_UC, ALIGN_UR, ALIGN_CL, ALIGN_CC, ALIGN_CR, ALIGN_LL, ALIGN_LC, ALIGN_LR, ALIGN_UL_RSL, ALIGN_UC_RSL, ALIGN_UR_RSL, ALIGN_CL_RSL, ALIGN_CC_RSL, ALIGN_CR_RSL, ALIGN_LL_RSL, ALIGN_LC_RSL, ALIGN_LR_RSL, ALIGN_LAST } |
We need this here for checking the boundaries from script values. More... | |
enum | blend_t { BLEND_REPLACE, BLEND_ONE, BLEND_BLEND, BLEND_ADD, BLEND_FILTER, BLEND_INVFILTER, BLEND_LAST, BLEND_REPLACE, BLEND_ONE_PARTICLE, BLEND_BLEND, BLEND_ADD, BLEND_FILTER, BLEND_INVFILTER, BLEND_LAST } |
enum | style_t { STYLE_FACING, STYLE_ROTATED, STYLE_BEAM, STYLE_LINE, STYLE_AXIS, STYLE_CIRCLE, STYLE_LAST } |
enum | fade_t { FADE_NONE, FADE_IN, FADE_OUT, FADE_SIN, FADE_SAW, FADE_LAST } |
enum | ufoType_t { UFO_SCOUT, UFO_FIGHTER, UFO_HARVESTER, UFO_CORRUPTER, UFO_BOMBER, UFO_CARRIER, UFO_SUPPLY, UFO_GUNBOAT, UFO_RIPPER, UFO_MOTHERSHIP, UFO_MAX } |
All different types of UFOs. More... | |
enum | resultStatus_t { RESULT_ERROR = -1, RESULT_WARNING = -2, RESULT_OK = 0 } |
Functions | |
int | Com_EParseValue (void *base, const char *token, valueTypes_t type, int ofs, size_t size) |
int | Com_SetValue (void *base, const void *set, valueTypes_t type, int ofs, size_t size) |
void * | Com_AlignPtr (void *memory, valueTypes_t type) |
Align a memory to use a natural address for the data type we will write. | |
const char * | Com_ValueToStr (const void *base, const valueTypes_t type, const int ofs) |
const char * | Com_GetLastParseError (void) |
int | Com_ParseValue (void *base, const char *token, valueTypes_t type, int ofs, size_t size, size_t *writtenBytes) |
Parse a value from a string. | |
qboolean | Com_ParseBoolean (const char *token) |
Parses a boolean from a string. | |
const terrainType_t * | Com_GetTerrainType (const char *textureName) |
Searches the terrain definition if given. | |
qboolean | Com_GetConstInt (const char *name, int *value) |
Searches whether a given value was registered as a string to int mapping. | |
qboolean | Com_GetConstIntFromNamespace (const char *space, const char *variable, int *value) |
Searches whether a given value was registered as a string to int mapping. | |
const char * | Com_GetConstVariable (const char *space, int value) |
Searches the mapping variable for a given integer value and a namespace. | |
qboolean | Com_UnregisterConstVariable (const char *name) |
Removes a registered constant from the script mapping hash table. | |
void | Com_RegisterConstInt (const char *name, int value) |
Register mappings between script strings and enum values for values of the type V_INT . | |
void | Com_RegisterConstList (const constListEntry_t constList[]) |
Registers a list of string aliases. | |
qboolean | Com_UnregisterConstList (const constListEntry_t constList[]) |
Unregisters a list of string aliases. | |
void | Com_ParseScripts (qboolean onlyServer) |
const char * | Com_EParse (const char **text, const char *errhead, const char *errinfo) |
Parsing function that prints an error message when there is no text in the buffer. | |
const char * | Com_GetRandomMapAssemblyNameForCraft (const char *craftID) |
Returns the name of an aircraft or an ufo that is used in the ump files for the random map assembly. | |
ufoType_t | Com_UFOShortNameToID (const char *token) |
Translate UFO type to short name. | |
const char * | Com_UFOTypeToShortName (ufoType_t type) |
Translate UFO type to short name. | |
const char * | Com_UFOCrashedTypeToShortName (ufoType_t type) |
Translate UFO type to short name when UFO is crashed. | |
int | Com_GetScriptChecksum (void) |
const ugv_t * | Com_GetUGVByIDSilent (const char *ugvID) |
Searches an UGV definition by a given script id and returns the pointer to the global data. | |
const ugv_t * | Com_GetUGVByID (const char *ugvID) |
Searches an UGV definition by a given script id and returns the pointer to the global data. | |
const char * | Com_DropShipTypeToShortName (humanAircraftType_t type) |
Translate DropShip type to short name. | |
humanAircraftType_t | Com_DropShipShortNameToID (const char *token) |
Translate DropShip type to short name. | |
void | Com_GetCharacterValues (const char *teamDefition, character_t *chr) |
Assign character values, 3D models and names to a character. | |
const char * | Com_GetActorSound (teamDef_t *td, int gender, actorSound_t soundType) |
Returns the actor sounds for a given category. | |
teamDef_t * | Com_GetTeamDefinitionByID (const char *team) |
Returns the teamDef pointer for the searched team id - or NULL if not found in the teamDef array. | |
const chrTemplate_t * | Com_GetCharacterTemplateByID (const char *chrTemplate) |
Returns the chrTemplate pointer for the given id - or NULL if not found in the chrTemplates array. | |
Variables | |
const char *const | vt_names [] |
possible values for parsing functions | |
const char *const | align_names [] |
const char *const | blend_names [] |
const char *const | style_names [] |
const char *const | fade_names [] |
const char *const | longlines_names [] |
const char *const | air_slot_type_strings [] |
List of valid strings for slot types. | |
const char *const | name_strings [] |
Header for script parsing functions.
Definition in file scripts.h.
#define MEMBER_SIZEOF | ( | TYPE, | |||
MEMBER | ) | sizeof(((TYPE *)0)->MEMBER) |
Definition at line 35 of file scripts.h.
Referenced by AIR_ParseAircraft(), and UI_GetIconByName().
#define SND_VOLUME_FOOTSTEPS 0.2f |
Definition at line 209 of file scripts.h.
Referenced by Com_ParseTerrain(), and LE_PlaySoundFileForContents().
#define V_BASETYPEMASK 0x3F |
Allow to add extra bit into the type.
Definition at line 42 of file scripts.h.
Referenced by UI_GetReferenceString(), UI_InitRawActionValue(), UI_NodeSetPropertyFromRAW(), and UI_ParseProperty().
typedef struct constListEntry_s constListEntry_t |
list of script aliases to register
typedef struct terrainType_s terrainType_t |
Different terrain definitions for footsteps and particles.
enum align_t |
We need this here for checking the boundaries from script values.
possible align values - see also align_names
enum blend_t |
enum fade_t |
enum resultStatus_t |
enum style_t |
enum ufoType_t |
enum valueTypes_t |
possible values for parsing functions
void* Com_AlignPtr | ( | void * | memory, | |
valueTypes_t | type | |||
) |
Align a memory to use a natural address for the data type we will write.
Definition at line 449 of file scripts.c.
References Sys_Error(), V_NULL, and V_NUM_TYPES.
Referenced by CL_ParsePtlCmds(), UI_InitRawActionValue(), and UI_ParseProperty().
humanAircraftType_t Com_DropShipShortNameToID | ( | const char * | token | ) |
Translate DropShip type to short name.
Definition at line 3069 of file scripts.c.
References Com_ParseValue(), and V_AIRCRAFTTYPE.
Referenced by BS_AddAircraftToMarket(), BS_GetAircraftBuyingPrice(), BS_GetAircraftOnMarket(), BS_GetAircraftSellingPrice(), BS_LoadXML(), BS_RemoveAircraftFromMarket(), and Com_ParseEquipment().
const char* Com_DropShipTypeToShortName | ( | humanAircraftType_t | type | ) |
Translate DropShip type to short name.
Definition at line 3081 of file scripts.c.
References Com_ValueToStr(), and V_AIRCRAFTTYPE.
Referenced by B_SetUpFirstBase(), BS_InitMarket(), BS_SaveXML(), CL_CampaignRunMarket(), and GAME_InitMenuOptions().
const char* Com_EParse | ( | const char ** | text, | |
const char * | errhead, | |||
const char * | errinfo | |||
) |
Parsing function that prints an error message when there is no text in the buffer.
Definition at line 275 of file scripts.c.
References Com_Parse(), and Com_Printf().
Referenced by AIR_ParseAircraft(), B_ParseBaseTemplate(), B_ParseBuildings(), CL_ParseAlienTeam(), CL_ParseCampaign(), CL_ParseCampaignEvents(), CL_ParseCities(), CL_ParseComponents(), CL_ParseCustomSkin(), CL_ParseEventMails(), CL_ParseLanguages(), CL_ParseMapDefinition(), CL_ParseNations(), CL_ParseParticle(), CL_ParsePtlCmds(), CL_ParseRanks(), CL_ParseResearchableCampaignStates(), CL_ParseResearchedCampaignItems(), CL_ParseSalary(), CL_ParseSequence(), CL_ParseTipsOfTheDay(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseActorSounds(), Com_ParseArmourOrResistance(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseFire(), Com_ParseGameTypes(), Com_ParseInventory(), Com_ParseItem(), Com_ParseTeam(), Com_ParseTerrain(), Com_ParseUGVs(), INS_ParseInstallations(), M_ParseMusic(), MSO_ParseCategories(), MSO_ParseSettings(), RS_ParseTechnologies(), SV_GetCvarToken(), SV_GetTileFromTileSet(), SV_ParseAssembly(), SV_ParseMapTile(), SV_ParseMapTileSet(), TUT_ParseTutorials(), UI_ParseActionList(), UI_ParseCallAction(), UI_ParseEventProperty(), UI_ParseExcludeRect(), UI_ParseFont(), UI_ParseNode(), UI_ParseNodeBody(), UI_ParseNodeProperties(), UI_ParseProperty(), UI_ParseSetAction(), UI_ParseUIModel(), and UP_ParseChapters().
int Com_EParseValue | ( | void * | base, | |
const char * | token, | |||
valueTypes_t | type, | |||
int | ofs, | |||
size_t | size | |||
) |
menu exampleName { string "_this is translatable" }
Definition at line 864 of file scripts.c.
References Com_ParseValue(), Com_Printf(), RESULT_ERROR, RESULT_OK, RESULT_WARNING, and Sys_Error().
Referenced by AIR_ParseAircraft(), B_ParseBaseTemplate(), B_ParseBuildings(), CL_ParseAlienTeam(), CL_ParseCampaign(), CL_ParseCampaignEvents(), CL_ParseCities(), CL_ParseCustomSkin(), CL_ParseEventMails(), CL_ParseMapDefinition(), CL_ParseMapParticle(), CL_ParseNations(), CL_ParsePtlCmds(), CL_ParseRanks(), CL_ParseSalary(), CL_SpawnParseEntitystring(), Com_ParseCharacterTemplate(), Com_ParseEquipment(), Com_ParseFire(), Com_ParseGameTypes(), Com_ParseInventory(), Com_ParseItem(), Com_ParseTeam(), Com_ParseTerrain(), Com_ParseUGVs(), INS_ParseInstallations(), RS_ParseTechnologies(), SEQ_Execute2Dobj(), SEQ_ExecuteCamera(), SEQ_ExecuteModel(), TUT_ParseTutorials(), UI_InitRawActionValue(), UI_ParseExcludeRect(), UI_ParseFont(), and UI_ParseUIModel().
const char* Com_GetActorSound | ( | teamDef_t * | td, | |
int | gender, | |||
actorSound_t | soundType | |||
) |
Returns the actor sounds for a given category.
[in] | td | teamDef pointer |
[in] | gender | The gender of the actor |
[in] | soundType | Which sound category (actorSound_t) |
Definition at line 2154 of file scripts.c.
References Com_DPrintf(), linkedList_s::data, DEBUG_CLIENT, DEBUG_SOUND, teamDef_s::id, NAME_LAST, linkedList_s::next, teamDef_s::numSounds, random, and teamDef_s::sounds.
Referenced by CL_ActorPlaySound().
const chrTemplate_t* Com_GetCharacterTemplateByID | ( | const char * | chrTemplate | ) |
Returns the chrTemplate pointer for the given id - or NULL if not found in the chrTemplates array.
[in] | team | The character template id (given in ufo-script files) |
Definition at line 2626 of file scripts.c.
References csi_s::chrTemplates, Com_Printf(), csi, i, chrTemplate_s::id, and csi_s::numChrTemplates.
Referenced by Com_ParseTeam().
void Com_GetCharacterValues | ( | const char * | teamDefition, | |
character_t * | chr | |||
) |
Assign character values, 3D models and names to a character.
[in] | teamDefition | The team definition id to use to generate the character values. |
[in,out] | chr | The character that should get the paths to the different models/skins. |
Definition at line 2208 of file scripts.c.
References ACTOR_SIZE_INVALID, ACTOR_SIZE_NORMAL, character_s::body, Com_Error(), Com_GetTeamDefinitionByID(), Com_GiveModel(), Com_GiveName(), ERR_DROP, character_s::fieldSize, character_s::gender, character_s::head, MODEL_BODY, MODEL_HEAD, MODEL_PATH, MODEL_SKIN, character_s::name, NAME_LAST, character_s::path, Q_strcat(), Q_strncpyz(), teamDef_s::size, character_s::skin, and character_s::teamDef.
Referenced by CL_GenerateCharacter(), and SV_InitGameProgs().
qboolean Com_GetConstInt | ( | const char * | name, | |
int * | value | |||
) |
Searches whether a given value was registered as a string to int mapping.
[in] | name | The name of the string mapping (maybe including a namespace) |
[out] | value | The mapped integer if found, not touched if the given string was found in the registered values. |
Definition at line 70 of file scripts.c.
References Com_ConstIntGetVariable(), Com_HashKey(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_s::fullname, hash(), com_constNameInt_s::hash_next, com_constNameInt_s::name, qfalse, qtrue, and com_constNameInt_s::value.
Referenced by Com_GetConstIntFromNamespace(), Com_ParseValue(), CP_LoadInterestsXML(), SV_InitGameProgs(), and testConstInt().
qboolean Com_GetConstIntFromNamespace | ( | const char * | space, | |
const char * | variable, | |||
int * | value | |||
) |
Searches whether a given value was registered as a string to int mapping.
[in] | space | The namespace of the mapping variable |
[in] | variable | The name of the string mapping |
[out] | value | The mapped integer if found, not touched if the given string was found in the registered values. |
Definition at line 103 of file scripts.c.
References Com_GetConstInt(), qfalse, and va().
Referenced by AIR_LoadAircraftXML(), B_LoadXML(), CL_LoadCharacterXML(), CP_LoadMissionsXML(), E_LoadXML(), INS_LoadXML(), MS_LoadXML(), RS_LoadXML(), SV_InitGameProgs(), and US_LoadXML().
const char* Com_GetConstVariable | ( | const char * | space, | |
int | value | |||
) |
Searches the mapping variable for a given integer value and a namespace.
[in] | value | The mapped integer |
[in] | namespace | The namespace to search in - might not be NULL or empty. |
Definition at line 122 of file scripts.c.
References com_constNameInt_s::fullname, com_constNameInt_s::name, com_constNameInt_s::next, and com_constNameInt_s::value.
Referenced by AIR_SaveAircraftXML(), B_SaveXML(), CL_SaveCharacterXML(), CP_SaveInterestsXML(), CP_SaveMissionsXML(), E_SaveXML(), INS_SaveXML(), MS_MessageSaveXML(), RS_SaveXML(), SV_InitGameProgs(), testConstInt(), and US_SaveXML().
const char* Com_GetLastParseError | ( | void | ) |
Returns the last error message
Definition at line 440 of file scripts.c.
Referenced by UI_NodeSetProperty(), and UI_ParseProperty().
const char* Com_GetRandomMapAssemblyNameForCraft | ( | const char * | craftID | ) |
Returns the name of an aircraft or an ufo that is used in the ump files for the random map assembly.
Definition at line 3058 of file scripts.c.
References va().
Referenced by CP_CreateBattleParameters(), GAME_InitMenuOptions(), GAME_SK_HideDropships(), and GAME_SK_HideUFOs().
int Com_GetScriptChecksum | ( | void | ) |
Definition at line 3298 of file scripts.c.
References Com_BlockChecksum(), FS_GetFileData(), and LittleLong().
Referenced by CL_CanMultiplayerStart(), and SV_Map().
teamDef_t* Com_GetTeamDefinitionByID | ( | const char * | team | ) |
Returns the teamDef pointer for the searched team id - or NULL if not found in the teamDef array.
[in] | team | The team id (given in ufo-script files) |
Definition at line 2188 of file scripts.c.
References Com_Printf(), csi, i, teamDef_s::id, csi_s::numTeamDefs, and csi_s::teamDef.
Referenced by AC_LoadXML(), AIR_LoadAircraftXML(), CL_LoadCharacterXML(), CL_ParseAlienTeam(), Com_GetCharacterValues(), GAME_ItemIsUseable(), and RS_AssignTechLinks().
const terrainType_t* Com_GetTerrainType | ( | const char * | textureName | ) |
Searches the terrain definition if given.
[in] | textureName | The terrain definition id from script files which is the texture name relative to base/textures |
Definition at line 2792 of file scripts.c.
References Com_HashKey(), hash(), terrainType_s::hash_next, TERRAIN_HASH_SIZE, and terrainType_s::texture.
Referenced by Com_ParseTerrain(), LE_PlaySoundFileAndParticleForSurface(), SV_GetBounceFraction(), and SV_GetFootstepSound().
const ugv_t* Com_GetUGVByID | ( | const char * | ugvID | ) |
Searches an UGV definition by a given script id and returns the pointer to the global data.
[in] | ugvID | The script id of the UGV definition you are looking for |
Definition at line 3144 of file scripts.c.
References Com_GetUGVByIDSilent(), Com_Printf(), csi, and csi_s::numUGV.
Referenced by E_InitialEmployees().
const ugv_t* Com_GetUGVByIDSilent | ( | const char * | ugvID | ) |
Searches an UGV definition by a given script id and returns the pointer to the global data.
[in] | ugvID | The script id of the UGV definition you are looking for |
Definition at line 3124 of file scripts.c.
References csi, i, ugv_s::id, csi_s::numUGV, and csi_s::ugvs.
Referenced by Com_GetUGVByID(), E_LoadXML(), and UP_Article().
qboolean Com_ParseBoolean | ( | const char * | token | ) |
Parses a boolean from a string.
token | The token to convert into a boolean |
false
if the string could not get parsed Definition at line 895 of file scripts.c.
References Com_ParseValue(), qfalse, RESULT_ERROR, and V_BOOL.
Referenced by GAME_CP_Results_f(), and HUD_RemainingTUs_f().
void Com_ParseScripts | ( | qboolean | onlyServer | ) |
Definition at line 3221 of file scripts.c.
References CL_ParseClientData(), Com_AddObjectLinks(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseInventory(), Com_ParseItem(), Com_ParseTeam(), Com_ParseTerrain(), Com_ParseUGVs(), Com_ParseVersion(), Com_Printf(), csi, csi_s::damBlast, csi_s::damFire, csi_s::damLaser, csi_s::damNormal, csi_s::damParticle, csi_s::damPlasma, csi_s::damShock, csi_s::damStunElectro, csi_s::damStunGas, FS_BuildFileList(), FS_NextScriptHeader(), csi_s::idArmour, csi_s::idBackpack, csi_s::idBelt, csi_s::idEquip, csi_s::idExtension, csi_s::idFloor, csi_s::idHeadgear, csi_s::idHolster, csi_s::idLeft, csi_s::idRight, INVSH_InitCSI(), name, NONE, csi_s::numDTs, csi_s::numEDs, csi_s::numIDs, csi_s::numODs, csi_s::numTeamDefs, Sys_Error(), and versionParsed.
Referenced by Qcommon_Init(), and UFO_InitSuiteInventory().
int Com_ParseValue | ( | void * | base, | |
const char * | token, | |||
valueTypes_t | type, | |||
int | ofs, | |||
size_t | size, | |||
size_t * | writtenBytes | |||
) |
Parse a value from a string.
[in] | base | The start pointer to a given data type (typedef, struct) where the parsed data is stored |
[in] | token | The data which should be parsed |
[in] | type | The data type that should be parsed |
[in] | ofs | The offset for the value |
[in] | size | The expected size of the data type. If 0, no checks are done |
[out] | writtenBytes |
Definition at line 472 of file scripts.c.
References ALIGN_LAST, BLEND_LAST, byte, Com_GetConstInt(), csi, DAYS_PER_YEAR, DROPSHIP_FIREBIRD, DROPSHIP_HERAKLES, DROPSHIP_RAPTOR, csi_s::dts, f, FADE_LAST, i, damageType_s::id, int(), INTERCEPTOR_DRAGON, INTERCEPTOR_SARACEN, INTERCEPTOR_STARCHASER, INTERCEPTOR_STILETTO, INTERCEPTOR_STINGRAY, MAX_VAR, csi_s::numDTs, Q_strncpyz(), qfalse, qtrue, RACE_BLOODSPIDER, RACE_CIVILIAN, RACE_ORTNOK, RACE_PHALANX_HUMAN, RACE_ROBOT, RACE_SHEVAAR, RACE_TAMAN, RESULT_ERROR, RESULT_OK, RESULT_WARNING, SECONDS_PER_HOUR, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, SHAPE_SMALL_MAX_HEIGHT, SHAPE_SMALL_MAX_WIDTH, STYLE_LAST, Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, UFO_BOMBER, UFO_CARRIER, UFO_CORRUPTER, UFO_FIGHTER, UFO_GUNBOAT, UFO_HARVESTER, UFO_MOTHERSHIP, UFO_RIPPER, UFO_SCOUT, UFO_SIZE_T, UFO_SUPPLY, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_CLIENT_HUNK, V_CLIENT_HUNK_STRING, V_COLOR, V_DATE, V_DMGTYPE, V_DMGWEIGHT, V_FADE, V_FLOAT, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_RACE, V_RELABS, V_RGBA, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_TRANSLATION_STRING, V_UFO, V_UFOCRASHED, and V_VECTOR.
Referenced by Com_DropShipShortNameToID(), Com_EParseValue(), Com_ParseBoolean(), Com_UFOShortNameToID(), UI_MaterialEditorChangeValue_f(), UI_NodeSetProperty(), UI_ParseProperty(), and UI_PushDropDownWindow_f().
void Com_RegisterConstInt | ( | const char * | name, | |
int | value | |||
) |
Register mappings between script strings and enum values for values of the type V_INT
.
name | The name of the script entry to map to an integer. This can also include a namespace prefix for the case we want to map back an integer to a string from a specific namespace. In case this string is equipped with a namespace, the string is in the form "namespace::variable" | |
value | The value to map the given name to |
Definition at line 204 of file scripts.c.
References com_aliasSysPool, Com_ConstIntGetVariable(), Com_HashKey(), Com_Printf(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_s::fullname, hash(), com_constNameInt_s::hash_next, Mem_PoolAlloc, Mem_StrDup, com_constNameInt_s::name, com_constNameInt_s::next, Q_strncpyz(), and com_constNameInt_s::value.
Referenced by Com_RegisterConstList(), SV_InitGameProgs(), testConstInt(), UI_RegisterAbstractNode(), UI_RegisterBaseInventoryNode(), UI_RegisterPanelNode(), and UI_RegisterTextNode().
void Com_RegisterConstList | ( | const constListEntry_t | constList[] | ) |
Registers a list of string aliases.
[in] | constList | Array of string => int mappings. Must be terminated with a NULL string ({NULL, -1}) line |
Definition at line 263 of file scripts.c.
References Com_RegisterConstInt(), i, name, constListEntry_s::name, and com_constNameInt_s::value.
Referenced by AIR_LoadAircraftXML(), AIR_SaveAircraftXML(), B_LoadXML(), B_SaveXML(), CL_LoadCharacterXML(), CL_SaveCharacterXML(), CP_LoadInterestsXML(), CP_LoadMissionsXML(), CP_SaveInterestsXML(), CP_SaveMissionsXML(), E_LoadXML(), E_SaveXML(), INS_LoadXML(), INS_SaveXML(), MS_LoadXML(), MS_MessageSaveXML(), RS_LoadXML(), RS_SaveXML(), testConstInt(), US_LoadXML(), and US_SaveXML().
int Com_SetValue | ( | void * | base, | |
const void * | set, | |||
valueTypes_t | type, | |||
int | ofs, | |||
size_t | size | |||
) |
[in] | base | The start pointer to a given data type (typedef, struct) |
[in] | set | The data which should be parsed |
[in] | type | The data type that should be parsed |
[in] | ofs | The offset for the value |
[in] | size | The expected size of the data type. If 0, no checks are done |
Definition at line 918 of file scripts.c.
References byte, Com_Printf(), DROPSHIP_FIREBIRD, DROPSHIP_HERAKLES, DROPSHIP_RAPTOR, int(), INTERCEPTOR_DRAGON, INTERCEPTOR_SARACEN, INTERCEPTOR_STARCHASER, INTERCEPTOR_STILETTO, INTERCEPTOR_STINGRAY, len, MAX_VAR, Q_strncpyz(), qfalse, qtrue, RACE_BLOODSPIDER, RACE_CIVILIAN, RACE_ORTNOK, RACE_PHALANX_HUMAN, RACE_ROBOT, RACE_SHEVAAR, RACE_TAMAN, SHAPE_BIG_MAX_HEIGHT, SHAPE_SMALL_MAX_HEIGHT, Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, UFO_BOMBER, UFO_CARRIER, UFO_CORRUPTER, UFO_FIGHTER, UFO_GUNBOAT, UFO_HARVESTER, UFO_MOTHERSHIP, UFO_RIPPER, UFO_SCOUT, UFO_SIZE_T, UFO_SUPPLY, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DATE, V_DMGTYPE, V_DMGWEIGHT, V_FADE, V_FLOAT, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_RACE, V_RGBA, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_UFO, V_UFOCRASHED, and V_VECTOR.
Referenced by CL_ParticleFunction(), and UI_NodeSetPropertyFromRAW().
const char* Com_UFOCrashedTypeToShortName | ( | ufoType_t | type | ) |
Translate UFO type to short name when UFO is crashed.
Definition at line 3113 of file scripts.c.
References Com_ValueToStr(), and V_UFOCRASHED.
Referenced by CP_CreateBattleParameters(), CP_MapIsSelectable(), and GAME_InitMenuOptions().
ufoType_t Com_UFOShortNameToID | ( | const char * | token | ) |
Translate UFO type to short name.
Definition at line 3091 of file scripts.c.
References Com_ParseValue(), and V_UFO.
Referenced by AIR_ParseAircraft().
const char* Com_UFOTypeToShortName | ( | ufoType_t | type | ) |
Translate UFO type to short name.
Definition at line 3104 of file scripts.c.
References Com_ValueToStr(), and V_UFO.
Referenced by CP_ChooseMap(), CP_CreateBattleParameters(), CP_MapIsSelectable(), CP_MissionBegin(), CP_SupplyMissionCreate(), GAME_InitMenuOptions(), NAT_ScriptSanityCheck(), UFO_GetTechnologyFromType(), and UFO_MissionResultToString().
qboolean Com_UnregisterConstList | ( | const constListEntry_t | constList[] | ) |
Unregisters a list of string aliases.
[in] | constList | Array of string => int mappings. Must be terminated with a NULL string ({NULL, -1}) line |
Definition at line 246 of file scripts.c.
References Com_UnregisterConstVariable(), i, name, constListEntry_s::name, and qtrue.
Referenced by AIR_LoadAircraftXML(), AIR_SaveAircraftXML(), B_LoadXML(), B_SaveXML(), CL_LoadCharacterXML(), CL_SaveCharacterXML(), CP_LoadInterestsXML(), CP_LoadMissionsXML(), CP_SaveInterestsXML(), CP_SaveMissionsXML(), E_LoadXML(), E_SaveXML(), INS_LoadXML(), INS_SaveXML(), MS_LoadXML(), MS_MessageSaveXML(), RS_LoadXML(), RS_SaveXML(), testConstInt(), US_LoadXML(), and US_SaveXML().
qboolean Com_UnregisterConstVariable | ( | const char * | name | ) |
Removes a registered constant from the script mapping hash table.
name | The name of the script entry to remove out of the const int hash. In case this string is equipped with a namespace, the string is in the form "namespace::variable". If you try to unregister a variable that was registered with a namespace, this namespace must be included in the given name, too. |
Definition at line 148 of file scripts.c.
References Com_ConstIntGetVariable(), Com_HashKey(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_s::fullname, hash(), com_constNameInt_s::hash_next, Mem_Free, com_constNameInt_s::next, qfalse, and qtrue.
Referenced by Com_UnregisterConstList(), SV_InitGameProgs(), and testConstInt().
const char* Com_ValueToStr | ( | const void * | base, | |
const valueTypes_t | type, | |||
const int | ofs | |||
) |
[in] | base | The start pointer to a given data type (typedef, struct) |
[in] | type | The data type that should be parsed |
[in] | ofs | The offset for the value |
Definition at line 1150 of file scripts.c.
References ALIGN_LAST, BLEND_LAST, byte, Com_sprintf(), csi, DAYS_PER_YEAR, DROPSHIP_FIREBIRD, DROPSHIP_HERAKLES, DROPSHIP_RAPTOR, csi_s::dts, FADE_LAST, INTERCEPTOR_DRAGON, INTERCEPTOR_SARACEN, INTERCEPTOR_STARCHASER, INTERCEPTOR_STILETTO, INTERCEPTOR_STINGRAY, MAX_DAMAGETYPES, MAX_VAR, Q_strncpyz(), RACE_BLOODSPIDER, RACE_CIVILIAN, RACE_ORTNOK, RACE_PHALANX_HUMAN, RACE_ROBOT, RACE_SHEVAAR, RACE_TAMAN, STYLE_LAST, Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, UFO_BOMBER, UFO_CARRIER, UFO_CORRUPTER, UFO_FIGHTER, UFO_GUNBOAT, UFO_HARVESTER, UFO_MOTHERSHIP, UFO_RIPPER, UFO_SCOUT, UFO_SUPPLY, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_CLIENT_HUNK, V_CLIENT_HUNK_STRING, V_COLOR, V_DATE, V_DMGTYPE, V_DMGWEIGHT, V_FADE, V_FLOAT, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_RACE, V_RELABS, V_RGBA, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_TRANSLATION_STRING, V_UFO, V_UFOCRASHED, and V_VECTOR.
Referenced by Com_DropShipTypeToShortName(), Com_UFOCrashedTypeToShortName(), Com_UFOTypeToShortName(), E_CreateEmployeeAtIndex(), MP_GetEquipment(), PTL_DebugList_f(), UI_GetReferenceString(), and UI_GetStringFromNodeProperty().
const char* const air_slot_type_strings[] |
List of valid strings for slot types.
Definition at line 1621 of file scripts.c.
Referenced by AIR_ParseAircraft().
const char* const align_names[] |
const char* const blend_names[] |
const char* const fade_names[] |
const char* const longlines_names[] |
const char* const name_strings[] |
const char* const style_names[] |
const char* const vt_names[] |
possible values for parsing functions
Definition at line 310 of file scripts.c.
Referenced by CL_ParsePtlCmds(), and CL_ParticleFunction().