UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_cgame_callbacks.h File Reference
#include "../cl_game.h"

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. More...
 
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. More...
 
character_tGAME_CP_GetSelectedChr (void)
 Returns the currently selected character. More...
 
void GAME_CP_Drop (void)
 
void GAME_CP_InitializeBattlescape (dbuffer *msg, const linkedList_t *team)
 Changes some actor states for a campaign game. More...
 
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. More...
 

Variables

const cgame_import_tcgi
 

Function Documentation

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_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, and base_s::founded.

Referenced by GetCGameAPI().

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(), and base_s::name.

Referenced by GetCGameAPI().

void GAME_CP_DrawBaseTooltip ( int  baseIdx,
int  x,
int  y,
int  col,
int  row 
)
void GAME_CP_Drop ( void  )
Todo:
maybe create a savegame?

Definition at line 371 of file cp_cgame_callbacks.cpp.

Referenced by GetCGameAPI().

void GAME_CP_Frame ( float  secondsSinceLastFrame)

Definition at line 380 of file cp_cgame_callbacks.cpp.

References ccs, CP_CampaignRun(), CP_IsRunning(), CP_OnGeoscape(), and ccs_s::curCampaign.

Referenced by GetCGameAPI().

equipDef_t* GAME_CP_GetEquipmentDefinition ( void  )

Definition at line 474 of file cp_cgame_callbacks.cpp.

References ccs, and ccs_s::eMission.

Referenced by GetCGameAPI().

const char* GAME_CP_GetItemModel ( const char *  string)
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 Employee::chr, and E_GetEmployeeFromChrUCN().

Referenced by GetCGameAPI().

const char* GAME_CP_GetTeamDef ( void  )
void GAME_CP_HandleBaseClick ( int  baseIdx,
int  key,
int  col,
int  row 
)
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 clc_initactorstates, LIST_Foreach, and NONE.

Referenced by GetCGameAPI().

void GAME_CP_InitMissionBriefing ( const char **  title,
linkedList_t **  victoryConditionsMsgIDs,
linkedList_t **  missionBriefingMsgIDs 
)
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().

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_s::aliensKilled, ccs_s::aliensKilled, missionResults_s::aliensStunned, missionResults_s::aliensSurvived, ccs_s::battleParameters, ccs, CHAR_ParseData(), missionResults_s::civiliansKilled, missionResults_s::civiliansKilledFriendlyFire, missionResults_s::civiliansSurvived, DRAW, GEO_GetMissionAircraft, i, LOST, MAX_TEAMS, MIS_InitResultScreen(), missionResults_s::mission, battleParam_s::mission, ccs_s::missionResultCallback, mission_s::missionResults, missionResults_s::ownKilled, missionResults_s::ownKilledFriendlyFire, missionResults_s::ownStunned, missionResults_s::ownSurvived, battleParam_s::retriable, missionResults_s::state, TEAM_CIVILIAN, ccs_s::updateCharacters, and WON.

Referenced by GetCGameAPI().

void GAME_CP_Shutdown ( void  )

Definition at line 541 of file cp_cgame_callbacks.cpp.

References CP_ResetCampaignData(), CP_Shutdown(), and SAV_ShutdownCallbacks().

Referenced by GetCGameAPI().

bool GAME_CP_Spawn ( linkedList_t **  chrList)
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, CHRSH_IsTeamDefAlien(), ERR_DROP, teamDef_s::id, teamDef_s::idx, RS_IsResearched_ptr(), and ccs_s::teamDefTechs.

Referenced by GetCGameAPI().

Variable Documentation

const cgame_import_t* cgi

Definition at line 39 of file cp_cgame_callbacks.cpp.