cp_fightequip_callbacks.c File Reference

Header file for menu callback functions used for base and aircraft equip menu. More...

#include "../cl_shared.h"
#include "../ui/ui_main.h"
#include "cp_campaign.h"
#include "cp_fightequip_callbacks.h"
#include "cp_mapfightequip.h"
#include "cp_ufo.h"
Include dependency graph for cp_fightequip_callbacks.c:

Go to the source code of this file.

Defines

#define AIM_LOADING_OK   0
#define AIM_LOADING_NOSLOTSELECTED   1
#define AIM_LOADING_NOTECHNOLOGYSELECTED   2
#define AIM_LOADING_ALIENTECH   3
#define AIM_LOADING_TECHNOLOGYNOTRESEARCHED   4
#define AIM_LOADING_TOOHEAVY   5
#define AIM_LOADING_UNKNOWNPROBLEM   6
#define AIM_LOADING_NOWEAPON   7
#define AIM_LOADING_NOTUSABLEWITHWEAPON   8

Functions

static void AIM_CheckAirequipID (void)
 Check airequipID value and set the correct values for aircraft items.
static void AIM_CheckAirequipSelectedSlot (const aircraft_t *aircraft)
 Check that airequipSelectedSlot is the indice of an existing slot in the aircraft.
aircraftSlot_tAII_SelectAircraftSlot (aircraft_t *aircraft, aircraftItemType_t type)
 Returns a pointer to the selected slot.
static void AIM_CheckAirequipSelectedZone (aircraftSlot_t *slot)
 Check that airequipSelectedZone is available.
static const char * AIM_AircraftItemtypeName (const int equiptype)
 Returns the userfriendly name for craftitem types (shown in aircraft equip menu).
static qboolean AIM_CrafttypeFilter (const base_t *base, aircraftItemType_t filterType, const technology_t *tech)
static void AIM_UpdateAircraftItemList (const aircraftSlot_t *slot)
 Update the list of item you can choose.
static void AIM_DrawAircraftSlots (const aircraft_t *aircraft)
 Draw only slots existing for this aircraft, and emphases selected one.
static void AIM_EmphazeAmmoSlotText (void)
 Write in red the text in zone ammo (zone 2).
static void AIM_NoEmphazeAmmoSlotText (void)
 Write in white the text in zone ammo (zone 2).
static void AIM_AircraftEquipMenuUpdate (void)
static int AIM_CheckTechnologyIntoSlot (const aircraftSlot_t *slot, const technology_t *tech)
static void AIM_UpdateItemDescription (qboolean fromList, qboolean fromSlot)
 Update the item description according to the tech and the slot selected.
static void AIM_AircraftEquipMenuUpdate_f (void)
 Fills the weapon and shield list of the aircraft equip menu.
static void AIM_AircraftEquipSlotSelect_f (void)
 Select the current slot you want to assign the item to.
static void AIM_AircraftEquipZoneSelect_f (void)
 Select the current zone you want to assign the item to.
static void AIM_AircraftEquipAddItem_f (void)
 Add selected item to current zone.
static void AIM_AircraftEquipRemoveItem_f (void)
 Delete an object from a zone.
static void AIM_AircraftEquipMenuClick_f (void)
 Set AIM_selectedTechnology to the technology of current selected aircraft item.
static void AIM_AircraftItemtypeByName_f (void)
 Update the GUI with a named itemtype.
void AIM_InitCallbacks (void)
void AIM_ShutdownCallbacks (void)

Variables

static int airequipID = -1
static int airequipSelectedZone = ZONE_NONE
static int airequipSelectedSlot = ZONE_NONE
static technology_taimSelectedTechnology = NULL

Detailed Description

Header file for menu callback functions used for base and aircraft equip menu.

Definition in file cp_fightequip_callbacks.c.


Define Documentation

#define AIM_LOADING_ALIENTECH   3
#define AIM_LOADING_NOSLOTSELECTED   1
#define AIM_LOADING_NOTECHNOLOGYSELECTED   2
#define AIM_LOADING_NOTUSABLEWITHWEAPON   8
#define AIM_LOADING_NOWEAPON   7
#define AIM_LOADING_OK   0
#define AIM_LOADING_TECHNOLOGYNOTRESEARCHED   4
#define AIM_LOADING_TOOHEAVY   5
#define AIM_LOADING_UNKNOWNPROBLEM   6

Function Documentation

aircraftSlot_t* AII_SelectAircraftSlot ( aircraft_t aircraft,
aircraftItemType_t  type 
)

Returns a pointer to the selected slot.

Parameters:
[in] aircraft Pointer to the aircraft
[in] airequipID value of aircraftItemType_t that defines what item we are installing
Note:
also used by BDEF_ functions
Returns:
Pointer to the slot corresponding to airequipID

Definition at line 85 of file cp_fightequip_callbacks.c.

References AC_ITEM_AMMO, AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, AIM_CheckAirequipSelectedSlot(), airequipSelectedSlot, Com_Printf(), aircraft_s::electronics, aircraft_s::shield, and aircraft_s::weapons.

Referenced by AIM_AircraftEquipAddItem_f(), AIM_AircraftEquipMenuUpdate(), AIM_AircraftEquipRemoveItem_f(), AIM_AircraftEquipZoneSelect_f(), and AIM_UpdateItemDescription().

