Multiplayer team management. More...
#include "../cl_shared.h"
#include "../cl_game.h"
#include "../cl_inventory.h"
#include "../cl_team.h"
#include "../ui/ui_main.h"
#include "../ui/ui_popup.h"
#include "../ui/node/ui_node_container.h"
#include "mp_team.h"
#include "save_multiplayer.h"
Go to the source code of this file.
Data Structures | |
struct | mpSaveFileHeader_s |
Defines | |
#define | MPTEAM_SAVE_FILE_VERSION 4 |
Typedefs | |
typedef struct mpSaveFileHeader_s | mpSaveFileHeader_t |
Functions | |
static void | MP_UpdateActiveTeamList (void) |
void | MP_AutoTeam_f (void) |
void | MP_ToggleActorForTeam_f (void) |
This will activate/deactivate the actor for the team. | |
void | MP_SaveTeamState_f (void) |
Will remove those actors that should not be used in the team. | |
void | MP_MultiplayerTeamSlotComments_f (void) |
Reads tha comments from team files. | |
static void | MP_SaveTeamMultiplayerInfo (mxml_node_t *p) |
Stores the wholeTeam into a xml structure. | |
static void | MP_LoadTeamMultiplayerInfo (mxml_node_t *p) |
Loads the wholeTeam from the xml file. | |
static qboolean | MP_SaveTeamMultiplayer (const char *filename, const char *name) |
Saves a multiplayer team in xml format. | |
void | MP_SaveTeamMultiplayer_f (void) |
Stores a team in a specified teamslot (multiplayer). | |
static qboolean | MP_LoadTeamMultiplayer (const char *filename) |
Load a multiplayer team from an xml file. | |
qboolean | MP_LoadDefaultTeamMultiplayer (void) |
void | MP_LoadTeamMultiplayer_f (void) |
Loads the selected teamslot. | |
static void | MP_GetEquipment (void) |
Get the equipment definition (from script files) for the current selected multiplayer team and updates the equipment inventory containers. | |
void | MP_UpdateMenuParameters_f (void) |
Displays actor info and equipment and unused items in proper (filter) category. | |
void | MP_TeamSelect_f (void) |
Variables | |
static inventory_t | mp_inventory |
static qboolean | characterActive [MAX_ACTIVETEAM] |
Multiplayer team management.
Definition in file mp_team.c.
#define MPTEAM_SAVE_FILE_VERSION 4 |
< ui_inventory
Definition at line 36 of file mp_team.c.
Referenced by MP_LoadTeamMultiplayer(), MP_MultiplayerTeamSlotComments_f(), and MP_SaveTeamMultiplayer().
typedef struct mpSaveFileHeader_s mpSaveFileHeader_t |
void MP_AutoTeam_f | ( | void | ) |
Definition at line 60 of file mp_team.c.
References GAME_MP_AutoTeam(), and MP_UpdateActiveTeamList().
Referenced by MP_CallbacksInit().
static void MP_GetEquipment | ( | void | ) | [static] |
Get the equipment definition (from script files) for the current selected multiplayer team and updates the equipment inventory containers.
Definition at line 402 of file mp_team.c.
References chr_list_s::chr, chrDisplayList, cl_team, Com_sprintf(), Com_ValueToStr(), GAME_GetEquipmentDefinition(), character_s::i, cvar_s::integer, INV_GetEquipmentDefinitionByID(), MAX_VAR, chr_list_s::num, UI_ContainerNodeUpdateEquipment(), ui_inventory, and V_TEAM.
Referenced by MP_UpdateMenuParameters_f().
qboolean MP_LoadDefaultTeamMultiplayer | ( | void | ) |
Definition at line 373 of file mp_team.c.
References MP_LoadTeamMultiplayer().
Referenced by CL_Connect_f().
static qboolean MP_LoadTeamMultiplayer | ( | const char * | filename | ) | [static] |
Load a multiplayer team from an xml file.
Definition at line 283 of file mp_team.c.
References byte, cl_genericPool, Com_Printf(), Cvar_Set(), qFILE_s::f, f, FILE_READ, FS_CloseFile(), FS_FileLength(), FS_OpenFile(), FS_Read(), GAME_GetEquipmentDefinition(), header, objDef_s::idx, INVSH_GetItemByID(), len, LittleLong(), Mem_Free, Mem_PoolAlloc, MP_LoadTeamMultiplayerInfo(), MPTEAM_SAVE_FILE_VERSION, mxml_GetInt(), mxml_GetNextNode(), mxml_GetNode(), mxml_GetString(), mxml_ufo_type_cb(), mxmlDelete(), mxmlLoadString(), mpSaveFileHeader_s::name, equipDef_s::numItems, equipDef_s::numItemsLoose, qfalse, qtrue, SAVE_MULTIPLAYER_EQUIPMENT, SAVE_MULTIPLAYER_ID, SAVE_MULTIPLAYER_ITEM, SAVE_MULTIPLAYER_NUM, SAVE_MULTIPLAYER_NUMLOOSE, SAVE_MULTIPLAYER_ROOTNODE, SAVE_MULTIPLAYER_TEAM, mpSaveFileHeader_s::version, mpSaveFileHeader_s::xmlSize, and qFILE_s::z.
Referenced by MP_LoadDefaultTeamMultiplayer(), and MP_LoadTeamMultiplayer_f().
void MP_LoadTeamMultiplayer_f | ( | void | ) |
Loads the selected teamslot.
Definition at line 381 of file mp_team.c.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Com_sprintf(), MAX_OSPATH, and MP_LoadTeamMultiplayer().
Referenced by MP_CallbacksInit().
static void MP_LoadTeamMultiplayerInfo | ( | mxml_node_t * | p | ) | [static] |
Loads the wholeTeam from the xml file.
Definition at line 164 of file mp_team.c.
References characterActive, chr_list_s::chr, chrDisplayList, CL_LoadCharacterXML(), Com_DPrintf(), DEBUG_CLIENT, GAME_GetCharacter(), GAME_GetCharacterArraySize(), GAME_ResetCharacters(), i, lengthof, MP_UpdateActiveTeamList(), mxml_GetNextNode(), mxml_GetNode(), chr_list_s::num, and SAVE_MULTIPLAYER_CHARACTER.
Referenced by MP_LoadTeamMultiplayer().
void MP_MultiplayerTeamSlotComments_f | ( | void | ) |
Reads tha comments from team files.
Definition at line 111 of file mp_team.c.
References Com_Printf(), Cvar_Set(), qFILE_s::f, f, FILE_READ, FS_CloseFile(), FS_OpenFile(), FS_Read(), header, i, LittleLong(), MPTEAM_SAVE_FILE_VERSION, mpSaveFileHeader_s::name, mpSaveFileHeader_s::soldiercount, UI_ExecuteConfunc(), va(), mpSaveFileHeader_s::version, and qFILE_s::z.
Referenced by MP_CallbacksInit().
static qboolean MP_SaveTeamMultiplayer | ( | const char * | filename, | |
const char * | name | |||
) | [static] |
Saves a multiplayer team in xml format.
Definition at line 192 of file mp_team.c.
References byte, chrDisplayList, cl_genericPool, Com_Printf(), csi, FS_WriteFile(), GAME_GetEquipmentDefinition(), header, i, objDef_s::id, objDef_s::idx, INVSH_GetItemByIDX(), LittleLong(), Mem_Free, Mem_PoolAlloc, MP_SaveTeamMultiplayerInfo(), MPTEAM_SAVE_FILE_VERSION, mxml_AddIntValue(), mxml_AddNode(), mxml_AddString(), MXML_NO_CALLBACK, mxmlDelete(), mxmlNewXML(), mxmlSaveString(), mpSaveFileHeader_s::name, chr_list_s::num, equipDef_s::numItems, equipDef_s::numItemsLoose, csi_s::numODs, Q_strncpyz(), qfalse, qtrue, SAVE_MULTIPLAYER_EQUIPMENT, SAVE_MULTIPLAYER_ID, SAVE_MULTIPLAYER_ITEM, SAVE_MULTIPLAYER_NUM, SAVE_MULTIPLAYER_NUMLOOSE, SAVE_MULTIPLAYER_ROOTNODE, SAVE_MULTIPLAYER_TEAM, mpSaveFileHeader_s::soldiercount, mpSaveFileHeader_s::version, and mpSaveFileHeader_s::xmlSize.
Referenced by MP_SaveTeamMultiplayer_f().
void MP_SaveTeamMultiplayer_f | ( | void | ) |
Stores a team in a specified teamslot (multiplayer).
Definition at line 250 of file mp_team.c.
References _, chrDisplayList, Cmd_Argc(), Cmd_Argv(), Com_Printf(), Com_sprintf(), Cvar_GetString(), MAX_OSPATH, MP_SaveTeamMultiplayer(), name, chr_list_s::num, UI_Popup(), and va().
Referenced by MP_CallbacksInit().
static void MP_SaveTeamMultiplayerInfo | ( | mxml_node_t * | p | ) | [static] |
Stores the wholeTeam into a xml structure.
Definition at line 146 of file mp_team.c.
References chr_list_s::chr, chrDisplayList, CL_SaveCharacterXML(), Com_DPrintf(), DEBUG_CLIENT, i, mxml_AddNode(), chr_list_s::num, and SAVE_MULTIPLAYER_CHARACTER.
Referenced by MP_SaveTeamMultiplayer().
void MP_SaveTeamState_f | ( | void | ) |
Will remove those actors that should not be used in the team.
Definition at line 93 of file mp_team.c.
References characterActive, chr_list_s::chr, chrDisplayList, i, chr_list_s::num, and character_s::ucn.
Referenced by MP_CallbacksInit().
void MP_TeamSelect_f | ( | void | ) |
Definition at line 455 of file mp_team.c.
References chrDisplayList, cl_selected, Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), Com_Printf(), cvar_s::integer, chr_list_s::num, UI_ExecuteConfunc(), and va().
Referenced by MP_CallbacksInit().
void MP_ToggleActorForTeam_f | ( | void | ) |
This will activate/deactivate the actor for the team.
Definition at line 71 of file mp_team.c.
References characterActive, chrDisplayList, Cmd_Argc(), Cmd_Argv(), Com_Printf(), and chr_list_s::num.
Referenced by MP_CallbacksInit().
static void MP_UpdateActiveTeamList | ( | void | ) | [static] |
Definition at line 49 of file mp_team.c.
References characterActive, chrDisplayList, i, chr_list_s::num, qtrue, and UI_ExecuteConfunc().
Referenced by MP_AutoTeam_f(), and MP_LoadTeamMultiplayerInfo().
void MP_UpdateMenuParameters_f | ( | void | ) |
Displays actor info and equipment and unused items in proper (filter) category.
Definition at line 433 of file mp_team.c.
References chr_list_s::chr, chrDisplayList, Cvar_Set(), i, lengthof, MP_GetEquipment(), character_s::name, name, chr_list_s::num, TEXT_STANDARD, UI_ResetData(), and va().
Referenced by MP_CallbacksInit().
qboolean characterActive[MAX_ACTIVETEAM] [static] |
Definition at line 40 of file mp_team.c.
Referenced by MP_LoadTeamMultiplayerInfo(), MP_SaveTeamState_f(), MP_ToggleActorForTeam_f(), and MP_UpdateActiveTeamList().
inventory_t mp_inventory [static] |