cp_aircraft_callbacks.c File Reference

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"
Include dependency graph for cp_aircraft_callbacks.c:

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)

Detailed Description

Menu related console command callbacks.

Definition in file cp_aircraft_callbacks.c.


Define Documentation

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


Function Documentation

static void AIM_AircraftReturnToBase_f ( void   )  [static]

Script function for AIR_AircraftReturnToBase.

Note:
Sends the current aircraft back to homebase (called from aircraft menu).
This function updates some cvars for current aircraft.
See also:
GAME_CP_MissionAutoGo_f
GAME_CP_Results_f

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]
static void AIM_SelectAircraft_f ( void   )  [static]

Select an aircraft from a base, by ID.

See also:
AIR_AircraftSelect
AIM_PrevAircraft_f
AIM_NextAircraft_f

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

Parameters:
[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)
Returns:
The amount of assigned items for the given slot

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

Returns:
SOLIDER_EQUIP_MENU_BUTTON_NO_AIRCRAFT_IN_BASE if no aircraft in base
SOLIDER_EQUIP_MENU_BUTTON_NO_SOLDIES_AVAILABLE if no soldiers available
SOLIDER_EQUIP_MENU_BUTTON_OK if none of the above is true

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


Generated by  doxygen 1.6.2