Menu related console command callbacks. More...
#include "../cl_shared.h"
#include "../ui/ui_main.h"
#include "../ui/ui_popup.h"
#include "cp_campaign.h"
#include "cp_map.h"
#include "cp_aircraft_callbacks.h"
#include "cp_aircraft.h"
#include "cp_team.h"
#include "cp_mapfightequip.h"
Go to the source code of this file.
Defines | |
#define | SOLDIER_EQUIP_MENU_BUTTON_NO_AIRCRAFT_IN_BASE 1 |
#define | SOLDIER_EQUIP_MENU_BUTTON_NO_SOLDIES_AVAILABLE 2 |
#define | SOLDIER_EQUIP_MENU_BUTTON_OK 3 |
Functions | |
static void | AIM_AircraftReturnToBase_f (void) |
Script function for AIR_AircraftReturnToBase. | |
static void | AIM_SelectAircraft_f (void) |
Select an aircraft from a base, by ID. | |
static void | AIM_AircraftStart_f (void) |
Starts an aircraft or stops the current mission and let the aircraft idle around. | |
static int | CL_EquipSoldierState (const aircraft_t *aircraft) |
Determines the state of the equip soldier menu button:. | |
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. | |
void | AIR_AircraftSelect (aircraft_t *aircraft) |
Sets aircraftCurrent and updates related cvars and menutexts. | |
static void | AIR_AircraftUpdateList_f (void) |
Update TEXT_AIRCRAFT_LIST with the current base aircraft names. | |
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. | |
void | AIR_InitCallbacks (void) |
void | AIR_ShutdownCallbacks (void) |
Menu related console command callbacks.
Definition in file cp_aircraft_callbacks.c.
#define SOLDIER_EQUIP_MENU_BUTTON_NO_AIRCRAFT_IN_BASE 1 |
Definition at line 121 of file cp_aircraft_callbacks.c.
Referenced by CL_EquipSoldierState().
#define SOLDIER_EQUIP_MENU_BUTTON_NO_SOLDIES_AVAILABLE 2 |
Definition at line 122 of file cp_aircraft_callbacks.c.
Referenced by CL_EquipSoldierState().
#define SOLDIER_EQUIP_MENU_BUTTON_OK 3 |
Definition at line 123 of file cp_aircraft_callbacks.c.
Referenced by CL_EquipSoldierState().
static void AIM_AircraftReturnToBase_f | ( | void | ) | [static] |
Script function for AIR_AircraftReturnToBase.
Definition at line 43 of file cp_aircraft_callbacks.c.
References AIR_AircraftReturnToBase(), AIR_AircraftSelect(), base_s::aircraftCurrent, and B_GetCurrentSelectedBase().
Referenced by AIR_InitCallbacks().
static void AIM_AircraftStart_f | ( | void | ) | [static] |
Starts an aircraft or stops the current mission and let the aircraft idle around.
Definition at line 81 of file cp_aircraft_callbacks.c.
References _, AII_ReloadAircraftWeapons(), AIR_IDLE, AIR_IsAircraftInBase(), base_s::aircraftCurrent, B_COMMAND, B_GetBuildingStatus(), B_GetCurrentSelectedBase(), Com_DPrintf(), DEBUG_CLIENT, MAP_SelectAircraft(), MS_AddNewMessage(), MSG_STANDARD, aircraft_s::pilot, qfalse, aircraft_s::status, UI_Popup(), and UI_PopWindow().
Referenced by AIR_InitCallbacks().
static void AIM_SelectAircraft_f | ( | void | ) | [static] |
Select an aircraft from a base, by ID.
Definition at line 59 of file cp_aircraft_callbacks.c.
References AIR_AircraftSelect(), AIR_GetAircraftFromBaseByIDXSafe(), base_s::aircraftCurrent, B_GetCurrentSelectedBase(), Cmd_Argc(), Cmd_Argv(), and i.
Referenced by AIR_InitCallbacks().
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 186 of file cp_aircraft_callbacks.c.
References _, AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, AIR_AircraftStatusToName(), AIR_BaseHasAircraft(), AIR_GetNextFromBase(), AIR_GetOperationRange(), AIR_GetSlotItems(), AIR_IsAircraftInBase(), AIR_STATS_FUELSIZE, AIR_STATS_SPEED, base_s::aircraft, base_s::aircraftCurrent, CL_AircraftMenuStatsValues(), CL_EquipSoldierState(), CL_UpdateActorAircraftVar(), Com_Error(), Com_sprintf(), Cvar_Set(), Cvar_SetValue(), EMPL_SOLDIER, ERR_DROP, aircraft_s::fuel, aircraft_s::homebase, aircraft_s::id, id, LIST_Count(), aircraft_s::maxElectronics, aircraft_s::maxWeapons, technology_s::mdl, aircraft_s::name, Q_strcat(), aircraft_s::stats, aircraft_s::tech, TEXT_AIRCRAFT_INFO, UI_ExecuteConfunc(), UI_RegisterText(), UI_ResetData(), and va().
Referenced by AIM_AircraftReturnToBase_f(), AIM_SelectAircraft_f(), and CL_PopupInterceptRClick_f().
static void AIR_AircraftUpdateList_f | ( | void | ) | [static] |
Update TEXT_AIRCRAFT_LIST with the current base aircraft names.
Definition at line 249 of file cp_aircraft_callbacks.c.
References AIR_GetNextFromBase(), B_GetCurrentSelectedBase(), LIST_AddString(), aircraft_s::name, TEXT_AIRCRAFT_LIST, and UI_RegisterLinkedListText().
Referenced by AIR_InitCallbacks().
static void AIR_ChangeAircraftName_f | ( | void | ) | [static] |
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 267 of file cp_aircraft_callbacks.c.
References base_s::aircraftCurrent, B_GetCurrentSelectedBase(), Cvar_GetString(), aircraft_s::name, and Q_strncpyz().
Referenced by AIR_InitCallbacks().
static int AIR_GetSlotItems | ( | aircraftItemType_t | type, | |
const aircraft_t * | aircraft | |||
) | [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 NULL) |
Definition at line 148 of file cp_aircraft_callbacks.c.
References AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, Com_Printf(), aircraft_s::electronics, i, aircraftSlot_s::item, MAX_AIRCRAFTSLOT, aircraft_s::shield, and aircraft_s::weapons.
Referenced by AIR_AircraftSelect().
void AIR_InitCallbacks | ( | void | ) |
Definition at line 282 of file cp_aircraft_callbacks.c.
References AIM_AircraftReturnToBase_f(), AIM_AircraftStart_f(), AIM_SelectAircraft_f(), AIR_AircraftUpdateList_f(), AIR_ChangeAircraftName_f(), and Cmd_AddCommand().
Referenced by CP_AddCampaignCallbackCommands().
void AIR_ShutdownCallbacks | ( | void | ) |
Definition at line 295 of file cp_aircraft_callbacks.c.
References Cmd_RemoveCommand().
Referenced by CP_RemoveCampaignCallbackCommands().
static int CL_EquipSoldierState | ( | const aircraft_t * | aircraft | ) | [static] |
Determines the state of the equip soldier menu button:.
Definition at line 130 of file cp_aircraft_callbacks.c.
References AIR_IsAircraftInBase(), E_CountHired(), EMPL_SOLDIER, aircraft_s::homebase, SOLDIER_EQUIP_MENU_BUTTON_NO_AIRCRAFT_IN_BASE, SOLDIER_EQUIP_MENU_BUTTON_NO_SOLDIES_AVAILABLE, and SOLDIER_EQUIP_MENU_BUTTON_OK.
Referenced by AIR_AircraftSelect().