static void AIM_AircraftEquipAddItem_f ( void   )  [static]
static void AIM_AircraftEquipMenuClick_f ( void   )  [static]

Set AIM_selectedTechnology to the technology of current selected aircraft item.

See also:
AIM_AircraftEquipMenuUpdate_f

Definition at line 880 of file cp_fightequip_callbacks.c.

References AIM_UpdateItemDescription(), ccs, Cmd_Argc(), Cmd_Argv(), Com_Printf(), qfalse, qtrue, and ccs_s::technologies.

Referenced by AIM_InitCallbacks().

static void AIM_AircraftEquipMenuUpdate ( void   )  [static]
static void AIM_AircraftEquipMenuUpdate_f ( void   )  [static]
static void AIM_AircraftEquipRemoveItem_f ( void   )  [static]
static void AIM_AircraftEquipSlotSelect_f ( void   )  [static]
static void AIM_AircraftEquipZoneSelect_f ( void   )  [static]
static void AIM_AircraftItemtypeByName_f ( void   )  [static]

Update the GUI with a named itemtype.

Definition at line 899 of file cp_fightequip_callbacks.c.

References AC_ITEM_AMMO, AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, airequipID, Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), Com_Printf(), i, name, and va().

Referenced by AIM_InitCallbacks().

static const char* AIM_AircraftItemtypeName ( const int  equiptype  )  [inline, static]

Returns the userfriendly name for craftitem types (shown in aircraft equip menu).

Definition at line 131 of file cp_fightequip_callbacks.c.

References _, AC_ITEM_AMMO, AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, and AC_ITEM_WEAPON.

Referenced by AIM_AircraftEquipMenuUpdate().

static void AIM_CheckAirequipID ( void   )  [static]

Check airequipID value and set the correct values for aircraft items.

Definition at line 41 of file cp_fightequip_callbacks.c.

References AC_ITEM_AMMO, AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, and airequipID.

Referenced by AIM_AircraftEquipMenuUpdate_f().

static void AIM_CheckAirequipSelectedSlot ( const aircraft_t aircraft  )  [static]

Check that airequipSelectedSlot is the indice of an existing slot in the aircraft.

Note:
airequipSelectedSlot concerns only weapons and electronics
See also:
aircraft Pointer to the aircraft

Definition at line 59 of file cp_fightequip_callbacks.c.

References AC_ITEM_AMMO, AC_ITEM_ELECTRONICS, AC_ITEM_WEAPON, airequipID, airequipSelectedSlot, aircraft_s::maxElectronics, and aircraft_s::maxWeapons.

Referenced by AII_SelectAircraftSlot(), and AIM_AircraftEquipMenuUpdate().

static void AIM_CheckAirequipSelectedZone ( aircraftSlot_t slot  )  [static]

Check that airequipSelectedZone is available.

See also:
slot Pointer to the slot

Definition at line 113 of file cp_fightequip_callbacks.c.

References AC_ITEM_AMMO, AC_ITEM_WEAPON, airequipID, airequipSelectedZone, aircraftSlot_s::item, ZONE_AMMO, and ZONE_MAIN.

Referenced by AIM_AircraftEquipMenuUpdate(), and AIM_AircraftEquipZoneSelect_f().

static int AIM_CheckTechnologyIntoSlot ( const aircraftSlot_t slot,
const technology_t tech 
) [static]
static qboolean AIM_CrafttypeFilter ( const base_t base,
aircraftItemType_t  filterType,
const technology_t tech 
) [static]
static void AIM_DrawAircraftSlots ( const aircraft_t aircraft  )  [static]
static void AIM_EmphazeAmmoSlotText ( void   )  [inline, static]

Write in red the text in zone ammo (zone 2).

See also:
AIM_NoEmphazeAmmoSlotText
Note:
This is intended to show the player that there is no ammo in his aircraft

Definition at line 288 of file cp_fightequip_callbacks.c.

References UI_ExecuteConfunc().

Referenced by AIM_AircraftEquipMenuUpdate().

void AIM_InitCallbacks ( void   ) 
static void AIM_NoEmphazeAmmoSlotText ( void   )  [inline, static]

Write in white the text in zone ammo (zone 2).

See also:
AIM_EmphazeAmmoSlotText
Note:
This is intended to revert effects of AIM_EmphazeAmmoSlotText

Definition at line 298 of file cp_fightequip_callbacks.c.

References UI_ExecuteConfunc().

Referenced by AIM_AircraftEquipMenuUpdate().

void AIM_ShutdownCallbacks ( void   ) 

Definition at line 939 of file cp_fightequip_callbacks.c.

References Cmd_RemoveCommand().

Referenced by CP_RemoveCampaignCallbackCommands().

static void AIM_UpdateAircraftItemList ( const aircraftSlot_t slot  )  [static]
static void AIM_UpdateItemDescription ( qboolean  fromList,
qboolean  fromSlot 
) [static]

Variable Documentation

Selected technology in equip menu

Definition at line 36 of file cp_fightequip_callbacks.c.

int airequipID = -1 [static]
int airequipSelectedSlot = ZONE_NONE [static]
int airequipSelectedZone = ZONE_NONE [static]

Selected zone in equip menu

Definition at line 34 of file cp_fightequip_callbacks.c.

Referenced by AIM_AircraftEquipAddItem_f(), AIM_AircraftEquipZoneSelect_f(), and AIM_CheckAirequipSelectedZone().


Generated by  doxygen 1.6.2