UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cl_game_team.h File Reference

cgame team management headers. More...

#include "../../common/xml.h"

Go to the source code of this file.

Macros

#define NO_TEAM_SLOT_LOADED   -1
 

Functions

bool GAME_TeamGetFreeFilename (char *filename, size_t size)
 Searches a free team filename. More...
 
bool GAME_GetTeamFileName (unsigned int index, char *filename, size_t filenameLength)
 Get the filename for the xth team in the file system. More...
 
void GAME_SaveTeam_f (void)
 Stores a team in a specified teamslot. More...
 
void GAME_LoadTeam_f (void)
 Loads the selected teamslot. More...
 
void GAME_TeamSlotComments_f (void)
 Reads the comments from team files. More...
 
void GAME_TeamDelete_f (void)
 Removes a user created team. More...
 
void GAME_SaveTeamState_f (void)
 Will remove those actors that should not be used in the team. More...
 
void GAME_ToggleActorForTeam_f (void)
 This will activate/deactivate the actor for the team. More...
 
void GAME_AutoTeam_f (void)
 
void GAME_AutoTeam (const char *equipmentDefinitionID, int teamMembers)
 
void GAME_UpdateTeamMenuParameters_f (void)
 Displays actor info and equipment and unused items in proper (filter) category. More...
 
void GAME_ActorSelect_f (void)
 
bool GAME_LoadDefaultTeam (bool force)
 
bool GAME_SaveCharacter (xmlNode_t *p, const character_t *chr)
 saves a character to a given xml node More...
 
bool GAME_LoadCharacter (xmlNode_t *p, character_t *chr)
 Loads a character from a given xml node. More...
 

Detailed Description

cgame team management headers.

Definition in file cl_game_team.h.

Macro Definition Documentation

#define NO_TEAM_SLOT_LOADED   -1

Definition at line 30 of file cl_game_team.h.

Referenced by GAME_AutoTeam(), GAME_LoadDefaultTeam(), and GAME_LoadTeam_f().

Function Documentation

void GAME_AutoTeam ( const char *  equipmentDefinitionID,
int  teamMembers 
)
void GAME_AutoTeam_f ( void  )
bool GAME_GetTeamFileName ( unsigned int  index,
char *  filename,
size_t  filenameLength 
)

Get the filename for the xth team in the file system.

Note
We are only dealing with indices to identify a team, thus we have to loop the team list each time we need a filename of a team.
Parameters
[in]indexThe index of the team we are looking for in the filesystem
[out]filenameThe filename of the team. This value is only set or valid if this function returned true.
[in]filenameLengthThe length of the filename buffer.
Returns
true if the filename for the given index was found, false otherwise (e.g. invalid index)

Definition at line 413 of file cl_game_team.cpp.

References Com_DPrintf(), Com_sprintf(), DEBUG_CLIENT, FS_BuildFileList(), FS_NextFileFromFileList(), GAME_GetRelativeSavePath(), and MAX_OSPATH.

Referenced by GAME_LoadDefaultTeam(), and GAME_LoadTeam_f().

bool GAME_LoadCharacter ( xmlNode_t p,
character_t chr 
)

Loads a character from a given xml node.

Parameters
[in]pThe node from which we should load the character.
[in]chrPointer to the character we should load.
Todo:
Fallback compatibility code for older saves

Definition at line 785 of file cl_game_team.cpp.

