|
UFO: Alien Invasion
|
Menu related console command callbacks. More...
#include "../../cl_shared.h"#include "cp_campaign.h"#include "cp_base_callbacks.h"#include "cp_base.h"#include "cp_capacity.h"#include "cp_geoscape.h"#include "cp_popup.h"#include "cp_time.h"#include "cp_ufo.h"#include "../../ui/ui_dataids.h"#include "aliencontainment.h"
Go to the source code of this file.
Macros | |
| #define | CREATE_NEW_BASE_ID -1 |
| Used from menu scripts as parameter for mn_base_select. | |
Functions | |
| static void | B_Destroy_AntimaterStorage_f (void) |
| onDestroy Callback for Antimatter Storage | |
| static void | B_SelectBase_f (void) |
| Called when a base is opened or a new base is created on geoscape. For a new base the baseID is -1. | |
| static void | B_SetBaseTitle_f (void) |
| Sets the title of the base to a cvar to prepare the rename menu. | |
| static void | B_BuildBase_f (void) |
| Constructs a new base. | |
| static void | B_ChangeBaseName_f (void) |
| Creates console command to change the name of a base. | |
| static void | B_BaseInit_f (void) |
| Initialises base. | |
| static void | B_BuildingDestroy_f (void) |
| Destroy a base building. | |
| static void | B_AssembleMap_f (void) |
| Builds a base map for tactical combat. | |
| static void | B_MakeBaseMapShot_f (void) |
| Makes a mapshot - called by basemapshot script command. | |
| static void | B_FillBuildingInfo_f (void) |
| Script function for clicking the building list text field. | |
| static void | B_ListBuildings_f (void) |
| Update the facilities list. | |
| static void | B_FillMap_f (void) |
| Lists building tiles for the Basescape UI. | |
| static void | B_BuildingOpenAfterClick_f (void) |
| Opens menu on clicking a building in Baseview. | |
| static void | B_BuildBuilding_f (void) |
| Build a base building. | |
| void | B_InitCallbacks (void) |
| void | B_ShutdownCallbacks (void) |
Variables | |
| static cvar_t * | mn_base_title |
| static const cmdList_t | baseCallbacks [] |
Menu related console command callbacks.
Definition in file cp_base_callbacks.cpp.
| #define CREATE_NEW_BASE_ID -1 |
Used from menu scripts as parameter for mn_base_select.
Definition at line 38 of file cp_base_callbacks.cpp.
Referenced by B_SelectBase_f().
Builds a base map for tactical combat.
Definition at line 380 of file cp_base_callbacks.cpp.
References B_AssembleMap(), B_GetFoundedBaseByIDX(), cgi, GEO_IsNight(), and base_t::pos.
Initialises base.
Definition at line 209 of file cp_base_callbacks.cpp.
References _, AC_ContainmentAllowed(), AIR_AircraftAllowed(), AIR_BaseHasAircraft(), B_GetCount(), B_GetCurrentSelectedBase(), B_GetFoundedBaseByIDX(), BS_BuySellAllowed(), ccs, cgi, CP_UpdateCredits(), E_HireAllowed(), HOS_HospitalAllowed(), PR_ProductionAllowed(), and RS_ResearchAllowed().
Constructs a new base.
Definition at line 135 of file cp_base_callbacks.cpp.
References _, B_Build(), B_GetCount(), B_SelectBase(), B_SetUpFirstBase(), campaign_t::basecost, ccs, cgi, Com_IsValidName(), Com_sprintf(), CP_GameTimeStop(), cp_messageBuffer, CP_Popup(), CP_UpdateCredits(), ERR_DROP, GEO_GetNation(), GEO_IsRadarOverlayActivated(), GEO_SetOverlay(), MA_NEWBASE, MA_NONE, mn_base_title, MS_AddNewMessage(), MSG_CONSTRUCTION, nation_t::name, and base_t::pos.
Build a base building.
Definition at line 632 of file cp_base_callbacks.cpp.
References _, B_BuildBuilding(), B_GetBaseByIDX(), B_GetBuildingTemplateSilent(), BASE_SIZE, cgi, CP_CheckCredits(), CP_Popup(), building_t::fixCosts, base_t::idx, and building_t::size.
Destroy a base building.
Definition at line 278 of file cp_base_callbacks.cpp.
References _, B_ALIEN_CONTAINMENT, B_BuildingDestroy(), B_ENTRANCE, B_GetBuildingAt, B_GetCapacityFromBuildingType(), B_GetCount(), B_GetFoundedBaseByIDX(), B_HANGAR, B_IsBuildingDestroyable(), B_IsUnderAttack, B_QUARTERS, B_SMALL_HANGAR, B_STATUS_WORKING, B_STORAGE, building_t::buildingStatus, building_t::buildingType, CAP_GetFreeCapacity(), building_t::capacity, cgi, CP_Popup(), base_t::idx, building_t::pos, Q_streq, and va().
Opens menu on clicking a building in Baseview.
Definition at line 539 of file cp_base_callbacks.cpp.
References _, AC_ContainmentAllowed(), AIR_AircraftAllowed(), AIR_BaseHasAircraft(), B_ALIEN_CONTAINMENT, B_ANTIMATTER, B_DEFENCE_LASER, B_DEFENCE_MISSILE, B_GetBuildingAt, B_GetBuildingStatus(), B_GetCount(), B_GetFoundedBaseByIDX(), B_HANGAR, B_HOSPITAL, B_LAB, B_QUARTERS, B_SMALL_HANGAR, B_STORAGE, B_WORKSHOP, BS_BuySellAllowed(), building_t::buildingType, CAP_ANTIMATTER, CAP_GetCurrent, CAP_GetMax, cgi, CP_Popup(), E_HireAllowed(), HOS_HospitalAllowed(), base_t::idx, building_t::pedia, PR_ProductionAllowed(), RS_ResearchAllowed(), and UP_OpenWith().
Creates console command to change the name of a base.
Definition at line 181 of file cp_base_callbacks.cpp.
References B_GetFoundedBaseByIDX(), B_SetName(), cgi, Com_IsValidName(), and base_t::name.
onDestroy Callback for Antimatter Storage
note: third parameter not used but we must be sure we have probability parameter
Definition at line 45 of file cp_base_callbacks.cpp.
References _, B_Destroy(), B_GetFoundedBaseByIDX(), BASE_WORKING, base_t::baseStatus, CAP_ANTIMATTER, CAP_GetCurrent, CAP_RemoveAntimatterExceedingCapacity(), cgi, frand(), MS_AddNewMessage(), base_t::name, and va().
Script function for clicking the building list text field.
Definition at line 424 of file cp_base_callbacks.cpp.
References B_GetBaseByIDX(), B_GetBuildingTemplateSilent(), B_GetNumberOfBuildingsInBaseByTemplate(), building_t::buildTime, cgi, building_t::dependsBuilding, building_t::fixCosts, building_t::id, building_t::image, building_t::maxCount, building_t::name, ngettext, va(), and building_t::varCosts.
Lists building tiles for the Basescape UI.
Definition at line 499 of file cp_base_callbacks.cpp.
References _, B_GetBuildingAt, B_GetConstructionTimeRemain(), B_GetFoundedBaseByIDX(), B_IsBuildingBuiltUp(), B_IsTileBlocked, BASE_SIZE, cgi, building_t::id, building_t::image, building_t::name, ngettext, building_t::pos, building_t::size, and va().
Definition at line 695 of file cp_base_callbacks.cpp.
References _, B_GetCount(), baseCallbacks, ccs, cgi, MAX_BASES, and mn_base_title.
Referenced by CP_AddCampaignCallbackCommands().
Update the facilities list.
Definition at line 460 of file cp_base_callbacks.cpp.
References _, B_GetBaseByIDX(), B_GetCapacityFromBuildingType(), B_GetNumberOfBuildingsInBaseByTemplate(), building_t::buildingType, CAP_Get, ccs, cgi, count, capacities_t::cur, i, building_t::id, building_t::mandatory, capacities_t::max, MAX_CAP, building_t::name, OBJZERO, RS_IsResearched_ptr(), building_t::size, building_t::tech, and building_t::tpl.
Makes a mapshot - called by basemapshot script command.
Definition at line 404 of file cp_base_callbacks.cpp.
References cgi.
Called when a base is opened or a new base is created on geoscape. For a new base the baseID is -1.
Definition at line 77 of file cp_base_callbacks.cpp.
References B_GetFoundedBaseByIDX(), B_SelectBase(), cgi, CREATE_NEW_BASE_ID, and MAX_BASES.
Sets the title of the base to a cvar to prepare the rename menu.
Definition at line 103 of file cp_base_callbacks.cpp.
References _, B_GetCount(), ccs, cgi, Com_sprintf(), i, lengthof, MAX_BASES, MAX_VAR, MS_AddNewMessage(), Q_streq, and Q_strncpyz().
Definition at line 706 of file cp_base_callbacks.cpp.
References baseCallbacks, and cgi.
Referenced by CP_RemoveCampaignCallbackCommands().
|
static |
Init/Shutdown functions
Definition at line 676 of file cp_base_callbacks.cpp.
Referenced by B_InitCallbacks(), and B_ShutdownCallbacks().
|
static |
Definition at line 40 of file cp_base_callbacks.cpp.
Referenced by B_BuildBase_f(), and B_InitCallbacks().