HUD related routines. More...
#include "../client.h"
#include "cl_localentity.h"
#include "cl_actor.h"
#include "cl_hud.h"
#include "cl_hud_callbacks.h"
#include "cl_view.h"
#include "../cl_team.h"
#include "../cl_game.h"
#include "../ui/ui_main.h"
#include "../ui/ui_popup.h"
#include "../ui/ui_nodes.h"
#include "../ui/ui_draw.h"
#include "../ui/ui_render.h"
#include "../renderer/r_mesh_anim.h"
#include "../renderer/r_draw.h"
#include "../../common/grid.h"
Go to the source code of this file.
Data Structures | |
struct | reserveShot_s |
Typedefs | |
typedef struct reserveShot_s | reserveShot_t |
Enumerations | |
enum | { REMAINING_TU_RELOAD_RIGHT, REMAINING_TU_RELOAD_LEFT, REMAINING_TU_CROUCH, REMAINING_TU_MAX } |
enum | buttonTypes_t { BT_RIGHT_FIRE, BT_REACTION, BT_LEFT_FIRE, BT_RIGHT_RELOAD, BT_LEFT_RELOAD, BT_STAND, BT_CROUCH, BT_HEADGEAR, BT_NUM_TYPES } |
enum | weaponButtonState_t { BT_STATE_DISABLE, BT_STATE_DESELECT } |
Defines the various states of a button. More... | |
Functions | |
CASSERT (lengthof(shootTypeStrings)==BT_NUM_TYPES) | |
CASSERT (lengthof(moveModeDescriptions)==WALKTYPE_MAX) | |
void | HUD_DisplayMessage (const char *text) |
Displays a message on the hud. | |
static void | HUD_UpdateAllActors (void) |
Updates the global character cvars for battlescape. | |
static void | HUD_SetWeaponButton (buttonTypes_t button, weaponButtonState_t state) |
Sets the display for a single weapon/reload HUD button. | |
void | HUD_HideFiremodes (void) |
Makes all entries of the firemode lists invisible. | |
static int | HUD_UsableReactionTUs (const le_t *le) |
Returns the amount of usable "reaction fire" TUs for this actor (depends on active/inactive RF). | |
static qboolean | HUD_CheckFiremodeReservation (void) |
Check if at least one firemode is available for reservation. | |
static void | HUD_SetShootReservation (const le_t *le, const int tus, const actorHands_t hand, const int fireModeIndex, const objDef_t *weapon) |
Sets TU-reservation and firemode. | |
static void | HUD_PopupFiremodeReservation (qboolean reset, qboolean popupReload) |
Creates a (text) list of all firemodes of the currently selected actor. | |
static void | HUD_PopupFiremodeReservation_f (void) |
Creates a (text) list of all firemodes of the currently selected actor. | |
static void | HUD_ShotReserve_f (void) |
Get selected firemode in the list of the currently selected actor. | |
static void | HUD_DisplayFiremodeEntry (const le_t *actor, const objDef_t *ammo, const weaponFireDefIndex_t weapFdsIdx, const actorHands_t hand, int index) |
Sets the display for a single weapon/reload HUD button. | |
void | HUD_DisplayFiremodes (const le_t *actor, actorHands_t hand, qboolean firemodesChangeDisplay) |
static void | HUD_DisplayFiremodes_f (void) |
Displays the firemodes for the given hand. | |
static void | HUD_SwitchFiremodeList_f (void) |
Changes the display of the firemode-list to a given hand, but only if the list is visible already. | |
static void | HUD_UpdateReactionFiremodes (const le_t *actor, const actorHands_t hand, fireDefIndex_t firemodeActive) |
Updates the information in RFmode for the selected actor with the given data from the parameters. | |
static void | HUD_SelectReactionFiremode_f (void) |
Checks if the selected firemode checkbox is ok as a reaction firemode and updates data+display. | |
static void | HUD_RemainingTUs_f (void) |
Remember if we hover over a button that would cost some TUs when pressed. | |
static int | HUD_GetMinimumTUsForUsage (const invList_t *invList) |
static int | HUD_WeaponCanBeReloaded (const le_t *le, containerIndex_t containerID, const char **reason) |
Checks every case for reload buttons on the HUD. | |
static qboolean | HUD_WeaponWithReaction (const le_t *actor) |
Checks if there is a weapon in the hand that can be used for reaction fire. | |
static qboolean | HUD_DisplayImpossibleReaction (const le_t *actor) |
Display 'impossible" (red) reaction buttons. | |
static void | HUD_DisplayPossibleReaction (const le_t *actor) |
Display 'usable" (blue) reaction buttons. | |
static void | HUD_RefreshButtons (const le_t *le) |
Refreshes the weapon/reload buttons on the HUD. | |
static void | HUD_DrawMouseCursorText (int xOffset, int yOffset, int textId) |
Draw the mouse cursor tooltips in battlescape. | |
void | HUD_UpdateCursor (void) |
Updates the cursor texts when in battlescape. | |
static void | HUD_MapDebugCursor (const le_t *le) |
Shows map pathfinding debugging parameters (if activated). | |
static int | HUD_UpdateActorFireMode (le_t *actor) |
static int | HUD_UpdateActorMove (const le_t *actor) |
static void | HUD_UpdateActorCvar (le_t *actor, const char *cvarPrefix) |
static void | HUD_ActorGetCvarData_f (void) |
Update cvars according to a soldier from a list while we are on battlescape. | |
static void | HUD_UpdateActor (le_t *actor) |
Updates the hud for one actor. | |
void | HUD_Update (void) |
Updates console vars for an actor. | |
static void | HUD_ActorSelectionChangeListener (const char *cvarName, const char *oldValue, const char *newValue) |
Callback that is called when the cl_selected cvar was changed. | |
static void | HUD_RightHandChangeListener (const char *cvarName, const char *oldValue, const char *newValue) |
Callback that is called when the right hand weapon of the current selected actor changed. | |
static void | HUD_LeftHandChangeListener (const char *cvarName, const char *oldValue, const char *newValue) |
Callback that is called when the left hand weapon of the current selected actor changed. | |
static void | HUD_TUChangeListener (const char *cvarName, const char *oldValue, const char *newValue) |
Callback that is called when the remaining TUs for the current selected actor changed. | |
static qboolean | CL_CvarWorldLevel (cvar_t *cvar) |
void | HUD_InitStartup (void) |
Variables | |
static qboolean | visibleFiremodeListLeft = qfalse |
static qboolean | visibleFiremodeListRight = qfalse |
static cvar_t * | cl_hud_message_timeout |
static cvar_t * | cl_show_cursor_tooltips |
cvar_t * | cl_worldlevel |
static qboolean | displayRemainingTus [REMAINING_TU_MAX] |
static const char * | shootTypeStrings [] |
a cbuf string for each button_types_t | |
static const char * | moveModeDescriptions [] |
static int | hudTime |
static char | hudText [256] |
static linkedList_t * | popupListData |
static uiNode_t * | popupListNode |
HUD related routines.
Definition in file cl_hud.c.
typedef struct reserveShot_s reserveShot_t |
anonymous enum |
enum buttonTypes_t |
enum weaponButtonState_t |
CASSERT | ( | lengthof(moveModeDescriptions) | = =WALKTYPE_MAX |
) |
CASSERT | ( | lengthof(shootTypeStrings) | = =BT_NUM_TYPES |
) |
Definition at line 1433 of file cl_hud.c.
References cl, Cvar_AssertValue(), PATHFINDING_HEIGHT, and qtrue.
Referenced by HUD_InitStartup().
static void HUD_ActorGetCvarData_f | ( | void | ) | [static] |
Update cvars according to a soldier from a list while we are on battlescape.
Definition at line 1220 of file cl_hud.c.
References cl, CL_ActorGetChr(), CL_BattlescapeRunning(), CL_UpdateCharacterValues(), Cmd_Argc(), Cmd_Argv(), Com_Error(), Com_Printf(), ERR_DROP, and HUD_UpdateActorCvar().
Referenced by HUD_InitStartup().
static void HUD_ActorSelectionChangeListener | ( | const char * | cvarName, | |
const char * | oldValue, | |||
const char * | newValue | |||
) | [static] |
Callback that is called when the cl_selected cvar was changed.
cvarName | The cvar name (cl_selected) | |
oldValue | The old value of the cvar (a sane actor idx) | |
newValue | The new value of the cvar (a sane actor idx) |
Definition at line 1378 of file cl_hud.c.
References cl, CL_OnBattlescape(), lengthof, and UI_ExecuteConfunc().
Referenced by HUD_InitStartup().
static qboolean HUD_CheckFiremodeReservation | ( | void | ) | [static] |
Check if at least one firemode is available for reservation.
Definition at line 215 of file cl_hud.c.
References ACTOR_HAND_LEFT, ACTOR_HAND_RIGHT, CL_ActorReservedTUs(), CL_ActorUsableTUs(), objDef_s::fd, HUD_GetFireDefinitionForHand(), i, objDef_s::numFiredefs, fireDef_s::obj, qfalse, qtrue, RES_SHOT, selActor, fireDef_s::time, and fireDef_s::weapFdsIdx.
Referenced by HUD_RefreshButtons().
static void HUD_DisplayFiremodeEntry | ( | const le_t * | actor, | |
const objDef_t * | ammo, | |||
const weaponFireDefIndex_t | weapFdsIdx, | |||
const actorHands_t | hand, | |||
int | index | |||
) | [static] |
Sets the display for a single weapon/reload HUD button.
[in] | hand | What list to display |
Definition at line 418 of file cl_hud.c.
References _, ACTOR_GET_HAND_CHAR, ACTOR_HAND_LEFT, ACTOR_HAND_RIGHT, fireDef_s::ammo, CL_ActorGetChr(), CL_ActorUsableTUs(), Com_sprintf(), objDef_s::fd, fireDef_s::fdIdx, HUD_UsableReactionTUs(), MAX_VAR, fireDef_s::name, fireDef_s::reaction, character_s::RFmode, THIS_FIREMODE, fireDef_s::time, UI_ExecuteConfunc(), and va().
Referenced by HUD_DisplayFiremodes().
void HUD_DisplayFiremodes | ( | const le_t * | actor, | |
actorHands_t | hand, | |||
qboolean | firemodesChangeDisplay | |||
) |
< Not our turn
Definition at line 463 of file cl_hud.c.
References ACTOR_HAND_RIGHT, cl, CL_ActorGetChr(), cls, Com_DPrintf(), DEBUG_CLIENT, HUD_DisplayFiremodeEntry(), HUD_GetFireDefinitionForHand(), HUD_HideFiremodes(), i, MAX_FIREDEFS_PER_WEAPON, fireDef_s::obj, qtrue, client_static_s::team, visibleFiremodeListLeft, visibleFiremodeListRight, and fireDef_s::weapFdsIdx.
Referenced by CL_ActorReactionFireChange(), HUD_DisplayFiremodes_f(), and HUD_SwitchFiremodeList_f().
static void HUD_DisplayFiremodes_f | ( | void | ) | [static] |
Displays the firemodes for the given hand.
Definition at line 510 of file cl_hud.c.
References ACTOR_GET_HAND_INDEX, ACTOR_HAND_RIGHT, Cmd_Argc(), Cmd_Argv(), HUD_DisplayFiremodes(), qtrue, and selActor.
Referenced by HUD_InitStartup().
Display 'impossible" (red) reaction buttons.
[in] | actor | the actor to check for his reaction state. |
Definition at line 718 of file cl_hud.c.
References qfalse, qtrue, le_s::selected, le_s::state, STATE_REACTION_MANY, STATE_REACTION_ONCE, and UI_ExecuteConfunc().
Referenced by HUD_RefreshButtons().
void HUD_DisplayMessage | ( | const char * | text | ) |
Displays a message on the hud.
[in] | text | text is already translated here |
Definition at line 119 of file cl_hud.c.
References cvar_s::integer, mn_hud, cvar_s::string, and UI_DisplayNotice().
Referenced by CL_ActorAppear(), CL_ActorCheckAction(), CL_ActorDie(), CL_ActorReload(), CL_ActorRevitalised(), CL_DoEndRound(), CL_ParseServerMessage(), GAME_MP_EndRoundAnnounce(), HUD_CheckReload(), HUD_CheckShooting(), HUD_FireWeapon_f(), and HUD_UpdateActorFireMode().
static void HUD_DisplayPossibleReaction | ( | const le_t * | actor | ) | [static] |
Display 'usable" (blue) reaction buttons.
[in] | actor | the actor to check for his reaction state. |
Definition at line 742 of file cl_hud.c.
References le_s::selected, le_s::state, STATE_REACTION_MANY, STATE_REACTION_ONCE, and UI_ExecuteConfunc().
Referenced by HUD_RefreshButtons().
static void HUD_DrawMouseCursorText | ( | int | xOffset, | |
int | yOffset, | |||
int | textId | |||
) | [static] |
Draw the mouse cursor tooltips in battlescape.
xOffset | ||
yOffset | ||
textId | The text id to get the tooltip string from. |
Definition at line 910 of file cl_hud.c.
References ALIGN_UL, cvar_s::integer, LONGLINES_WRAP, mousePosX, mousePosY, qfalse, R_FontTextSize(), UI_DrawString(), UI_GetText(), viddef, and viddef_t::virtualWidth.
Referenced by HUD_UpdateCursor().
static int HUD_GetMinimumTUsForUsage | ( | const invList_t * | invList | ) | [static] |
invList
Definition at line 626 of file cl_hud.c.
References FIRESH_FiredefForWeapon(), i, invList_s::item, MAX_FIREDEFS_PER_WEAPON, item_s::t, and fireDef_s::time.
Referenced by HUD_RefreshButtons().
void HUD_HideFiremodes | ( | void | ) |
Makes all entries of the firemode lists invisible.
Definition at line 184 of file cl_hud.c.
References qfalse, UI_ExecuteConfunc(), visibleFiremodeListLeft, and visibleFiremodeListRight.
Referenced by CL_ActorSelect(), HUD_DisplayFiremodes(), and HUD_FireWeapon_f().
void HUD_InitStartup | ( | void | ) |
Definition at line 1439 of file cl_hud.c.
References _, CL_CvarWorldLevel(), Cmd_AddCommand(), CVAR_ARCHIVE, Cvar_Get(), Cvar_RegisterChangeListener(), Cvar_SetCheckFunction(), HUD_ActorGetCvarData_f(), HUD_ActorSelectionChangeListener(), HUD_DisplayFiremodes_f(), HUD_InitCallbacks(), HUD_LeftHandChangeListener(), HUD_PopupFiremodeReservation_f(), HUD_RemainingTUs_f(), HUD_RightHandChangeListener(), HUD_SelectReactionFiremode_f(), HUD_ShotReserve_f(), HUD_SwitchFiremodeList_f(), HUD_TUChangeListener(), cvar_s::modified, and qfalse.
Referenced by CL_InitLocal().
static void HUD_LeftHandChangeListener | ( | const char * | cvarName, | |
const char * | oldValue, | |||
const char * | newValue | |||
) | [static] |
Callback that is called when the left hand weapon of the current selected actor changed.
cvarName | The cvar name | |
oldValue | The old value of the cvar | |
newValue | The new value of the cvar |
Definition at line 1411 of file cl_hud.c.
References CL_OnBattlescape(), HUD_RefreshButtons(), and selActor.
Referenced by HUD_InitStartup().
static void HUD_MapDebugCursor | ( | const le_t * | le | ) | [static] |
Shows map pathfinding debugging parameters (if activated).
[in] | le | The current selected actors entity |
Definition at line 1010 of file cl_hud.c.
References ACTOR_GET_FIELDSIZE, cl, cl_map_debug, Com_sprintf(), getDVdir, getDVz, Grid_Ceiling(), Grid_Floor(), Grid_MoveNext(), cvar_s::integer, lengthof, MAPDEBUG_TEXT, mousePos, le_s::pathMap, TEXT_MOUSECURSOR_BOTTOM, TEXT_MOUSECURSOR_LEFT, TEXT_MOUSECURSOR_TOP, truePos, UI_MAX_SMALLTEXTLEN, and UI_RegisterText().
Referenced by HUD_UpdateActor().
Creates a (text) list of all firemodes of the currently selected actor.
[in] | popupReload | Prevent firemode reservation popup from being closed if no firemode is available because of insufficient TUs. |
Definition at line 277 of file cl_hud.c.
References _, ACTOR_HAND_LEFT, ACTOR_HAND_NOT_SET, ACTOR_HAND_RIGHT, byte, CL_ActorGetChr(), CL_ActorReservedTUs(), CL_ActorUsableTUs(), Com_sprintf(), objDef_s::fd, reserveShot_s::fireModeIndex, chrFiremodeSettings_s::fmIdx, chrFiremodeSettings_s::hand, reserveShot_s::hand, HUD_GetFireDefinitionForHand(), HUD_SetShootReservation(), i, objDef_s::idx, lengthof, LIST_Add(), LIST_AddPointer(), LIST_AddString(), LIST_Count(), LIST_Delete(), MAX_VAR, fireDef_s::name, NONE, objDef_s::numFiredefs, fireDef_s::obj, qtrue, RES_SHOT, character_s::reservedTus, selActor, uiNode_s::selectedColor, chrReservations_s::shotSettings, TEXT_LIST, fireDef_s::time, reserveShot_s::TUs, UI_PopupList(), UI_ResetData(), UI_TextNodeSelectLine(), VectorSet, fireDef_s::weapFdsIdx, chrFiremodeSettings_s::weapon, reserveShot_s::weaponIndex, and objDef_s::weapons.
Referenced by HUD_PopupFiremodeReservation_f(), and HUD_RefreshButtons().
static void HUD_PopupFiremodeReservation_f | ( | void | ) | [static] |
Creates a (text) list of all firemodes of the currently selected actor.
Definition at line 364 of file cl_hud.c.
References Cmd_Argc(), HUD_PopupFiremodeReservation(), and qfalse.
Referenced by HUD_InitStartup().
static void HUD_RefreshButtons | ( | const le_t * | le | ) | [static] |
Refreshes the weapon/reload buttons on the HUD.
[in] | le | Pointer to local entity for which we refresh HUD buttons. |
Definition at line 762 of file cl_hud.c.
References _, BT_CROUCH, BT_HEADGEAR, BT_LEFT_FIRE, BT_LEFT_RELOAD, BT_REACTION, BT_RIGHT_FIRE, BT_RIGHT_RELOAD, BT_STAND, BT_STATE_DESELECT, BT_STATE_DISABLE, CL_ActorReservedTUs(), CL_ActorUsableTUs(), csi, Cvar_Set(), HEADGEAR, objDef_s::holdTwoHanded, HUD_CheckFiremodeReservation(), HUD_DisplayImpossibleReaction(), HUD_DisplayPossibleReaction(), HUD_GetMinimumTUsForUsage(), HUD_PopupFiremodeReservation(), HUD_SetWeaponButton(), HUD_WeaponCanBeReloaded(), HUD_WeaponWithReaction(), csi_s::idLeft, csi_s::idRight, invList_s::item, LE_IsCrouched, LEFT, POPUPLIST_NODE_NAME, qfalse, qtrue, RES_CROUCH, RES_REACTION, RES_SHOT, RIGHT, le_s::state, STATE_REACTION, item_s::t, TU_CROUCH, UI_ExecuteConfunc(), UI_GetActiveWindowName(), and va().
Referenced by HUD_LeftHandChangeListener(), HUD_RightHandChangeListener(), and HUD_TUChangeListener().
static void HUD_RemainingTUs_f | ( | void | ) | [static] |
Remember if we hover over a button that would cost some TUs when pressed.
Definition at line 599 of file cl_hud.c.
References Cmd_Argc(), Cmd_Argv(), Com_ParseBoolean(), Com_Printf(), displayRemainingTus, REMAINING_TU_CROUCH, REMAINING_TU_RELOAD_LEFT, REMAINING_TU_RELOAD_RIGHT, and type.
Referenced by HUD_InitStartup().
static void HUD_RightHandChangeListener | ( | const char * | cvarName, | |
const char * | oldValue, | |||
const char * | newValue | |||
) | [static] |
Callback that is called when the right hand weapon of the current selected actor changed.
cvarName | The cvar name | |
oldValue | The old value of the cvar | |
newValue | The new value of the cvar |
Definition at line 1397 of file cl_hud.c.
References CL_OnBattlescape(), HUD_RefreshButtons(), and selActor.
Referenced by HUD_InitStartup().
static void HUD_SelectReactionFiremode_f | ( | void | ) | [static] |
Checks if the selected firemode checkbox is ok as a reaction firemode and updates data+display.
Definition at line 571 of file cl_hud.c.
References ACTOR_GET_HAND_INDEX, Cmd_Argc(), Cmd_Argv(), Com_Printf(), HUD_UpdateReactionFiremodes(), MAX_FIREDEFS_PER_WEAPON, and selActor.
Referenced by HUD_InitStartup().
static void HUD_SetShootReservation | ( | const le_t * | le, | |
const int | tus, | |||
const actorHands_t | hand, | |||
const int | fireModeIndex, | |||
const objDef_t * | weapon | |||
) | [static] |
Sets TU-reservation and firemode.
[in] | le | The local entity of the actor to change the tu reservation for. |
[in] | tus | How many TUs to set. |
[in] | hand | Store the given hand. |
[in] | fireModeIndex | Store the given firemode for this hand. |
[in] | weapon | Pointer to weapon in the hand. |
Definition at line 257 of file cl_hud.c.
References CL_ActorGetChr(), CL_ActorReserveTUs(), CL_ActorSetShotSettings(), and RES_SHOT.
Referenced by HUD_PopupFiremodeReservation(), and HUD_ShotReserve_f().
static void HUD_SetWeaponButton | ( | buttonTypes_t | button, | |
weaponButtonState_t | state | |||
) | [static] |
Sets the display for a single weapon/reload HUD button.
Definition at line 161 of file cl_hud.c.
References BT_STATE_DESELECT, BT_STATE_DISABLE, shootTypeStrings, and UI_ExecuteConfunc().
Referenced by HUD_RefreshButtons().
static void HUD_ShotReserve_f | ( | void | ) | [static] |
Get selected firemode in the list of the currently selected actor.
Definition at line 375 of file cl_hud.c.
References ACTOR_HAND_NOT_SET, CL_ActorReservedTUs(), CL_ActorUsableTUs(), Cmd_Argc(), Cmd_Argv(), Com_Printf(), reserveShot_s::fireModeIndex, GAME_ItemIsUseable(), reserveShot_s::hand, HUD_SetShootReservation(), INVSH_GetItemByIDX(), LIST_Count(), LIST_GetByIdx(), NONE, RES_SHOT, selActor, reserveShot_s::TUs, UI_TextNodeSelectLine(), and reserveShot_s::weaponIndex.
Referenced by HUD_InitStartup().
static void HUD_SwitchFiremodeList_f | ( | void | ) | [static] |
Changes the display of the firemode-list to a given hand, but only if the list is visible already.
Definition at line 530 of file cl_hud.c.
References ACTOR_GET_HAND_INDEX, Cmd_Argc(), Cmd_Argv(), Com_Printf(), HUD_DisplayFiremodes(), qfalse, selActor, visibleFiremodeListLeft, and visibleFiremodeListRight.
Referenced by HUD_InitStartup().
static void HUD_TUChangeListener | ( | const char * | cvarName, | |
const char * | oldValue, | |||
const char * | newValue | |||
) | [static] |
Callback that is called when the remaining TUs for the current selected actor changed.
cvarName | The cvar name | |
oldValue | The old value of the cvar | |
newValue | The new value of the cvar |
Definition at line 1425 of file cl_hud.c.
References CL_OnBattlescape(), HUD_RefreshButtons(), and selActor.
Referenced by HUD_InitStartup().
void HUD_Update | ( | void | ) |
Updates console vars for an actor.
This function updates the cvars for the hud (battlefield) unlike CL_ActorCvars and CL_UGVCvars which updates them for displaying the data in the menu system
Definition at line 1326 of file cl_hud.c.
References ca_active, cl, cls, Cvar_Set(), Cvar_SetValue(), HUD_UpdateActor(), HUD_UpdateAllActors(), i, cvar_s::integer, cvar_s::modified, PATHFINDING_HEIGHT, qfalse, selActor, client_static_s::state, TEXT_STANDARD, UI_ExecuteConfunc(), and UI_RegisterText().
Referenced by CL_SlowFrame().
static void HUD_UpdateActor | ( | le_t * | actor | ) | [static] |
Updates the hud for one actor.
actor | The actor to update the hud values for |
Definition at line 1262 of file cl_hud.c.
References _, le_s::actorMode, le_s::actorMoveLength, CL_ActorFireModeActivated(), CL_ActorUsableTUs(), csi, Cvar_Set(), displayRemainingTus, HUD_CalcReloadTime(), HUD_GetLeftHandWeapon(), HUD_MapDebugCursor(), HUD_UpdateActorCvar(), HUD_UpdateActorFireMode(), HUD_UpdateActorMove(), csi_s::idRight, invList_s::item, LE_IsPaniced, LEFT, item_s::m, M_PEND_MOVE, mouseSpace, MS_WORLD, NONE, objDef_s::reload, REMAINING_TU_CROUCH, REMAINING_TU_RELOAD_LEFT, REMAINING_TU_RELOAD_RIGHT, RIGHT, ROUTING_NOT_REACHABLE, item_s::t, TEXT_STANDARD, le_s::TU, TU_CROUCH, UI_RegisterText(), and va().
Referenced by HUD_Update().
static void HUD_UpdateActorCvar | ( | le_t * | actor, | |
const char * | cvarPrefix | |||
) | [static] |
Definition at line 1162 of file cl_hud.c.
References _, item_s::a, le_s::as, CL_ActorReservedTUs(), CL_ActorUsableTUs(), Com_sprintf(), Cvar_Set(), Cvar_SetValue(), le_s::HP, HUD_GetLeftHandWeapon(), i, objDef_s::id, invList_s::item, LEFT, lengthof, le_s::maxHP, le_s::maxMorale, le_s::maxTU, objDef_s::model, le_s::model1, le_s::morale, R_AnimGetName(), RES_ALL_ACTIVE, RIGHT, le_s::STUN, item_s::t, le_s::TU, UI_MAX_SMALLTEXTLEN, and va().
Referenced by HUD_ActorGetCvarData_f(), and HUD_UpdateActor().
static int HUD_UpdateActorFireMode | ( | le_t * | actor | ) | [static] |
actor | The actor to update the hud for |
Definition at line 1043 of file cl_hud.c.
References _, item_s::a, le_s::actorMode, fireDef_s::ammo, CL_ActorSetFireDef(), CL_ActorSetMode(), CL_ActorUsableTUs(), CL_GetHitProbability(), Com_sprintf(), le_s::currentSelectedFiremode, le_s::fd, FIRESH_FiredefForWeapon(), FIRESH_GetFiredef(), GAME_ItemIsUseable(), HEADGEAR, HUD_DisplayMessage(), HUD_GetLeftHandWeapon(), IS_MODE_FIRE_HEADGEAR, IS_MODE_FIRE_LEFT, invList_s::item, lengthof, item_s::m, M_MOVE, fireDef_s::name, objDef_s::name, objDef_s::numWeapons, Q_strncpyz(), objDef_s::reload, RIGHT, item_s::t, TEXT_MOUSECURSOR_RIGHT, TEXT_STANDARD, fireDef_s::time, UI_MAX_SMALLTEXTLEN, UI_RegisterText(), UI_ResetData(), fireDef_s::weapFdsIdx, objDef_s::weapon, and objDef_s::weapons.
Referenced by HUD_UpdateActor().
static int HUD_UpdateActorMove | ( | const le_t * | actor | ) | [static] |
[in] | actor | The actor to update the hud for |
Definition at line 1128 of file cl_hud.c.
References _, le_s::actorMoveLength, CL_ActorMoveMode(), CL_ActorReservedTUs(), CL_ActorUsableTUs(), Com_sprintf(), lengthof, le_s::morale, RES_ALL_ACTIVE, ROUTING_NOT_REACHABLE, TEXT_MOUSECURSOR_RIGHT, TEXT_STANDARD, le_s::TU, UI_MAX_SMALLTEXTLEN, UI_RegisterText(), and UI_ResetData().
Referenced by HUD_UpdateActor().
static void HUD_UpdateAllActors | ( | void | ) | [static] |
Updates the global character cvars for battlescape.
le_t
- has a character assigned, too Definition at line 130 of file cl_hud.c.
References _, cl, CL_ActorGetChr(), Cvar_SetValue(), objDef_s::holdTwoHanded, le_s::HP, i, invList_s::item, LE_IsDead, LEFT, lengthof, le_s::maxHP, le_s::maxMorale, le_s::maxTU, le_s::model2, le_s::morale, model_s::name, objDef_s::name, character_s::name, RIGHT, le_s::STUN, item_s::t, le_s::TU, UI_ExecuteConfunc(), and va().
Referenced by HUD_Update().
void HUD_UpdateCursor | ( | void | ) |
Updates the cursor texts when in battlescape.
Definition at line 930 of file cl_hud.c.
References cl_map_debug, image_s::height, HUD_DrawMouseCursorText(), cvar_s::integer, it_pic, LE_IsCrouched, LONGLINES_WRAP, MAPDEBUG_TEXT, mousePosX, mousePosY, R_DrawImage(), R_FindImage(), R_FontTextSize(), selActor, le_s::state, STATE_REACTION, STATE_REACTION_MANY, STATE_REACTION_ONCE, TEXT_MOUSECURSOR_BOTTOM, TEXT_MOUSECURSOR_LEFT, TEXT_MOUSECURSOR_PLAYERNAMES, TEXT_MOUSECURSOR_RIGHT, TEXT_MOUSECURSOR_TOP, UI_GetText(), UI_ResetData(), viddef, viddef_t::virtualWidth, and image_s::width.
Referenced by SCR_DrawCursor().
static void HUD_UpdateReactionFiremodes | ( | const le_t * | actor, | |
const actorHands_t | hand, | |||
fireDefIndex_t | firemodeActive | |||
) | [static] |
Updates the information in RFmode for the selected actor with the given data from the parameters.
[in] | actor | The actor we want to update the reaction-fire firemode for. |
[in] | hand | Which weapon(-hand) to use. |
[in] | firemodeActive | Set this to the firemode index you want to activate or set it to -1 if the default one (currently the first one found) should be used. |
Definition at line 548 of file cl_hud.c.
References le_s::entnum, GAME_ItemIsUseable(), HUD_GetFireDefinitionForHand(), objDef_s::idx, MSG_Write_PA(), NONE, fireDef_s::obj, PA_REACT_SELECT, fireDef_s::weapFdsIdx, and objDef_s::weapons.
Referenced by HUD_SelectReactionFiremode_f().
static int HUD_UsableReactionTUs | ( | const le_t * | le | ) | [static] |
Returns the amount of usable "reaction fire" TUs for this actor (depends on active/inactive RF).
[in] | le | The actor to check. |
Definition at line 198 of file cl_hud.c.
References CL_ActorReservedTUs(), CL_ActorUsableTUs(), RES_REACTION, le_s::state, and STATE_REACTION.
Referenced by HUD_DisplayFiremodeEntry().
static int HUD_WeaponCanBeReloaded | ( | const le_t * | le, | |
containerIndex_t | containerID, | |||
const char ** | reason | |||
) | [static] |
Checks every case for reload buttons on the HUD.
[in] | le | Pointer of local entity being an actor. |
[in] | containerID | of the container to reload the weapon in. Used to get the movement TUs for moving something into the container. |
[out] | reason | The reason why the reload didn't work - only set if -1 is the return value |
Definition at line 656 of file cl_hud.c.
References _, item_s::a, objDef_s::ammo, CL_ActorUsableTUs(), CONTAINER, HUD_CalcReloadTime(), invList_s::item, item_s::m, objDef_s::reload, and item_s::t.
Referenced by HUD_RefreshButtons().
Checks if there is a weapon in the hand that can be used for reaction fire.
[in] | actor | What actor to check. |
Definition at line 705 of file cl_hud.c.
References INVSH_HasReactionFireEnabledWeapon(), LEFT, qtrue, and RIGHT.
Referenced by HUD_RefreshButtons().
cvar_t* cl_hud_message_timeout [static] |
cvar_t* cl_show_cursor_tooltips [static] |
Definition at line 49 of file cl_hud.c.
Referenced by CL_ActorMouseTrace(), CL_ActorMoveMouse(), CL_ActorVis(), CL_AddPathing(), CL_AddTargeting(), CL_CameraMove(), CL_LevelDown_f(), CL_LevelUp_f(), CL_ParticleRun2(), CL_StartGame(), CL_ViewUpdateRenderData(), LE_AddToScene(), LE_PlayFootStepSound(), LM_AddToSceneOrder(), UI_RadarNodeDraw(), and UI_RadarNodeGetActorColor().
qboolean displayRemainingTus[REMAINING_TU_MAX] [static] |
Definition at line 58 of file cl_hud.c.
Referenced by HUD_RemainingTUs_f(), and HUD_UpdateActor().
const char* moveModeDescriptions[] [static] |
linkedList_t* popupListData [static] |
uiNode_t* popupListNode [static] |
const char* shootTypeStrings[] [static] |
{ "primaryright", "reaction", "primaryleft", "reloadright", "reloadleft", "stand", "crouch", "headgear" }
a cbuf string for each button_types_t
Definition at line 74 of file cl_hud.c.
Referenced by HUD_SetWeaponButton().
qboolean visibleFiremodeListLeft = qfalse [static] |
If this is set to qfalse HUD_DisplayFiremodes_f will not attempt to hide the list
Definition at line 44 of file cl_hud.c.
Referenced by HUD_DisplayFiremodes(), HUD_HideFiremodes(), and HUD_SwitchFiremodeList_f().
qboolean visibleFiremodeListRight = qfalse [static] |
Definition at line 45 of file cl_hud.c.
Referenced by HUD_DisplayFiremodes(), HUD_HideFiremodes(), and HUD_SwitchFiremodeList_f().