|
UFO: Alien Invasion
|
Header file for menu callback functions used for basedefence menu. More...
#include "../../cl_shared.h"#include "../../ui/ui_dataids.h"#include "cp_campaign.h"#include "cp_basedefence_callbacks.h"#include "cp_fightequip_callbacks.h"#include "cp_mapfightequip.h"#include "cp_ufo.h"#include "cp_missions.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_SetAutoFire (baseWeapon_t *weapon, bool state) |
| Function to turn on/off autofire of a base weapon. | |
| static void | BDEF_UpdateActiveBattery_f (void) |
| Updates the active defences counter. | |
| static void | BDEF_ChangeAutoFire (void) |
| Menu callback for changing autofire state Command: basedef_autofire <0|1>. | |
| void | BDEF_InitCallbacks (void) |
| void | BDEF_ShutdownCallbacks (void) |
Variables | |
| static const cmdList_t | baseDefenseCmds [] |
Header file for menu callback functions used for basedefence menu.
Definition in file cp_basedefence_callbacks.cpp.
Adds a defence system to base.
Definition at line 574 of file cp_basedefence_callbacks.cpp.
References B_GetBaseByIDX(), BASEDEF_LASER, BASEDEF_MISSILE, BASEDEF_RANDOM, BDEF_AddBattery(), cgi, Q_streq, and type.
add item to a base defence slot (installation too)
Definition at line 307 of file cp_basedefence_callbacks.cpp.
References AC_ITEM_BASE_MISSILE, AII_AddItemToSlot(), AII_AutoAddAmmo(), AII_GetCraftitemTechsByType(), AII_RemoveItemFromSlot(), AIM_SelectableCraftItem(), B_GetCurrentSelectedBase(), BDEF_GetBaseSlotByIDX(), BDEF_GetIDFromItemType(), BDEF_GetInstallationSlotByIDX(), BDEF_GetItemTypeFromID(), cgi, objDef_t::craftitem, INS_GetCurrentSelectedInstallation(), aircraftSlot_t::installationTime, craftItem::installationTime, INVSH_GetItemByID(), aircraftSlot_t::item, MAX_ACITEMS, aircraftSlot_t::nextItem, base_t::numActiveBatteries, base_t::numActiveLasers, installation_t::numBatteries, technology_t::provides, and aircraftSlot_t::type.
|
static |
Definition at line 142 of file cp_basedefence_callbacks.cpp.
References _, cgi, Com_sprintf(), aircraftSlot_t::installationTime, aircraftSlot_t::item, lengthof, technology_t::name, aircraftSlot_t::nextItem, and RS_GetTechForItem().
Referenced by BDEF_FillSlotList().
Fills the battery list, descriptions, and weapons in slots of the basedefence equip menu.
Definition at line 185 of file cp_basedefence_callbacks.cpp.
References _, AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, baseWeapon_t::autofire, B_GetCurrentSelectedBase(), base_t::batteries, installation_t::batteries, BDEF_FillSlotList(), cgi, INS_GetCurrentSelectedInstallation(), INSTALLATION_WORKING, installation_t::installationStatus, installation_t::installationTemplate, base_t::lasers, MAX_VAR, installationTemplate_t::maxBatteries, base_t::numActiveBatteries, base_t::numActiveLasers, base_t::numBatteries, installation_t::numBatteries, base_t::numLasers, Q_streq, Q_strncpyz(), RS_GetTechByID(), RS_IsResearched_ptr(), Sys_Error(), baseWeapon_t::target, TEXT_BASEDEFENCE_LIST, TEXT_ITEMDESCRIPTION, TEXT_LIST, type, and UFO_GetName().
Menu callback for changing autofire state Command: basedef_autofire <0|1>.
Definition at line 659 of file cp_basedefence_callbacks.cpp.
References B_GetCurrentSelectedBase(), base_t::batteries, installation_t::batteries, BDEF_SetAutoFire(), cgi, i, INS_GetCurrentSelectedInstallation(), base_t::lasers, base_t::numBatteries, installation_t::numBatteries, and base_t::numLasers.
|
static |
Definition at line 171 of file cp_basedefence_callbacks.cpp.
References BDEF_AddSlotToSlotList(), BDEF_UpdateAircraftItemList(), i, and baseWeapon_t::slot.
Referenced by BDEF_BaseDefenceMenuUpdate_f().
|
static |
returns the string identifier from an itemtype index
| [in] | type | Defence type |
Definition at line 52 of file cp_basedefence_callbacks.cpp.
References AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, and type.
Referenced by BDEF_AddItem_f(), and BDEF_RemoveItem_f().
|
static |
returns the itemtype index from a string identifier
| [in] | type | Defence type identifier string |
Definition at line 38 of file cp_basedefence_callbacks.cpp.
References AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, MAX_ACITEMS, Q_streq, and type.
Referenced by BDEF_AddItem_f(), BDEF_RemoveItem_f(), and BDEF_SelectItem_f().
Definition at line 694 of file cp_basedefence_callbacks.cpp.
References baseDefenseCmds, and cgi.
Referenced by CP_AddCampaignCallbackCommands().
Remove a defence system from base.
Definition at line 477 of file cp_basedefence_callbacks.cpp.
References B_DEFENCE_LASER, B_DEFENCE_MISSILE, B_GetCount(), B_GetFoundedBaseByIDX(), B_GetNextBuildingByType(), B_STATUS_WORKING, BASEDEF_LASER, BASEDEF_MISSILE, BASEDEF_RANDOM, BDEF_RemoveBattery(), building_t::buildingStatus, cgi, MAX_VAR, base_t::name, base_t::numBatteries, base_t::numLasers, Q_streq, Q_strncpyz(), and type.
add item to a base defence slot (installation too)
Definition at line 401 of file cp_basedefence_callbacks.cpp.
References AC_ITEM_BASE_MISSILE, AII_RemoveItemFromSlot(), B_GetCurrentSelectedBase(), BDEF_GetBaseSlotByIDX(), BDEF_GetIDFromItemType(), BDEF_GetInstallationSlotByIDX(), BDEF_GetItemTypeFromID(), cgi, objDef_t::craftitem, INS_GetCurrentSelectedInstallation(), aircraftSlot_t::installationTime, craftItem::installationTime, aircraftSlot_t::item, MAX_ACITEMS, aircraftSlot_t::nextItem, base_t::numActiveBatteries, base_t::numActiveLasers, installation_t::numBatteries, and aircraftSlot_t::type.
Show item description in bdef menu.
Definition at line 93 of file cp_basedefence_callbacks.cpp.
References AII_GetCraftitemTechsByType(), AIM_SelectableCraftItem(), B_GetCurrentSelectedBase(), BDEF_GetBaseSlotByIDX(), BDEF_GetInstallationSlotByIDX(), BDEF_GetItemTypeFromID(), cgi, i, INS_GetCurrentSelectedInstallation(), INVSH_GetItemByIDSilent(), aircraftSlot_t::item, MAX_ACITEMS, aircraftSlot_t::nextItem, technology_t::provides, and UP_AircraftItemDescription().
|
static |
Function to turn on/off autofire of a base weapon.
| [in,out] | weapon | Pointer to the weapon to turn off |
| [in] | state | New status for autofire |
Definition at line 612 of file cp_basedefence_callbacks.cpp.
References _, baseWeapon_t::autofire, cgi, and baseWeapon_t::target.
Referenced by BDEF_ChangeAutoFire().
Definition at line 699 of file cp_basedefence_callbacks.cpp.
References baseDefenseCmds, and cgi.
Referenced by CP_RemoveCampaignCallbackCommands().
Updates the active defences counter.
Definition at line 625 of file cp_basedefence_callbacks.cpp.
References B_CheckBuildingTypeStatus(), B_DEFENCE_LASER, B_DEFENCE_MISSILE, B_GetBaseByIDX(), B_STATUS_WORKING, cgi, count, base_t::numActiveBatteries, base_t::numActiveLasers, base_t::numBatteries, base_t::numLasers, Q_streq, and type.
|
static |
Update the list of item you can choose.
| [in] | slot | Pointer to aircraftSlot where items can be equiped |
Definition at line 68 of file cp_basedefence_callbacks.cpp.
References _, AII_GetCraftitemTechsByType(), AIM_SelectableCraftItem(), cgi, TEXT_LIST, and aircraftSlot_t::type.
Referenced by BDEF_FillSlotList().
|
static |
Definition at line 683 of file cp_basedefence_callbacks.cpp.
Referenced by BDEF_InitCallbacks(), and BDEF_ShutdownCallbacks().