UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_cgame_callbacks.h File Reference
#include "../cl_game.h"
Include dependency graph for cp_cgame_callbacks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const char * GAME_CP_GetItemModel (const char *string)
void GAME_CP_InitStartup (void)
void GAME_CP_Shutdown (void)
bool GAME_CP_Spawn (linkedList_t **chrList)
void GAME_CP_Results (dbuffer *msg, int winner, int *numSpawned, int *numAlive, int numKilled[][MAX_TEAMS], int numStunned[][MAX_TEAMS], bool nextmap)
 After a mission was finished this function is called.
bool GAME_CP_ItemIsUseable (const objDef_t *od)
equipDef_tGAME_CP_GetEquipmentDefinition (void)
void GAME_CP_CharacterCvars (const character_t *chr)
bool GAME_CP_TeamIsKnown (const teamDef_t *teamDef)
 Checks whether the team is known at this stage already.
character_tGAME_CP_GetSelectedChr (void)
 Returns the currently selected character.
void GAME_CP_Drop (void)
void GAME_CP_InitializeBattlescape (dbuffer *msg, const linkedList_t *team)
 Changes some actor states for a campaign game.
void GAME_CP_InitMissionBriefing (const char **title, linkedList_t **victoryConditionsMsgIDs, linkedList_t **missionBriefingMsgIDs)
void GAME_CP_Frame (float secondsSinceLastFrame)
const char * GAME_CP_GetTeamDef (void)
void GAME_CP_HandleBaseClick (int baseIdx, int key, int col, int row)
void GAME_CP_DrawBase (int baseIdx, int x, int y, int w, int h, int col, int row, bool hover, int overlap)
void GAME_CP_DrawBaseTooltip (int baseIdx, int x, int y, int col, int row)
void GAME_CP_DrawBaseLayout (int baseIdx, int x, int y, int totalMarge, int w, int h, int padding, const vec4_t bgcolor, const vec4_t color)
void GAME_CP_DrawBaseLayoutTooltip (int baseIdx, int x, int y)
 Draws basename as tooltip for baselayout widget.

Variables

const cgame_import_tcgi

Function Documentation

◆ GAME_CP_CharacterCvars()

◆ GAME_CP_DrawBase()

void GAME_CP_DrawBase ( int baseIdx,
int x,
int y,
int w,
int h,
int col,
int row,
bool hover,
int overlap )

◆ GAME_CP_DrawBaseLayout()

void GAME_CP_DrawBaseLayout ( int baseIdx,
int x,
int y,
int totalMarge,
int w,
int h,
int padding,
const vec4_t bgcolor,
const vec4_t color )

Definition at line 406 of file cp_cgame_callbacks.cpp.

References B_GetBaseByIDX(), B_GetBuildingAt, B_IsTileBlocked, BASE_SIZE, cgi, and base_t::founded.

Referenced by GetCGameAPI().

◆ GAME_CP_DrawBaseLayoutTooltip()

void GAME_CP_DrawBaseLayoutTooltip ( int baseIdx,
int x,
int y )

Draws basename as tooltip for baselayout widget.

Parameters
[in]baseIdxNumeric index of the base to show
[in]xHorizontal screen cordinate
[in]yVertical screen cordinate

Definition at line 398 of file cp_cgame_callbacks.cpp.

References B_GetFoundedBaseByIDX(), cgi, and base_t::name.

Referenced by GetCGameAPI().

◆ GAME_CP_DrawBaseTooltip()

void GAME_CP_DrawBaseTooltip ( int baseIdx,
int x,
int y,
int col,
int row )

◆ GAME_CP_Drop()

void GAME_CP_Drop ( void )
Todo
maybe create a savegame?

Definition at line 371 of file cp_cgame_callbacks.cpp.

References cgi.

Referenced by GetCGameAPI().

◆ GAME_CP_Frame()

void GAME_CP_Frame ( float secondsSinceLastFrame)

Definition at line 380 of file cp_cgame_callbacks.cpp.

References ccs, CP_CampaignRun(), CP_IsRunning(), and CP_OnGeoscape().

Referenced by GetCGameAPI().

◆ GAME_CP_GetEquipmentDefinition()

equipDef_t * GAME_CP_GetEquipmentDefinition ( void )

Definition at line 474 of file cp_cgame_callbacks.cpp.

References ccs.

Referenced by GetCGameAPI().