References chrScoreGlobal_s::assignedMissions, character_s::body, character_s::bodySkin, teamDef_s::bodyTemplate, CHRSH_CharGetBody(), CHRSH_CharGetHead(), CL_GetActorSkinCount(), cls, Com_GetCharacterModel(), Com_GetConstIntFromNamespace(), Com_GetTeamDefinitionByID(), Com_Printf(), Com_RegisterConstList(), Com_UnregisterConstList(), implant_s::def, InventoryInterface::destroyInventory(), chrScoreGlobal_s::experience, character_s::fieldSize, GAME_GetChrMaxLoad(), GAME_LoadInventory(), character_s::gender, character_s::head, character_s::headSkin, character_s::HP, client_static_s::i, BodyData::id(), character_s::implants, chrScoreGlobal_s::initialSkills, implant_s::installedTime, character_s::inv, INVSH_GetImplantByID(), chrScoreGlobal_s::kills, character_s::maxHP, character_s::morale, character_s::name, NONE, BodyData::numBodyParts(), character_s::path, Q_streq, Q_strncpyz(), R_ModelExists(), chrScoreGlobal_s::rank, implant_s::removedTime, SAVE_CHARACTER_BDOY_SKIN, SAVE_CHARACTER_BODY, SAVE_CHARACTER_EXPERIENCE, SAVE_CHARACTER_FIELDSIZE, SAVE_CHARACTER_GENDER, SAVE_CHARACTER_HEAD, SAVE_CHARACTER_HEAD_SKIN, SAVE_CHARACTER_HP, SAVE_CHARACTER_IMPLANT, SAVE_CHARACTER_IMPLANT_IMPLANT, SAVE_CHARACTER_IMPLANT_INSTALLEDTIME, SAVE_CHARACTER_IMPLANT_REMOVETIME, SAVE_CHARACTER_IMPLANTS, SAVE_CHARACTER_INITSKILL, SAVE_CHARACTER_INJURIES, SAVE_CHARACTER_KILLED, SAVE_CHARACTER_KILLS, SAVE_CHARACTER_KILLTYPE, SAVE_CHARACTER_KILLTYPE_NAMESPACE, SAVE_CHARACTER_MAXHP, SAVE_CHARACTER_MORALE, SAVE_CHARACTER_NAME, SAVE_CHARACTER_PATH, SAVE_CHARACTER_SCORE_ASSIGNEDMISSIONS, SAVE_CHARACTER_SCORE_RANK, SAVE_CHARACTER_SCORES, SAVE_CHARACTER_SKILLIMPROVE, SAVE_CHARACTER_SKILLS, SAVE_CHARACTER_SKILLTYPE, SAVE_CHARACTER_SKILLTYPE_NAMESPACE, SAVE_CHARACTER_STATE, SAVE_CHARACTER_STUN, SAVE_CHARACTER_STUNNED, SAVE_CHARACTER_TEAMDEF, SAVE_CHARACTER_UCN, SAVE_CHARACTER_WOUND, SAVE_CHARACTER_WOUNDEDPART, SAVE_CHARACTER_WOUNDSEVERITY, SAVE_CHARACTER_WOUNDTYPE, SAVE_INVENTORY_INVENTORY, saveCharacterConstants, character_s::score, SKILL_NUM_TYPES, chrScoreGlobal_s::skills, character_s::state, character_s::STUN, chrScoreGlobal_s::stuns, character_s::teamDef, woundInfo_s::treatmentLevel, type, character_s::ucn, character_s::wounds, XML_GetInt(), XML_GetNextNode(), XML_GetNode(), XML_GetString(), and xmlNode_t.

Referenced by GAME_GetImportData(), and GAME_LoadTeamInfo().

bool GAME_LoadDefaultTeam ( bool  force)
void GAME_LoadTeam_f ( void  )
bool GAME_SaveCharacter ( xmlNode_t p,
const character_t chr 
)

saves a character to a given xml node

Parameters
[in]pThe node to which we should save the character
[in]chrThe character we should save

Definition at line 694 of file cl_game_team.cpp.

