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"
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) |
Header file for menu callback functions used for basedefence menu.
Definition in file cp_basedefence_callbacks.c.
static void BDEF_AddBattery_f | ( | void | ) | [static] |
Adds a defence system to base.
Definition at line 551 of file cp_basedefence_callbacks.c.
References B_GetBaseByIDX(), BASEDEF_LASER, BASEDEF_MISSILE, BASEDEF_RANDOM, BDEF_AddBattery(), ccs, Cmd_Argc(), Cmd_Argv(), Com_Printf(), MAX_VAR, ccs_s::numBases, Q_strncpyz(), and type.
Referenced by BDEF_InitCallbacks().
static void BDEF_AddItem_f | ( | void | ) | [static] |
add item to a base defence slot (installation too)
Definition at line 310 of file cp_basedefence_callbacks.c.
References AII_AddItemToSlot(), AII_AutoAddAmmo(), AII_GetCraftitemTechsByType(), AII_RemoveItemFromSlot(), AIM_SelectableCraftItem(), B_GetCurrentSelectedBase(), BDEF_GetBaseSlotByIDX(), BDEF_GetIDFromItemType(), BDEF_GetInstallationSlotByIDX(), BDEF_GetItemTypeFromID(), Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), Com_Printf(), objDef_s::craftitem, INS_GetCurrentSelectedInstallation(), craftitem_s::installationTime, aircraftSlot_s::installationTime, INVSH_GetItemByID(), aircraftSlot_s::item, MAX_ACITEMS, aircraftSlot_s::nextItem, technology_s::provides, qfalse, qtrue, aircraftSlot_s::type, and va().
Referenced by BDEF_InitCallbacks().
static void BDEF_AddSlotToSlotList | ( | const aircraftSlot_t * | slot, | |
linkedList_t ** | slotList | |||
) | [static] |
Definition at line 143 of file cp_basedefence_callbacks.c.
References _, Com_sprintf(), aircraftSlot_s::installationTime, aircraftSlot_s::item, lengthof, LIST_AddString(), LIST_Count(), technology_s::name, aircraftSlot_s::nextItem, and RS_GetTechForItem().
Referenced by BDEF_FillSlotList().
static void BDEF_BaseDefenceMenuUpdate_f | ( | void | ) | [static] |
Fills the battery list, descriptions, and weapons in slots of the basedefence equip menu.
Every slot aims the same target
Every slot aims the same target
info page
Definition at line 188 of file cp_basedefence_callbacks.c.
References _, AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, baseWeapon_s::autofire, B_GetCurrentSelectedBase(), base_s::batteries, installation_s::batteries, BDEF_FillSlotList(), Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), Com_Printf(), Cvar_Set(), INS_GetCurrentSelectedInstallation(), INSTALLATION_WORKING, installation_s::installationStatus, installation_s::installationTemplate, base_s::lasers, LIST_AddString(), MAX_VAR, installationTemplate_s::maxBatteries, base_s::numBatteries, installation_s::numBatteries, base_s::numLasers, Q_strncpyz(), qfalse, RS_GetTechByID(), RS_IsResearched_ptr(), baseWeapon_s::target, TEXT_BASEDEFENCE_LIST, TEXT_ITEMDESCRIPTION, TEXT_LIST, type, UFO_AircraftToIDOnGeoscape(), UI_ExecuteConfunc(), UI_RegisterLinkedListText(), UI_ResetData(), and va().
Referenced by BDEF_InitCallbacks().
static void BDEF_ChangeAutoFire | ( | void | ) | [static] |
Menu callback for changing autofire state Command: basedef_autofire <0|1>.
Definition at line 592 of file cp_basedefence_callbacks.c.
References baseWeapon_s::autofire, B_GetCurrentSelectedBase(), installation_s::batteries, base_s::batteries, Cmd_Argc(), Cmd_Argv(), i, INS_GetCurrentSelectedInstallation(), base_s::lasers, installation_s::numBatteries, base_s::numBatteries, and base_s::numLasers.
Referenced by BDEF_InitCallbacks().
static void BDEF_FillSlotList | ( | const baseWeapon_t * | batteries, | |
int | maxBatteries, | |||
linkedList_t ** | slotList | |||
) | [static] |
Definition at line 172 of file cp_basedefence_callbacks.c.
References BDEF_AddSlotToSlotList(), BDEF_UpdateAircraftItemList(), i, and baseWeapon_s::slot.
Referenced by BDEF_BaseDefenceMenuUpdate_f().
static const char* BDEF_GetIDFromItemType | ( | aircraftItemType_t | type | ) | [static] |
returns the string identifier from an itemtype index
[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
[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 | ) |
Definition at line 615 of file cp_basedefence_callbacks.c.
References BDEF_AddBattery_f(), BDEF_AddItem_f(), BDEF_BaseDefenceMenuUpdate_f(), BDEF_ChangeAutoFire(), BDEF_RemoveBattery_f(), BDEF_RemoveItem_f(), BDEF_SelectItem_f(), and Cmd_AddCommand().
Referenced by CP_AddCampaignCallbackCommands().
static void BDEF_RemoveBattery_f | ( | void | ) | [static] |
Remove a defence system from base.
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] |
add item to a base defence slot (installation too)
Definition at line 392 of file cp_basedefence_callbacks.c.
References AII_RemoveItemFromSlot(), B_GetCurrentSelectedBase(), BDEF_GetBaseSlotByIDX(), BDEF_GetIDFromItemType(), BDEF_GetInstallationSlotByIDX(), BDEF_GetItemTypeFromID(), Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), Com_Printf(), objDef_s::craftitem, INS_GetCurrentSelectedInstallation(), craftitem_s::installationTime, aircraftSlot_s::installationTime, aircraftSlot_s::item, MAX_ACITEMS, aircraftSlot_s::nextItem, qfalse, qtrue, aircraftSlot_s::type, and va().
Referenced by BDEF_InitCallbacks().
static void BDEF_SelectItem_f | ( | void | ) | [static] |
Show item description in bdef menu.
Definition at line 94 of file cp_basedefence_callbacks.c.
References AII_GetCraftitemTechsByType(), AIM_SelectableCraftItem(), B_GetCurrentSelectedBase(), BDEF_GetBaseSlotByIDX(), BDEF_GetInstallationSlotByIDX(), BDEF_GetItemTypeFromID(), Cmd_Argc(), Cmd_Argv(), Com_Printf(), i, INS_GetCurrentSelectedInstallation(), INVSH_GetItemByIDSilent(), aircraftSlot_s::item, MAX_ACITEMS, aircraftSlot_s::nextItem, technology_s::provides, and UP_AircraftItemDescription().
Referenced by BDEF_InitCallbacks().
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.
[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().