◆ GAME_CP_GetItemModel()

const char * GAME_CP_GetItemModel ( const char * string)

◆ GAME_CP_GetSelectedChr()

character_t * GAME_CP_GetSelectedChr ( void )

Returns the currently selected character.

Returns
The selected character or nullptr.

Definition at line 363 of file cp_cgame_callbacks.cpp.

References cgi, Employee::chr, and E_GetEmployeeFromChrUCN().

Referenced by GetCGameAPI().

◆ GAME_CP_GetTeamDef()

const char * GAME_CP_GetTeamDef ( void )

Definition at line 428 of file cp_cgame_callbacks.cpp.

References ccs, cgi, and V_TEAM.

Referenced by E_CreateEmployee(), and GetCGameAPI().

◆ GAME_CP_HandleBaseClick()

void GAME_CP_HandleBaseClick ( int baseIdx,
int key,
int col,
int row )

References key.

◆ GAME_CP_InitializeBattlescape()

void GAME_CP_InitializeBattlescape ( dbuffer * msg,
const linkedList_t * team )

Changes some actor states for a campaign game.

Parameters
teamThe team to change the states for
msgThe message buffer to write the states to

Definition at line 458 of file cp_cgame_callbacks.cpp.

References cgi, clc_initactorstates, LIST_Foreach, and NONE.

Referenced by GetCGameAPI().

◆ GAME_CP_InitMissionBriefing()

void GAME_CP_InitMissionBriefing ( const char ** title,
linkedList_t ** victoryConditionsMsgIDs,
linkedList_t ** missionBriefingMsgIDs )

◆ GAME_CP_InitStartup()

◆ GAME_CP_ItemIsUseable()

bool GAME_CP_ItemIsUseable ( const objDef_t * od)

Definition at line 337 of file cp_cgame_callbacks.cpp.

References RS_GetTechForItem(), and RS_IsResearched_ptr().

Referenced by GetCGameAPI().

◆ GAME_CP_Results()

void GAME_CP_Results ( dbuffer * msg,
int winner,
int * numSpawned,
int * numAlive,
int numKilled[][MAX_TEAMS],
int numStunned[][MAX_TEAMS],
bool nextmap )

After a mission was finished this function is called.

Parameters
msgThe network message buffer
winnerThe winning team
numSpawnedThe amounts of all spawned actors per team
numAliveThe amount of survivors per team
numKilledThe amount of killed actors for all teams. The first dimension contains the attacker team, the second the victim team
numStunnedThe amount of stunned actors for all teams. The first dimension contains
nextmapIf it was a follow-up map of the same mission the attacker team, the second the victim team

Definition at line 201 of file cp_cgame_callbacks.cpp.

References AII_CollectingItems(), AL_AddAlienTypeToAircraftCargo_(), missionResults_t::aliensKilled, missionResults_t::aliensStunned, missionResults_t::aliensSurvived, ccs, cgi, CHAR_ParseData(), missionResults_t::civiliansKilled, missionResults_t::civiliansKilledFriendlyFire, missionResults_t::civiliansSurvived, DRAW, GEO_GetMissionAircraft, i, LOST, MAX_TEAMS, MIS_InitResultScreen(), battleParam_t::mission, missionResults_t::mission, missionResults_t::ownKilled, missionResults_t::ownKilledFriendlyFire, missionResults_t::ownStunned, missionResults_t::ownSurvived, battleParam_t::retriable, missionResults_t::state, TEAM_CIVILIAN, and WON.

Referenced by GetCGameAPI().

◆ GAME_CP_Shutdown()

void GAME_CP_Shutdown ( void )

◆ GAME_CP_Spawn()

bool GAME_CP_Spawn ( linkedList_t ** chrList)

◆ GAME_CP_TeamIsKnown()

bool GAME_CP_TeamIsKnown ( const teamDef_t * teamDef)

Checks whether the team is known at this stage already.

Parameters
[in]teamDefThe team definition of the alien team
Returns
true if known, false otherwise.

Definition at line 348 of file cp_cgame_callbacks.cpp.

References ccs, cgi, CHRSH_IsTeamDefAlien(), ERR_DROP, teamDef_t::id, teamDef_t::idx, and RS_IsResearched_ptr().

Referenced by GetCGameAPI().

Variable Documentation

◆ cgi

const cgame_import_t* cgi
extern

Definition at line 39 of file cp_cgame_callbacks.cpp.