cp_basedefence_callbacks.c File Reference

Header file for menu callback functions used for basedefence menu. More...

#include "../cl_shared.h"
#include "../ui/ui_data.h"
#include "../ui/ui_main.h"
#include "cp_campaign.h"
#include "cp_basedefence_callbacks.h"
#include "cp_fightequip_callbacks.h"
#include "cp_mapfightequip.h"
#include "cp_ufo.h"
Include dependency graph for cp_basedefence_callbacks.c:

Go to the source code of this file.

Functions

static aircraftItemType_t BDEF_GetItemTypeFromID (const char *type)
 returns the itemtype index from a string identifier
static const char * BDEF_GetIDFromItemType (aircraftItemType_t type)
 returns the string identifier from an itemtype index
static void BDEF_UpdateAircraftItemList (const aircraftSlot_t *slot)
 Update the list of item you can choose.
static void BDEF_SelectItem_f (void)
 Show item description in bdef menu.
static void BDEF_AddSlotToSlotList (const aircraftSlot_t *slot, linkedList_t **slotList)
static void BDEF_FillSlotList (const baseWeapon_t *batteries, int maxBatteries, linkedList_t **slotList)
static void BDEF_BaseDefenceMenuUpdate_f (void)
 Fills the battery list, descriptions, and weapons in slots of the basedefence equip menu.
static void BDEF_AddItem_f (void)
 add item to a base defence slot (installation too)
static void BDEF_RemoveItem_f (void)
 add item to a base defence slot (installation too)
static void BDEF_RemoveBattery_f (void)
 Remove a defence system from base.
static void BDEF_AddBattery_f (void)
 Adds a defence system to base.
static void BDEF_ChangeAutoFire (void)
 Menu callback for changing autofire state Command: basedef_autofire <0|1>.
void BDEF_InitCallbacks (void)
void BDEF_ShutdownCallbacks (void)

Detailed Description

Header file for menu callback functions used for basedefence menu.

Definition in file cp_basedefence_callbacks.c.


Function Documentation

static void BDEF_AddBattery_f ( void   )  [static]
static void BDEF_AddItem_f ( void   )  [static]
static void BDEF_AddSlotToSlotList ( const aircraftSlot_t slot,
linkedList_t **  slotList 
) [static]
static void BDEF_BaseDefenceMenuUpdate_f ( void   )  [static]
static void BDEF_ChangeAutoFire ( void   )  [static]
static void BDEF_FillSlotList ( const baseWeapon_t batteries,
int  maxBatteries,
linkedList_t **  slotList 
) [static]
static const char* BDEF_GetIDFromItemType ( aircraftItemType_t  type  )  [static]

returns the string identifier from an itemtype index

Parameters:
[in] type Defence type

Definition at line 53 of file cp_basedefence_callbacks.c.

References AC_ITEM_BASE_LASER, and AC_ITEM_BASE_MISSILE.

Referenced by BDEF_AddItem_f(), and BDEF_RemoveItem_f().

static aircraftItemType_t BDEF_GetItemTypeFromID ( const char *  type  )  [static]

returns the itemtype index from a string identifier

Parameters:
[in] type Defence type identifier string

Definition at line 38 of file cp_basedefence_callbacks.c.

References AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, and MAX_ACITEMS.

Referenced by BDEF_AddItem_f(), BDEF_RemoveItem_f(), and BDEF_SelectItem_f().

void BDEF_InitCallbacks ( void   ) 
static void BDEF_RemoveBattery_f ( void   )  [static]

Remove a defence system from base.

Note:
1st argument is the basedefence system type to destroy (sa basedefenceType_t).
2nd argument is the idx of the base in which you want the battery to be destroyed.
if the first argument is BASEDEF_RANDOM, the type of the battery to destroy is randomly selected
the building must already be removed from ccs.buildings[baseIdx][]

Definition at line 456 of file cp_basedefence_callbacks.c.

References B_DEFENCE_LASER, B_DEFENCE_MISSILE, B_GetFoundedBaseByIDX(), B_GetNextBuildingByType(), B_STATUS_WORKING, BASEDEF_LASER, BASEDEF_MISSILE, BASEDEF_RANDOM, BDEF_RemoveBattery(), building_s::buildingStatus, ccs, Cmd_Argc(), Cmd_Argv(), Com_Printf(), MAX_VAR, base_s::name, ccs_s::numBases, base_s::numBatteries, base_s::numLasers, Q_strncpyz(), and type.

Referenced by BDEF_InitCallbacks().

static void BDEF_RemoveItem_f ( void   )  [static]
static void BDEF_SelectItem_f ( void   )  [static]
void BDEF_ShutdownCallbacks ( void   ) 

Definition at line 626 of file cp_basedefence_callbacks.c.

References Cmd_RemoveCommand().

Referenced by CP_RemoveCampaignCallbackCommands().

static void BDEF_UpdateAircraftItemList ( const aircraftSlot_t slot  )  [static]

Update the list of item you can choose.

Parameters:
[in] slot Pointer to aircraftSlot where items can be equiped

Definition at line 69 of file cp_basedefence_callbacks.c.

References _, AII_GetCraftitemTechsByType(), AIM_SelectableCraftItem(), LIST_AddString(), TEXT_LIST, aircraftSlot_s::type, and UI_RegisterLinkedListText().

Referenced by BDEF_FillSlotList().


Generated by  doxygen 1.6.2