References chrScoreGlobal_s::assignedMissions, character_s::body, character_s::bodySkin, teamDef_s::bodyTemplate, Com_GetConstVariable(), Com_RegisterConstList(), Com_UnregisterConstList(), implant_s::def, chrScoreGlobal_s::experience, character_s::fieldSize, GAME_SaveInventory(), character_s::gender, character_s::head, character_s::headSkin, character_s::HP, i, implantDef_s::id, BodyData::id(), teamDef_s::id, character_s::implants, chrScoreGlobal_s::initialSkills, implant_s::installedTime, character_s::inv, KILLED_NUM_TYPES, chrScoreGlobal_s::kills, lengthof, character_s::maxHP, character_s::morale, character_s::name, BodyData::numBodyParts(), character_s::path, chrScoreGlobal_s::rank, implant_s::removedTime, SAVE_CHARACTER_BDOY_SKIN, SAVE_CHARACTER_BODY, SAVE_CHARACTER_EXPERIENCE, SAVE_CHARACTER_FIELDSIZE, SAVE_CHARACTER_GENDER, SAVE_CHARACTER_HEAD, SAVE_CHARACTER_HEAD_SKIN, SAVE_CHARACTER_HP, SAVE_CHARACTER_IMPLANT, SAVE_CHARACTER_IMPLANT_IMPLANT, SAVE_CHARACTER_IMPLANT_INSTALLEDTIME, SAVE_CHARACTER_IMPLANT_REMOVETIME, SAVE_CHARACTER_IMPLANTS, SAVE_CHARACTER_INITSKILL, SAVE_CHARACTER_INJURIES, SAVE_CHARACTER_KILLED, SAVE_CHARACTER_KILLS, SAVE_CHARACTER_KILLTYPE, SAVE_CHARACTER_KILLTYPE_NAMESPACE, SAVE_CHARACTER_MAXHP, SAVE_CHARACTER_MORALE, SAVE_CHARACTER_NAME, SAVE_CHARACTER_PATH, SAVE_CHARACTER_SCORE_ASSIGNEDMISSIONS, SAVE_CHARACTER_SCORE_RANK, SAVE_CHARACTER_SCORES, SAVE_CHARACTER_SKILLIMPROVE, SAVE_CHARACTER_SKILLS, SAVE_CHARACTER_SKILLTYPE, SAVE_CHARACTER_SKILLTYPE_NAMESPACE, SAVE_CHARACTER_STATE, SAVE_CHARACTER_STUN, SAVE_CHARACTER_STUNNED, SAVE_CHARACTER_TEAMDEF, SAVE_CHARACTER_UCN, SAVE_CHARACTER_WOUND, SAVE_CHARACTER_WOUNDEDPART, SAVE_CHARACTER_WOUNDSEVERITY, SAVE_INVENTORY_INVENTORY, saveCharacterConstants, character_s::score, SKILL_NUM_TYPES, chrScoreGlobal_s::skills, character_s::state, character_s::STUN, chrScoreGlobal_s::stuns, character_s::teamDef, woundInfo_s::treatmentLevel, character_s::ucn, character_s::wounds, XML_AddInt(), XML_AddIntValue(), XML_AddNode(), XML_AddString(), and xmlNode_t.

Referenced by GAME_GetImportData(), and GAME_SaveTeamInfo().

void GAME_SaveTeam_f ( void  )

Stores a team in a specified teamslot.

Definition at line 296 of file cl_game_team.cpp.

References _, chrDisplayList, Cmd_Argc(), Cmd_Argv(), Com_Printf(), GAME_SaveTeam(), GAME_TeamGetFreeFilename(), LIST_IsEmpty(), MAX_OSPATH, name, Q_strnull(), and UI_Popup().

Referenced by GAME_InitStartup().

void GAME_SaveTeamState_f ( void  )

Will remove those actors that should not be used in the team.

See also
GAME_ToggleActorForTeam_f

Definition at line 112 of file cl_game_team.cpp.

References characterActive, chrDisplayList, i, LIST_Foreach, and LIST_Remove().

Referenced by GAME_InitStartup().

void GAME_TeamDelete_f ( void  )

Removes a user created team.

Definition at line 124 of file cl_game_team.cpp.

References Cmd_Argc(), Cmd_Argv(), Com_Printf(), FS_RemoveFile(), GAME_GetAbsoluteSavePath(), MAX_OSPATH, and Q_strcat().

Referenced by GAME_InitStartup().

bool GAME_TeamGetFreeFilename ( char *  filename,
size_t  size 
)

Searches a free team filename.

Parameters
[out]filenameThe team filename that can be used.
[in]sizeThe size of the filename buffer.
Returns
true if a valid team name was found, false otherwise. In the latter case, don't use anything from the filename buffer

Definition at line 279 of file cl_game_team.cpp.

References Com_sprintf(), FS_CheckFile(), GAME_GetRelativeSavePath(), and MAX_OSPATH.

Referenced by GAME_SaveTeam_f().

void GAME_ToggleActorForTeam_f ( void  )

This will activate/deactivate the actor for the team.

See also
GAME_SaveTeamState_f

Definition at line 83 of file cl_game_team.cpp.

References characterActive, chrDisplayList, Cmd_Argc(), Cmd_Argv(), Com_Printf(), i, and LIST_Foreach.

Referenced by GAME_InitStartup().

void GAME_UpdateTeamMenuParameters_f ( void  )

Displays actor info and equipment and unused items in proper (filter) category.

Note
This function is called every time the team equipment screen for the team pops up.

Definition at line 514 of file cl_game_team.cpp.

References characterActive, chrDisplayList, Cvar_Set(), GAME_GetEquipment(), i, LIST_Foreach, TEXT_STANDARD, UI_ExecuteConfunc(), and UI_ResetData().

Referenced by GAME_InitStartup().