Menu related callback functions used alien containment. More...
#include "../cl_shared.h"
#include "../ui/ui_main.h"
#include "cp_campaign.h"
#include "cp_aliencont.h"
#include "cp_aliencont_callbacks.h"
Go to the source code of this file.
Defines | |
#define | MAX_AC_MENU_ENTRIES 12 |
Maximal entries in aliencont menu. | |
Functions | |
static int | AL_CountForMenu (int alienidx, qboolean alive) |
Counts killed or captured aliens of given type in all bases. | |
static void | AC_OpenUFOpedia_f (void) |
Call UFOpedia for selected alien. | |
static void | AC_ResearchAlien_f (void) |
Open research menu. | |
static void | AC_AlienClick (const base_t *base, int num) |
updates menu related cvars for given base and alien num | |
static void | AC_AlienClick_f (void) |
Click function for aliencont menu list. | |
static void | AC_UpdateMenu (const base_t *base) |
Updates the alienscont menu. | |
static void | AC_Init_f (void) |
Alien containment menu init function. | |
static void | AC_KillAll_f (void) |
Kill all aliens in current base. | |
static void | AC_KillOne_f (void) |
Kill single alien of a given type. | |
void | AC_InitCallbacks (void) |
void | AC_ShutdownCallbacks (void) |
Variables | |
static const aliensCont_t * | aliencontCurrent |
static int | numAliensOnList = 0 |
Menu related callback functions used alien containment.
Header file for menu callback functions used for alien containment menu.
Definition in file cp_aliencont_callbacks.c.
#define MAX_AC_MENU_ENTRIES 12 |
Maximal entries in aliencont menu.
Definition at line 36 of file cp_aliencont_callbacks.c.
Referenced by AC_InitCallbacks(), and AC_UpdateMenu().
static void AC_AlienClick | ( | const base_t * | base, | |
int | num | |||
) | [static] |
updates menu related cvars for given base and alien num
base | ||
num |
Definition at line 120 of file cp_aliencont_callbacks.c.
References _, AL_CountForMenu(), base_s::alienscont, aliensCont_s::amountAlive, aliensCont_s::amountDead, B_ALIEN_CONTAINMENT, B_GetBuildingStatus(), ccs, Com_DPrintf(), Cvar_Set(), DEBUG_CLIENT, i, teamDef_s::idx, technology_s::image, teamDef_s::name, numAliensOnList, ccs_s::numAliensTD, qfalse, qtrue, aliensCont_s::teamDef, aliensCont_s::tech, and va().
Referenced by AC_AlienClick_f(), and AC_UpdateMenu().
static void AC_AlienClick_f | ( | void | ) | [static] |
Click function for aliencont menu list.
Definition at line 155 of file cp_aliencont_callbacks.c.
References AC_AlienClick(), B_GetCurrentSelectedBase(), Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), and DEBUG_CLIENT.
Referenced by AC_InitCallbacks().
static void AC_Init_f | ( | void | ) | [static] |
Alien containment menu init function.
Definition at line 247 of file cp_aliencont_callbacks.c.
References AC_UpdateMenu(), B_GetCurrentSelectedBase(), Com_Printf(), and numAliensOnList.
Referenced by AC_InitCallbacks().
void AC_InitCallbacks | ( | void | ) |
Definition at line 321 of file cp_aliencont_callbacks.c.
References AC_AlienClick_f(), AC_Init_f(), AC_KillAll_f(), AC_KillOne_f(), AC_OpenUFOpedia_f(), AC_ResearchAlien_f(), ccs, Cmd_AddCommand(), Com_Printf(), MAX_AC_MENU_ENTRIES, and ccs_s::numAliensTD.
Referenced by AC_InitStartup().
static void AC_KillAll_f | ( | void | ) | [static] |
Kill all aliens in current base.
Definition at line 266 of file cp_aliencont_callbacks.c.
References AC_KillAll(), AC_UpdateMenu(), and B_GetCurrentSelectedBase().
Referenced by AC_InitCallbacks().
static void AC_KillOne_f | ( | void | ) | [static] |
Kill single alien of a given type.
Definition at line 282 of file cp_aliencont_callbacks.c.
References AC_UpdateMenu(), AL_KILLONE, AL_RemoveAliens(), base_s::alienscont, B_ALIEN_CONTAINMENT, B_GetBuildingStatus(), B_GetCurrentSelectedBase(), ccs, Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), DEBUG_CLIENT, i, numAliensOnList, and ccs_s::numAliensTD.
Referenced by AC_InitCallbacks().
static void AC_OpenUFOpedia_f | ( | void | ) | [static] |
Call UFOpedia for selected alien.
Definition at line 75 of file cp_aliencont_callbacks.c.
References Com_Printf(), technology_s::id, RS_IsResearched_ptr(), aliensCont_s::tech, and UP_OpenWith().
Referenced by AC_InitCallbacks().
static void AC_ResearchAlien_f | ( | void | ) | [static] |
Open research menu.
Definition at line 99 of file cp_aliencont_callbacks.c.
References Com_Error(), ERR_DROP, RS_IsResearched_ptr(), aliensCont_s::tech, and UI_PushWindow().
Referenced by AC_InitCallbacks().
void AC_ShutdownCallbacks | ( | void | ) |
Definition at line 337 of file cp_aliencont_callbacks.c.
References Cmd_RemoveCommand().
static void AC_UpdateMenu | ( | const base_t * | base | ) | [static] |
Updates the alienscont menu.
Definition at line 175 of file cp_aliencont_callbacks.c.
References _, AC_AlienClick(), base_s::alienscont, B_ALIEN_CONTAINMENT, B_GetBuildingStatus(), CAP_ALIENS, base_s::capacities, ccs, Com_Printf(), cap_maxcur_s::cur, Cvar_Set(), Cvar_SetValue(), i, cap_maxcur_s::max, MAX_AC_MENU_ENTRIES, numAliensOnList, ccs_s::numAliensTD, technology_s::overallTime, RS_IsResearched_ptr(), aliensCont_s::tech, technology_s::time, UI_ExecuteConfunc(), and va().
Referenced by AC_Init_f(), AC_KillAll_f(), and AC_KillOne_f().
static int AL_CountForMenu | ( | int | alienidx, | |
qboolean | alive | |||
) | [static] |
Counts killed or captured aliens of given type in all bases.
[in] | alienidx | |
[in] | alive | boolean whether the alien is alive or already dead |
Definition at line 48 of file cp_aliencont_callbacks.c.
References base_s::alienscont, aliensCont_s::amountAlive, aliensCont_s::amountDead, B_ALIEN_CONTAINMENT, B_GetBuildingStatus(), B_GetFoundedBaseByIDX(), i, MAX_ALIENCONT_CAP, MAX_BASES, and aliensCont_s::teamDef.
Referenced by AC_AlienClick().
const aliensCont_t* aliencontCurrent [static] |
Statics for menu. Current selected Alien Containment.
Definition at line 39 of file cp_aliencont_callbacks.c.
int numAliensOnList = 0 [static] |
Number of aliens on AC menu list.
Definition at line 40 of file cp_aliencont_callbacks.c.
Referenced by AC_AlienClick(), AC_Init_f(), AC_KillOne_f(), and AC_UpdateMenu().