UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_inventory_callbacks.cpp File Reference
#include "cl_inventory_callbacks.h"
#include "cl_shared.h"
#include "cl_inventory.h"
#include "ui/ui_main.h"
#include "ui/ui_nodes.h"
#include "cgame/cl_game.h"
#include "ui/ui_popup.h"
Include dependency graph for cl_inventory_callbacks.cpp:

Go to the source code of this file.

Functions

static const char * CL_WeaponSkillToName (int weaponSkill)
 Translate a weaponSkill integer to a translated string.
void INV_ItemDescription (const objDef_t *od)
 Prints the description for items (weapons, armour, ...).
static void INV_IncreaseFiremode_f (void)
 Increases the number of the firemode to display.
static void INV_DecreaseFiremode_f (void)
 Decreases the number of the firemode to display.
static void INV_IncreaseItem_f (void)
 Increases the number of the weapon to display (for ammo) or the ammo to display (for weapon).
static void INV_DecreaseItem_f (void)
 Decreases the number of the firemode to display (for ammo) or the ammo to display (for weapon).
static void INV_UpdateObject_f (void)
 Update the GUI with the selected item.
static void INV_UpdateActorLoad_f (void)
 Update the equipment weight for the selected actor.
void INV_InitCallbacks (void)

Variables

static const objDef_t * currentDisplayedObject
static int itemIndex
static int fireModeIndex

Function Documentation

◆ CL_WeaponSkillToName()

const char * CL_WeaponSkillToName ( int weaponSkill)
static

Translate a weaponSkill integer to a translated string.

Definition at line 40 of file cl_inventory_callbacks.cpp.

References _, CL_WeaponSkillToName(), SKILL_ASSAULT, SKILL_CLOSE, SKILL_EXPLOSIVE, SKILL_HEAVY, and SKILL_SNIPER.

Referenced by CL_WeaponSkillToName(), and INV_ItemDescription().

◆ INV_DecreaseFiremode_f()

void INV_DecreaseFiremode_f ( void )
static

Decreases the number of the firemode to display.

See also
UP_ItemDescription

Definition at line 244 of file cl_inventory_callbacks.cpp.

References currentDisplayedObject, fireModeIndex, INV_DecreaseFiremode_f(), and INV_ItemDescription().

Referenced by INV_DecreaseFiremode_f(), and INV_InitCallbacks().

◆ INV_DecreaseItem_f()

void INV_DecreaseItem_f ( void )
static

Decreases the number of the firemode to display (for ammo) or the ammo to display (for weapon).

See also
UP_ItemDescription

Definition at line 289 of file cl_inventory_callbacks.cpp.

References objDef_t::ammos, currentDisplayedObject, GAME_ItemIsUseable(), INV_DecreaseItem_f(), INV_ItemDescription(), itemIndex, objDef_t::numAmmos, objDef_t::numWeapons, and objDef_t::weapons.

Referenced by INV_DecreaseItem_f(), and INV_InitCallbacks().

◆ INV_IncreaseFiremode_f()

void INV_IncreaseFiremode_f ( void )
static

Increases the number of the firemode to display.

See also
UP_ItemDescription

Definition at line 230 of file cl_inventory_callbacks.cpp.

References currentDisplayedObject, fireModeIndex, INV_IncreaseFiremode_f(), and INV_ItemDescription().

Referenced by INV_IncreaseFiremode_f(), and INV_InitCallbacks().

◆ INV_IncreaseItem_f()

void INV_IncreaseItem_f ( void )
static

Increases the number of the weapon to display (for ammo) or the ammo to display (for weapon).

See also
UP_ItemDescription

Definition at line 258 of file cl_inventory_callbacks.cpp.

References objDef_t::ammos, currentDisplayedObject, GAME_ItemIsUseable(), INV_IncreaseItem_f(), INV_ItemDescription(), itemIndex, objDef_t::numAmmos, objDef_t::numWeapons, and objDef_t::weapons.

Referenced by INV_IncreaseItem_f(), and INV_InitCallbacks().

◆ INV_InitCallbacks()

◆ INV_ItemDescription()

void INV_ItemDescription ( const objDef_t * od)

Prints the description for items (weapons, armour, ...).

Parameters
[in]odThe object definition of the item
Note
Not only called from UFOpaedia but also from other places to display weapon and ammo statistics
Todo
Do we need to add checks for od->isDummy here somewhere?
Todo
is there ammo with no firedefs?

Definition at line 67 of file cl_inventory_callbacks.cpp.

References _, objDef_t::ammo, objDef_t::ammos, CL_WeaponSkillToName(), Com_sprintf(), count, csi, currentDisplayedObject, Cvar_ForceSet(), Cvar_Set(), fireDef_t::damage, csi_t::dts, itemEffect_t::duration, objDef_t::fd, fireModeIndex, objDef_t::fireTwoHanded, GAME_ItemIsUseable(), i, damageType_t::id, objDef_t::id, objDef_t::implant, INV_ItemDescription(), objDef_t::isAmmo(), objDef_t::isArmour(), itemEffect_t::isPermanent, itemIndex, fireDef_t::name, objDef_t::name, objDef_t::numAmmos, csi_t::numDTs, objDef_t::numFiredefs, objDef_t::numWeapons, itemEffect_t::period, objDef_t::price, Q_strcat(), fireDef_t::range, objDef_t::ratings, fireDef_t::shots, damageType_t::showInMenu, objDef_t::size, fireDef_t::spldmg, fireDef_t::spread, objDef_t::strengthenEffect, TEXT_ITEMDESCRIPTION, fireDef_t::time, UI_ExecuteConfunc(), UI_MAX_SMALLTEXTLEN, UI_RegisterText(), UI_ResetData(), UNIT_SIZE, objDef_t::weapon, objDef_t::weapons, fireDef_t::weaponSkill, objDef_t::weight, and WEIGHT_FACTOR.

Referenced by GAME_GetImportData(), INV_DecreaseFiremode_f(), INV_DecreaseItem_f(), INV_IncreaseFiremode_f(), INV_IncreaseItem_f(), INV_ItemDescription(), INV_UpdateObject_f(), and cgame_import_t::void().

◆ INV_UpdateActorLoad_f()

◆ INV_UpdateObject_f()

Variable Documentation

◆ currentDisplayedObject

const objDef_t* currentDisplayedObject
static

◆ fireModeIndex

int fireModeIndex
static

◆ itemIndex

int itemIndex
static