cp_aliencont_callbacks.c File Reference

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"
Include dependency graph for cp_aliencont_callbacks.c:

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_taliencontCurrent
static int numAliensOnList = 0

Detailed Description

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 Documentation

#define MAX_AC_MENU_ENTRIES   12

Maximal entries in aliencont menu.

See also:
MAX_TEAMDEFS

Definition at line 36 of file cp_aliencont_callbacks.c.

Referenced by AC_InitCallbacks(), and AC_UpdateMenu().


Function Documentation

static void AC_AlienClick ( const base_t base,
int  num 
) [static]
static void AC_AlienClick_f ( void   )  [static]

Click function for aliencont menu list.

See also:
AC_InitStartup

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.

Note:
Command to call this: aliencont_init
Should be called whenever the alien containment menu gets active.

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   ) 
static void AC_KillAll_f ( void   )  [static]

Kill all aliens in current base.

See also:
AC_KillAll

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]
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]
static int AL_CountForMenu ( int  alienidx,
qboolean  alive 
) [static]

Counts killed or captured aliens of given type in all bases.

Parameters:
[in] alienidx 
[in] alive boolean whether the alien is alive or already dead
Returns:
amount of killed aliens of given type

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().


Variable Documentation

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().


Generated by  doxygen 1.6.2