Menu related console command callbacks. More...
#include "../cl_shared.h"
#include "../ui/ui_main.h"
#include "cp_campaign.h"
#include "cp_installation_callbacks.h"
#include "cp_installation.h"
#include "cp_map.h"
#include "../ui/ui_popup.h"
Go to the source code of this file.
Functions | |
static void | INS_SetInstallationTitle (void) |
Sets the title of the installation to a cvar to prepare the rename menu. | |
void | INS_SelectInstallation (installation_t *installation) |
Select an installation when clicking on it on geoscape, or build a new installation. | |
static void | INS_BuildInstallation_f (void) |
Constructs a new installation. | |
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_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. | |
static void | INS_DestroyInstallation_f (void) |
console function for destroying an installation | |
static void | INS_UpdateInsatallationLimit_f (void) |
updates the installation limit cvar for menus | |
void | INS_InitCallbacks (void) |
void | INS_ShutdownCallbacks (void) |
Menu related console command callbacks.
Definition in file cp_installation_callbacks.c.
static void INS_BuildInstallation_f | ( | void | ) | [static] |
Constructs a new installation.
Definition at line 101 of file cp_installation_callbacks.c.
References _, B_GetInstallationLimit(), ccs_s::campaignStats, ccs, CL_UpdateCredits(), Cmd_Argc(), Cmd_Argv(), Com_Printf(), Com_sprintf(), installationTemplate_s::cost, cp_messageBuffer, ccs_s::credits, Cvar_GetString(), Cvar_SetValue(), installation_s::founded, INS_GetFirstUnfoundedInstallation(), INS_GetInstallationTemplateFromInstallationID(), INS_SetUpInstallation(), stats_s::installationsBuild, MA_NEWINSTALLATION, MA_NONE, MAP_GetNation(), MAP_IsRadarOverlayActivated(), MAP_SetOverlay(), ccs_s::mapAction, MSG_CONSTRUCTION, MSO_CheckAddNewMessage(), nation_s::name, installation_s::name, newBasePos, NT_INSTALLATION_BUILDSTART, ccs_s::numInstallations, installation_s::pos, Q_strncpyz(), qfalse, and UI_Popup().
Referenced by INS_InitCallbacks().
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 185 of file cp_installation_callbacks.c.
References Cvar_GetString(), INS_GetCurrentSelectedInstallation(), installation_s::name, and Q_strncpyz().
Referenced by INS_InitCallbacks().
static void INS_DestroyInstallation_f | ( | void | ) | [static] |
console function for destroying an installation
Definition at line 200 of file cp_installation_callbacks.c.
References _, Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_sprintf(), DEBUG_CLIENT, installation_s::idx, INS_DestroyInstallation(), INS_GetCurrentSelectedInstallation(), INS_GetFoundedInstallationByIDX(), MAX_VAR, and UI_PopupButton().
Referenced by INS_InitCallbacks().
void INS_InitCallbacks | ( | void | ) |
Definition at line 236 of file cp_installation_callbacks.c.
References ccs, Cmd_AddCommand(), Cvar_Set(), Cvar_SetValue(), INS_BuildInstallation_f(), INS_ChangeInstallationName_f(), INS_DestroyInstallation_f(), INS_SelectInstallation_f(), INS_UpdateInsatallationLimit_f(), and ccs_s::numInstallations.
Referenced by CP_AddCampaignCallbackCommands().
void INS_SelectInstallation | ( | installation_t * | installation | ) |
Select an installation when clicking on it on geoscape, or build a new installation.
[in] | installation | If this is NULL we want to build a new installation |
NULL
Definition at line 64 of file cp_installation_callbacks.c.
References B_GetInstallationLimit(), installation_s::buildStart, installationTemplate_s::buildTime, ccs, Com_DPrintf(), Cvar_Set(), ccs_s::date, date_s::day, DEBUG_CLIENT, installation_s::idx, INS_SetCurrentSelectedInstallation(), INS_SetInstallationTitle(), INSTALLATION_WORKING, installation_s::installationStatus, installation_s::installationTemplate, MA_NEWINSTALLATION, MA_NONE, MAP_IsRadarOverlayActivated(), MAP_ResetAction(), MAP_SetOverlay(), ccs_s::mapAction, ngettext, ccs_s::numInstallations, UI_PushWindow(), and va().
Referenced by INS_SelectInstallation_f(), and MAP_MultiSelectExecuteAction_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 161 of file cp_installation_callbacks.c.
References ccs, Cmd_Argc(), Cmd_Argv(), Com_Printf(), INS_GetFoundedInstallationByIDX(), INS_SelectInstallation(), and ccs_s::numInstallations.
Referenced by INS_InitCallbacks().
static void INS_SetInstallationTitle | ( | void | ) | [static] |
Sets the title of the installation to a cvar to prepare the rename menu.
Definition at line 38 of file cp_installation_callbacks.c.
References _, ccs, Com_sprintf(), Cvar_GetString(), Cvar_Set(), installationTemplate_s::description, i, INS_GetInstallationTemplateFromInstallationID(), ccs_s::installations, lengthof, MAX_VAR, installation_s::name, installationTemplate_s::name, ccs_s::numInstallations, TEXT_BUILDING_INFO, UI_RegisterText(), and UI_ResetData().
Referenced by INS_SelectInstallation().
void INS_ShutdownCallbacks | ( | void | ) |
Definition at line 250 of file cp_installation_callbacks.c.
References Cmd_RemoveCommand(), and Cvar_Delete().
Referenced by CP_RemoveCampaignCallbackCommands().
static void INS_UpdateInsatallationLimit_f | ( | void | ) | [static] |
updates the installation limit cvar for menus
Definition at line 231 of file cp_installation_callbacks.c.
References B_GetInstallationLimit(), and Cvar_SetValue().
Referenced by INS_InitCallbacks().