UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_installation_callbacks.cpp File Reference

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 []
 

Detailed Description

Menu related console command callbacks.

Definition in file cp_installation_callbacks.cpp.

Function Documentation

static void INS_ChangeInstallationName_f ( void  )
static

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().

static void INS_DestroyInstallation_f ( void  )
static
void INS_InitCallbacks ( void  )
void INS_SelectInstallation ( installation_t installation)

Select an installation when clicking on it on geoscape.

Parameters
[in]installationThe installation to select
Note
This is (and should be) the only place where installationCurrent is set to a value that is not 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().

static void INS_SelectInstallation_f ( void  )
static

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().

static void INS_SetInstallationTitle ( installationType_t  type)
static

Sets the title of the installation to a cvar to prepare the rename menu.

Note
it also assigns description text

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().

void INS_ShutdownCallbacks ( void  )

Definition at line 341 of file cp_installation_callbacks.cpp.

References cgi.

Referenced by CP_RemoveCampaignCallbackCommands().

static void INS_UpdateInstallationLimit_f ( void  )
static

updates the installation limit cvar for menus

Definition at line 205 of file cp_installation_callbacks.cpp.

References B_GetInstallationLimit(), and cgi.

Variable Documentation

const cmdList_t installationCallbacks[]
static
Initial value:
= {
{"mn_installation_select", INS_SelectInstallation_f, "Parameter is the installation index. -1 will build a new one."},
{"mn_installation_build", INS_BuildInstallation_f, nullptr},
{"mn_installation_changename", INS_ChangeInstallationName_f, "Called after editing the cvar installation name"},
{"mn_installation_destroy", INS_DestroyInstallation_f, "Destroys an installation"},
{"mn_installation_update_max_count", INS_UpdateInstallationLimit_f, "Updates the installation count limit"},
{"ui_fill_installationtypes", INS_FillTypes_f, "Fills create installation / installation type selection popup"},
{"ui_build_installationtype", INS_SelectType_f, "Selects installation type to build"},
{"ui_fillufoyards", INS_FillUFOYardData_f, "Fills UFOYard UI with data"},
{nullptr, nullptr, nullptr}
}
static void INS_DestroyInstallation_f(void)
console function for destroying an installation
static void INS_FillUFOYardData_f(void)
Fills the UI with ufo yard data.
static void INS_UpdateInstallationLimit_f(void)
updates the installation limit cvar for menus
static void INS_FillTypes_f(void)
Fills create installation / installation type selection popup.
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.
static void INS_BuildInstallation_f(void)
Constructs a new installation.
static void INS_SelectType_f(void)
Selects installation type to build.
static void INS_ChangeInstallationName_f(void)
Creates console command to change the name of a installation. Copies the value of the cvar mn_install...

Definition at line 320 of file cp_installation_callbacks.cpp.