UFO: Alien Invasion
|
Menu related console command callbacks. More...
#include "../../cl_shared.h"
#include "../../ui/ui_dataids.h"
#include "cp_campaign.h"
#include "cp_geoscape.h"
#include "cp_aircraft_callbacks.h"
#include "cp_aircraft.h"
#include "cp_team.h"
#include "cp_mapfightequip.h"
#include "cp_popup.h"
#include "cp_missions.h"
Go to the source code of this file.
Functions | |
static void | AIM_AircraftReturnToBase_f (void) |
Script function for AIR_AircraftReturnToBase. More... | |
static void | AIM_SelectAircraft_f (void) |
Select an aircraft from a base, by ID. More... | |
static void | AIM_AircraftStart_f (void) |
Starts an aircraft or stops the current mission and lets the aircraft idle around. More... | |
static int | AIR_GetSlotItems (aircraftItemType_t type, const aircraft_t *aircraft) |
Returns the amount of assigned items for a given slot of a given aircraft. More... | |
void | AIR_AircraftSelect (aircraft_t *aircraft) |
Sets aircraftCurrent and updates related cvars and menutexts. More... | |
static void | AIR_AircraftFillList_f (void) |
Update aircraft selection list with the current base aircraft names. More... | |
static void | AIR_ChangeAircraftName_f (void) |
Creates console command to change the name of an aircraft. Copies the value of the cvar mn_aircraftname over as the name of the current selected aircraft. More... | |
static void | AIR_GeoSelectAircraft_f (void) |
Select aircraft on Geoscape. More... | |
static void | AIR_StopAircraft_f (void) |
Stop aircraft on Geoscape. More... | |
static void | AIR_ShowChangeHomebaseAircraft_f (void) |
Show change homebase popup. More... | |
static void | AIR_SendAircraftToMission_f (void) |
Send aircraft to land on a mission. More... | |
static void | AIR_ShowAircraft_f (void) |
Show aircraft in Base sections. More... | |
void | AIR_InitCallbacks (void) |
void | AIR_ShutdownCallbacks (void) |
Variables | |
static const cmdList_t | aircraftCallbacks [] |
Menu related console command callbacks.
Definition in file cp_aircraft_callbacks.cpp.
Script function for AIR_AircraftReturnToBase.
Definition at line 43 of file cp_aircraft_callbacks.cpp.
References AIR_AircraftGetFromIDX(), AIR_AircraftReturnToBase(), AIR_AircraftSelect(), base_s::aircraftCurrent, B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), and index.
Starts an aircraft or stops the current mission and lets the aircraft idle around.
Definition at line 89 of file cp_aircraft_callbacks.cpp.
References _, AII_ReloadAircraftWeapons(), AIR_GetPilot(), AIR_IDLE, AIR_IsAircraftInBase(), base_s::aircraftCurrent, B_COMMAND, B_GetBuildingStatus(), B_GetCurrentSelectedBase(), cgi, CP_Popup(), DEBUG_CLIENT, GEO_SelectAircraft(), MS_AddNewMessage(), and aircraft_s::status.
Select an aircraft from a base, by ID.
Definition at line 68 of file cp_aircraft_callbacks.cpp.
References AIR_AircraftSelect(), AIR_GetAircraftFromBaseByIDXSafe(), base_s::aircraftCurrent, B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), and i.
Update aircraft selection list with the current base aircraft names.
Definition at line 229 of file cp_aircraft_callbacks.cpp.
References _, AIR_AircraftStatusToName(), AIR_ForeachFromBase, AIR_GetTeamSize(), AIR_IsAircraftInBase(), AIR_STATS_DAMAGE, B_GetCurrentSelectedBase(), cgi, Com_sprintf(), and MAX_VAR.
void AIR_AircraftSelect | ( | aircraft_t * | aircraft | ) |
Sets aircraftCurrent and updates related cvars and menutexts.
[in] | aircraft | Pointer to given aircraft that should be selected in the menu. |
Definition at line 171 of file cp_aircraft_callbacks.cpp.
References _, AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, AIR_AircraftMenuStatsValues(), AIR_BaseHasAircraft(), AIR_ForeachFromBase, AIR_GetOperationRange(), AIR_GetSlotItems(), AIR_IsAircraftInBase(), AIR_STATS_DAMAGE, AIR_STATS_FUELSIZE, AIR_STATS_SPEED, base_s::aircraftCurrent, cgi, Com_sprintf(), CP_UpdateActorAircraftVar(), cgame_import_s::Cvar_Set(), aircraft_s::damage, EMPL_SOLDIER, ERR_DROP, aircraft_s::fuel, aircraft_s::homebase, aircraft_s::id, aircraft_s::maxElectronics, aircraft_s::maxWeapons, technology_s::mdl, aircraft_s::name, Q_strcat(), aircraft_s::stats, aircraft_s::tech, and TEXT_AIRCRAFT_INFO.
Referenced by AIM_AircraftReturnToBase_f(), AIM_SelectAircraft_f(), and CL_PopupInterceptRClick_f().
Creates console command to change the name of an aircraft. Copies the value of the cvar mn_aircraftname over as the name of the current selected aircraft.
Definition at line 253 of file cp_aircraft_callbacks.cpp.
References _, base_s::aircraftCurrent, B_GetCurrentSelectedBase(), cgi, Com_IsValidName(), cgame_import_s::Cvar_GetString(), aircraft_s::defaultName, i, aircraft_s::name, Q_strncpyz(), and Q_strnull().
Select aircraft on Geoscape.
Definition at line 289 of file cp_aircraft_callbacks.cpp.
References _, AIR_AircraftGetFromIDX(), AIR_AircraftHasEnoughFuel(), AIR_GetTeamSize(), cgi, cgame_import_s::Cmd_Argv(), GEO_IsAircraftSelected, GEO_SelectAircraft(), index, MIS_Foreach, MIS_GetName(), STAGE_NOT_ACTIVE, and va().
|
static |
Returns the amount of assigned items for a given slot of a given aircraft.
[in] | type | This is the slot type to get the amount of assigned items for |
[in] | aircraft | The aircraft to count the items for (may not be nullptr) |
Definition at line 134 of file cp_aircraft_callbacks.cpp.
References AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, cgi, aircraft_s::electronics, i, aircraftSlot_s::item, MAX_AIRCRAFTSLOT, aircraft_s::shield, and aircraft_s::weapons.
Referenced by AIR_AircraftSelect().
Definition at line 426 of file cp_aircraft_callbacks.cpp.
References cgi.
Referenced by AIR_InitStartup().
Send aircraft to land on a mission.
Definition at line 371 of file cp_aircraft_callbacks.cpp.
References AIR_AircraftGetFromIDX(), AIR_SendAircraftToMission(), cgi, cgame_import_s::Cmd_Argv(), and MIS_GetByIdx().
Show aircraft in Base sections.
Definition at line 393 of file cp_aircraft_callbacks.cpp.
References AIR_AircraftAllowed(), AIR_AircraftStatusToName(), AIR_ForeachFromBase, AIR_IsAircraftInBase(), B_GetFoundedBaseByIDX(), cgi, and cgame_import_s::Cmd_Argv().
Show change homebase popup.
Definition at line 354 of file cp_aircraft_callbacks.cpp.
References AIR_AircraftGetFromIDX(), cgi, CL_DisplayHomebasePopup(), cgame_import_s::Cmd_Argv(), and index.
Definition at line 431 of file cp_aircraft_callbacks.cpp.
References cgi.
Referenced by AIR_Shutdown().
Stop aircraft on Geoscape.
Definition at line 335 of file cp_aircraft_callbacks.cpp.
References AIR_AircraftGetFromIDX(), AIR_IDLE, cgi, cgame_import_s::Cmd_Argv(), and index.
|
static |
Definition at line 412 of file cp_aircraft_callbacks.cpp.