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. More... | |
Functions | |
static void | B_Destroy_AntimaterStorage_f (void) |
onDestroy Callback for Antimatter Storage More... | |
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. More... | |
static void | B_SetBaseTitle_f (void) |
Sets the title of the base to a cvar to prepare the rename menu. More... | |
static void | B_BuildBase_f (void) |
Constructs a new base. More... | |
static void | B_ChangeBaseName_f (void) |
Creates console command to change the name of a base. More... | |
static void | B_BaseInit_f (void) |
Initialises base. More... | |
static void | B_BuildingDestroy_f (void) |
Destroy a base building. More... | |
static void | B_AssembleMap_f (void) |
Builds a base map for tactical combat. More... | |
static void | B_MakeBaseMapShot_f (void) |
Makes a mapshot - called by basemapshot script command. More... | |
static void | B_FillBuildingInfo_f (void) |
Script function for clicking the building list text field. More... | |
static void | B_ListBuildings_f (void) |
Update the facilities list. More... | |
static void | B_FillMap_f (void) |
Lists building tiles for the Basescape UI. More... | |
static void | B_BuildingOpenAfterClick_f (void) |
Opens menu on clicking a building in Baseview. More... | |
static void | B_BuildBuilding_f (void) |
Build a base building. More... | |
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, cgame_import_s::Cmd_Argv(), GEO_IsNight(), and base_s::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, cgame_import_s::Cmd_Argv(), CP_UpdateCredits(), ccs_s::credits, 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_s::basecost, stats_s::basesBuilt, ccs_s::campaignStats, ccs, cgi, Com_IsValidName(), Com_sprintf(), CP_GameTimeStop(), cp_messageBuffer, CP_Popup(), CP_UpdateCredits(), ccs_s::credits, ccs_s::curCampaign, ERR_DROP, GEO_GetNation(), GEO_IsRadarOverlayActivated(), GEO_SetOverlay(), MA_NEWBASE, MA_NONE, ccs_s::mapAction, MS_AddNewMessage(), MSG_CONSTRUCTION, nation_s::name, ccs_s::newBasePos, base_s::pos, and cvar_s::string.
Build a base building.
Definition at line 632 of file cp_base_callbacks.cpp.
References _, B_BuildBuilding(), B_GetBaseByIDX(), B_GetBuildingTemplateSilent(), BASE_SIZE, cgi, cgame_import_s::Cmd_Argv(), CP_CheckCredits(), CP_Popup(), f, building_s::fixCosts, base_s::idx, int(), and building_s::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_s::buildingStatus, building_s::buildingType, CAP_GetFreeCapacity(), building_s::capacity, cgi, cgame_import_s::Cmd_Argv(), CP_Popup(), base_s::idx, building_s::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_s::buildingType, CAP_ANTIMATTER, CAP_GetCurrent, CAP_GetMax, cgi, cgame_import_s::Cmd_Argv(), CP_Popup(), E_HireAllowed(), HOS_HospitalAllowed(), base_s::idx, building_s::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, cgame_import_s::Cmd_Argv(), Com_IsValidName(), cgame_import_s::Cvar_Set(), and base_s::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_s::baseStatus, CAP_ANTIMATTER, CAP_GetCurrent, CAP_RemoveAntimatterExceedingCapacity(), cgi, cgame_import_s::Cmd_Argv(), frand(), MS_AddNewMessage(), base_s::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_s::buildTime, cgi, cgame_import_s::Cmd_Argv(), building_s::dependsBuilding, building_s::fixCosts, building_s::id, building_s::image, building_s::maxCount, building_s::name, ngettext, va(), and building_s::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, cgame_import_s::Cmd_Argv(), building_s::id, building_s::image, building_s::name, ngettext, building_s::pos, building_s::size, and va().
Definition at line 695 of file cp_base_callbacks.cpp.
References _, B_GetCount(), campaign_s::basecost, ccs, cgi, ccs_s::curCampaign, cgame_import_s::Cvar_Get(), cgame_import_s::Cvar_Set(), and MAX_BASES.
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(), ccs_s::buildingTemplates, building_s::buildingType, CAP_Get, building_s::capacity, ccs, cgi, cgame_import_s::Cmd_Argv(), count, capacities_s::cur, i, building_s::id, building_s::mandatory, capacities_s::max, MAX_CAP, building_s::maxCount, building_s::name, ccs_s::numBuildingTemplates, OBJZERO, RS_IsResearched_ptr(), building_s::size, building_s::tech, and building_s::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, cgame_import_s::Cmd_Argv(), 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_s::bases, ccs, cgi, Com_sprintf(), cgame_import_s::Cvar_Set(), i, lengthof, MAX_BASES, MAX_VAR, MS_AddNewMessage(), base_s::name, Q_streq, and Q_strncpyz().
Definition at line 706 of file cp_base_callbacks.cpp.
References cgi.
Referenced by CP_RemoveCampaignCallbackCommands().
|
static |
Init/Shutdown functions
Definition at line 676 of file cp_base_callbacks.cpp.
|
static |
Definition at line 40 of file cp_base_callbacks.cpp.