UFO: Alien Invasion
|
Menu related console command callbacks. More...
#include "../../cl_shared.h"
#include "../../ui/ui_dataids.h"
#include "cp_campaign.h"
#include "cp_installation_callbacks.h"
#include "cp_installation.h"
#include "cp_geoscape.h"
#include "cp_popup.h"
#include "cp_ufo.h"
#include "cp_uforecovery_callbacks.h"
Go to the source code of this file.
Functions | |
static void | INS_SetInstallationTitle (installationType_t type) |
Sets the title of the installation to a cvar to prepare the rename menu. More... | |
void | INS_SelectInstallation (installation_t *installation) |
Select an installation when clicking on it on geoscape. More... | |
static void | INS_BuildInstallation_f (void) |
Constructs a new installation. More... | |
static void | INS_SelectInstallation_f (void) |
Called when an installation is opened or a new installation is created on geoscape. For a new installation the installationID is -1. More... | |
static void | INS_ChangeInstallationName_f (void) |
Creates console command to change the name of a installation. Copies the value of the cvar mn_installation_title over as the name of the current selected installation. More... | |
static void | INS_DestroyInstallation_f (void) |
console function for destroying an installation More... | |
static void | INS_UpdateInstallationLimit_f (void) |
updates the installation limit cvar for menus More... | |
static void | INS_FillUFOYardData_f (void) |
Fills the UI with ufo yard data. More... | |
static void | INS_FillTypes_f (void) |
Fills create installation / installation type selection popup. More... | |
static void | INS_SelectType_f (void) |
Selects installation type to build. More... | |
void | INS_InitCallbacks (void) |
void | INS_ShutdownCallbacks (void) |
Variables | |
static const cmdList_t | installationCallbacks [] |
Menu related console command callbacks.
Definition in file cp_installation_callbacks.cpp.
Constructs a new installation.
Definition at line 86 of file cp_installation_callbacks.cpp.
References _, B_GetInstallationLimit(), ccs, cgi, cgame_import_s::Cmd_Argv(), Com_sprintf(), installationTemplate_s::cost, cp_messageBuffer, CP_Popup(), CP_UpdateCredits(), ccs_s::credits, cgame_import_s::Cvar_GetString(), GEO_GetNation(), GEO_IsRadarOverlayActivated(), GEO_SetOverlay(), INS_Build(), INS_GetCount(), INS_GetInstallationTemplateByID(), INSTALLATION_RADAR, MA_NEWINSTALLATION, MA_NONE, ccs_s::mapAction, MSG_CONSTRUCTION, MSO_CheckAddNewMessage(), nation_s::name, installation_s::name, ccs_s::newBasePos, NT_INSTALLATION_BUILDSTART, installation_s::pos, and installationTemplate_s::type.
Creates console command to change the name of a installation. Copies the value of the cvar mn_installation_title over as the name of the current selected installation.
Definition at line 159 of file cp_installation_callbacks.cpp.
References cgi, cgame_import_s::Cvar_GetString(), INS_GetCurrentSelectedInstallation(), installation_s::name, and Q_strncpyz().
console function for destroying an installation
Definition at line 174 of file cp_installation_callbacks.cpp.
References _, cgi, cgame_import_s::Cmd_Argv(), Com_sprintf(), DEBUG_CLIENT, installation_s::idx, INS_DestroyInstallation(), INS_GetByIDX(), INS_GetCurrentSelectedInstallation(), and MAX_VAR.
Fills create installation / installation type selection popup.
Definition at line 252 of file cp_installation_callbacks.cpp.
References _, B_GetCount(), B_GetInstallationLimit(), campaign_s::basecost, installationTemplate_s::buildTime, ccs, cgi, installationTemplate_s::cost, ccs_s::curCampaign, i, installationTemplate_s::id, INS_GetCount(), INS_HasType(), INSTALLATION_NOT_USED, ccs_s::installationTemplates, MAX_BASES, installationTemplate_s::name, ngettext, ccs_s::numInstallationTemplates, installationTemplate_s::once, RS_IsResearched_ptr(), installationTemplate_s::tech, installationTemplate_s::type, and va().
Fills the UI with ufo yard data.
Definition at line 213 of file cp_installation_callbacks.cpp.
References _, installation_s::buildStart, installationTemplate_s::buildTime, ccs, cgi, cgame_import_s::Cmd_Argv(), capacities_s::cur, ccs_s::date, date_s::day, DEBUG_CLIENT, GEO_GetNation(), installation_s::idx, INS_GetByIDX(), INS_GetCurrentSelectedInstallation(), INS_GetFirstUFOYard(), INSTALLATION_UFOYARD, INSTALLATION_UNDER_CONSTRUCTION, installation_s::installationStatus, installation_s::installationTemplate, capacities_s::max, nation_s::name, installation_s::name, ngettext, installation_s::pos, installationTemplate_s::type, UFO_GetName(), installation_s::ufoCapacity, US_Foreach, US_StoredUFOStatus(), and va().
Definition at line 331 of file cp_installation_callbacks.cpp.
References cgi, cgame_import_s::Cvar_Set(), and INS_GetCount().
Referenced by CP_AddCampaignCallbackCommands().
void INS_SelectInstallation | ( | installation_t * | installation | ) |
Select an installation when clicking on it on geoscape.
[in] | installation | The installation to select |
nullptr
Definition at line 56 of file cp_installation_callbacks.cpp.
References B_SetCurrentSelectedBase(), installation_s::buildStart, installationTemplate_s::buildTime, ccs, cgi, cgame_import_s::Cvar_Set(), ccs_s::date, date_s::day, DEBUG_CLIENT, installation_s::idx, INS_SetCurrentSelectedInstallation(), INSTALLATION_DEFENCE, INSTALLATION_UFOYARD, INSTALLATION_WORKING, installation_s::installationStatus, installation_s::installationTemplate, MA_NONE, ccs_s::mapAction, ngettext, and installationTemplate_s::type.
Referenced by INS_SelectInstallation_f().
Called when an installation is opened or a new installation is created on geoscape. For a new installation the installationID is -1.
Definition at line 138 of file cp_installation_callbacks.cpp.
References cgi, cgame_import_s::Cmd_Argv(), INS_GetByIDX(), and INS_SelectInstallation().
Selects installation type to build.
Definition at line 275 of file cp_installation_callbacks.cpp.
References B_GetInstallationLimit(), installationTemplate_s::buildTime, ccs, cgi, cgame_import_s::Cmd_Argv(), installationTemplate_s::cost, cgame_import_s::Cvar_Set(), GEO_IsRadarOverlayActivated(), GEO_ResetAction(), GEO_SetOverlay(), installationTemplate_s::id, INS_GetCount(), INS_GetInstallationTemplateByID(), INS_HasType(), INS_SetInstallationTitle(), INSTALLATION_NOT_USED, INSTALLATION_RADAR, MA_NEWINSTALLATION, ccs_s::mapAction, installationTemplate_s::once, RS_IsResearched_ptr(), installationTemplate_s::tech, and installationTemplate_s::type.
|
static |
Sets the title of the installation to a cvar to prepare the rename menu.
Definition at line 40 of file cp_installation_callbacks.cpp.
References _, ccs_s::campaignStats, ccs, cgi, cgame_import_s::Cvar_Set(), installationTemplate_s::description, INS_GetInstallationTemplateByType(), stats_s::installationsBuilt, installationTemplate_s::name, Q_strvalid, and TEXT_BUILDING_INFO.
Referenced by INS_SelectType_f().
Definition at line 341 of file cp_installation_callbacks.cpp.
References cgi.
Referenced by CP_RemoveCampaignCallbackCommands().
updates the installation limit cvar for menus
Definition at line 205 of file cp_installation_callbacks.cpp.
References B_GetInstallationLimit(), and cgi.
|
static |
Definition at line 320 of file cp_installation_callbacks.cpp.