42 switch (weaponSkill) {
44 return _(
"Close quarters");
54 return _(
"Explosives");
56 return _(
"Unknown weapon skill");
71 currentDisplayedObject = od;
72 Cvar_Set(
"mn_firemodename",
"%s",
"");
139 Q_strcat(itemText,
sizeof(itemText),
"\n");
140 Q_strcat(itemText,
sizeof(itemText),
_(
"^BDamage type:\tProtection:\n"));
155 Q_strcat(itemText,
sizeof(itemText),
_(
"Max ammo:\t%i\n"), od->
ammo);
158 for (weaponIndex = 0; (weaponIndex < odAmmo->
numWeapons) && (odAmmo->
weapons[weaponIndex] != od); weaponIndex++) {}
184 Q_strcat(itemText,
sizeof(itemText),
_(
"Time units:\t%i\n"), fd->
time);
189 Com_sprintf(itemText,
sizeof(itemText),
_(
"%s. No detailed info available.\n"), od->
isAmmo() ?
_(
"Ammunition") :
_(
"Weapon"));
196 if (effect !=
nullptr) {
199 Q_strcat(itemText,
sizeof(itemText),
_(
"Period:\t%i\n"), effect->
period);
201 Q_strcat(itemText,
sizeof(itemText),
_(
"Price:\t%i c\n"), od->
price);
211 Q_strcat(itemText,
sizeof(itemText),
_(
"Action:\t%s\n"),
_(fd->
name));
212 Q_strcat(itemText,
sizeof(itemText),
_(
"Time units:\t%i\n"), fd->
time);
220 Com_sprintf(itemText,
sizeof(itemText),
_(
"Unknown - not useable"));
232 if (!currentDisplayedObject)
246 if (!currentDisplayedObject)
327 bool changeTab =
true;
342 if (var && var->
integer != filter) {
371 const int tuPenalty = tus - normalTU;
378 for (
Item* invList = cont->
_invList, *next; invList; invList = next) {
379 next = invList->getNext();
380 const fireDef_t* fireDef = invList->getFiredefs();
381 if (fireDef ==
nullptr)
384 if (fireDef[
i].time <= 0)
386 if (fireDef[
i].time <= tus)
402 (count > 0 ?
_(
"Warning!") :
""));
403 Com_sprintf(tooltip,
sizeof(tooltip),
"%s %i (%+i)",
_(
"TU:"), tus, tuPenalty);
const char * Cmd_Argv(int arg)
Returns a given argument.
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
#define WEIGHT_NORMAL_PENALTY
static const objDef_t * currentDisplayedObject
this is a fire definition for our weapons/ammo
void UI_RegisterText(int dataId, const char *text)
share a text with a data id
static void INV_DecreaseItem_f(void)
Decreases the number of the firemode to display (for ammo) or the ammo to display (for weapon) ...
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
Shared game type headers.
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
void Com_Printf(const char *const fmt,...)
Header file for inventory handling and Equipment menu.
static const char * CL_WeaponSkillToName(int weaponSkill)
Translate a weaponSkill integer to a translated string.
const struct objDef_s * ammos[MAX_AMMOS_PER_OBJDEF]
Defines all attributes of objects used in the inventory.
int GAME_GetChrMaxLoad(const character_t *chr)
Returns the max weight the given character can carry.
Share stuff between the different cgame implementations.
item instance data, with linked list capability
void UI_ResetData(int dataId)
Reset a shared data. Type became NONE and value became nullptr.
fireDefIndex_t numFiredefs[MAX_WEAPONS_PER_OBJDEF]
int getWeight() const
Get the weight of the items in the given inventory (excluding those in temp containers).
static void INV_DecreaseFiremode_f(void)
Decreases the number of the firemode to display.
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
void INV_ItemDescription(const objDef_t *od)
Prints the description for items (weapons, armour, ...)
#define MAX_FIREDEFS_PER_WEAPON
damageType_t dts[MAX_DAMAGETYPES]
short ratings[MAX_DAMAGETYPES]
const invDef_t * def() const
character_t * GAME_GetSelectedChr(void)
Returns the currently selected character.
static void INV_IncreaseFiremode_f(void)
Increases the number of the firemode to display.
#define GET_ENCUMBRANCE_PENALTY(weight, max)
itemEffect_t * strengthenEffect
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
static void INV_IncreaseItem_f(void)
Increases the number of the weapon to display (for ammo) or the ammo to display (for weapon) ...
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
cvar_t * Cvar_ForceSet(const char *varName, const char *value)
Will set the variable even if NOSET or LATCH.
cvar_t * Cvar_Set(const char *varName, const char *value,...)
Sets a cvar value.
itemFilterTypes_t INV_GetFilterFromItem(const objDef_t *obj)
void INV_InitCallbacks(void)
bool GAME_ItemIsUseable(const objDef_t *od)
static void INV_UpdateActorLoad_f(void)
Update the equipment weight for the selected actor.
void Cvar_SetValue(const char *varName, float value)
Expands value to a string and calls Cvar_Set.
cvar_t * Cvar_FindVar(const char *varName)
Searches for a cvar given by parameter.
int skills[SKILL_NUM_TYPES]
static void INV_UpdateObject_f(void)
Update the GUI with the selected item.
const struct objDef_s * weapons[MAX_WEAPONS_PER_OBJDEF]
void UI_ExecuteConfunc(const char *fmt,...)
Executes confunc - just to identify those confuncs in the code - in this frame.
Describes a character with all its attributes.