|
UFO: Alien Invasion
|
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 "../cgame/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 "../ui/ui_tooltip.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_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 | actionType_t { FIRE_RIGHT , FIRE_LEFT , RELOAD_RIGHT , RELOAD_LEFT } |
| enum | weaponButtonState_t { BT_STATE_UNINITIALZED , BT_STATE_DISABLE , BT_STATE_DESELECT , BT_STATE_SELECT } |
| Defines the various states of a button. More... | |
| enum | reserveButtonState_t { BUTTON_TURESERVE_UNINITIALIZED , BUTTON_TURESERVE_SHOT_RESERVED , BUTTON_TURESERVE_SHOT_DISABLED , BUTTON_TURESERVE_SHOT_CLEAR , BUTTON_TURESERVE_CROUCH_RESERVED , BUTTON_TURESERVE_CROUCH_DISABLED , BUTTON_TURESERVE_CROUCH_CLEAR } |
Functions | |
| CASSERT (lengthof(shootTypeStrings)==BT_NUM_TYPES) | |
| CASSERT (lengthof(moveModeDescriptions)==WALKTYPE_MAX) | |
| void | HUD_DisplayMessage (const char *text) |
| Displays a message on the hud. | |
| void | HUD_UpdateActorStats (const le_t *le) |
| static void | HUD_SetWeaponButton (buttonTypes_t button, weaponButtonState_t state) |
| Sets the display for a single weapon/reload HUD button. | |
| 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 bool | 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 (const le_t *le, bool 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 char *callback, const le_t *actor, const objDef_t *ammo, const weaponFireDefIndex_t weapFdsIdx, const actorHands_t hand, const int index) |
| Sets the display for a single weapon/reload HUD button. | |
| static void | HUD_DisplayActions (const char *callback, const le_t *actor, actionType_t type) |
| List actions from a soldier to a callback confunc. | |
| static void | HUD_DisplayActions_f (void) |
| Displays the firemodes for the given hand. | |
| static void | HUD_DisplayFiremodes_f (void) |
| Displays the firemodes for the given hand. | |
| 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 Item *item) |
| static int | HUD_WeaponCanBeReloaded (const le_t *le, containerIndex_t containerID, const char **reason) |
| Checks every case for reload buttons on the HUD. | |
| static bool | HUD_DisplayImpossibleReaction (const le_t *actor) |
| Display 'impossible' (red) reaction buttons. | |
| static void | HUD_DisplayPossibleReaction (const le_t *actor) |
| Display 'usable' (blue) reaction buttons. | |
| int | HUD_ReactionFireGetTUs (const le_t *actor) |
| Get the weapon firing TUs for reaction fire. | |
| static void | HUD_UpdateButtons (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 (const le_t *actor) |
| static const char * | HUD_GetPenaltyString (const int type) |
| static void | HUD_ActorWoundData_f (void) |
| static void | HUD_UpdateActorLoad_f (void) |
| Update the equipment weight for the selected actor. | |
| 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, void *data) |
| Callback that is called when the cl_selected cvar was changed. | |
| static void | HUD_RightHandChangeListener (const char *cvarName, const char *oldValue, const char *newValue, void *data) |
| 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, void *data) |
| 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, void *data) |
| Callback that is called when the remaining TUs for the current selected actor changed. | |
| static bool | CL_CvarWorldLevel (cvar_t *cvar) |
| static bool | HUD_CheckCLHud (cvar_t *cvar) |
| Checks that the given cvar is a valid hud cvar. | |
| void | HUD_InitUI (const char *optionWindowName) |
| Display the user interface. | |
| static bool | HUD_CvarCheckMNHud (cvar_t *cvar) |
| Checks that the given cvar is a valid hud cvar. | |
| void | HUD_InitStartup (void) |
Variables | |
| static cvar_t * | cl_hud_message_timeout |
| static cvar_t * | cl_show_cursor_tooltips |
| static cvar_t * | cl_hud |
| cvar_t * | cl_worldlevel |
| static bool | displayRemainingTus [REMAINING_TU_MAX] |
| static char const *const | shootTypeStrings [] |
| a cbuf string for each button_types_t | |
| static char const *const | moveModeDescriptions [] |
| static weaponButtonState_t | buttonStates [BT_NUM_TYPES] |
| static reserveButtonState_t | shotReserveButtonState |
| static reserveButtonState_t | crouchReserveButtonState |
| static linkedList_t * | popupListData |
| static uiNode_t * | popupListNode |
HUD related routines.
Definition in file cl_hud.cpp.
| anonymous enum |
| Enumerator | |
|---|---|
| REMAINING_TU_RELOAD_RIGHT | |
| REMAINING_TU_RELOAD_LEFT | |
| REMAINING_TU_CROUCH | |
| REMAINING_TU_MAX | |
Definition at line 48 of file cl_hud.cpp.
| enum actionType_t |
| Enumerator | |
|---|---|
| FIRE_RIGHT | |
| FIRE_LEFT | |
| RELOAD_RIGHT | |
| RELOAD_LEFT | |
Definition at line 70 of file cl_hud.cpp.
| enum buttonTypes_t |
| Enumerator | |
|---|---|
| BT_RIGHT_FIRE | |
| BT_REACTION | |
| BT_LEFT_FIRE | |
| BT_RIGHT_RELOAD | |
| BT_LEFT_RELOAD | |
| BT_STAND | |
| BT_CROUCH | |
| BT_HEADGEAR | |
| BT_NUM_TYPES | |
Definition at line 57 of file cl_hud.cpp.
| enum reserveButtonState_t |
Definition at line 117 of file cl_hud.cpp.
| enum weaponButtonState_t |
Defines the various states of a button.
| Enumerator | |
|---|---|
| BT_STATE_UNINITIALZED | |
| BT_STATE_DISABLE | 'Disabled' display (grey) |
| BT_STATE_DESELECT | Normal display (blue) |
| BT_STATE_SELECT | Selected display (blue) |
Definition at line 94 of file cl_hud.cpp.
| CASSERT | ( | lengthof(moveModeDescriptions) | = =WALKTYPE_MAX | ) |
References moveModeDescriptions, and WALKTYPE_MAX.
| CASSERT | ( | lengthof(shootTypeStrings) | = =BT_NUM_TYPES | ) |
References BT_NUM_TYPES, and shootTypeStrings.
|
static |
Definition at line 1540 of file cl_hud.cpp.
References cl, Cvar_AssertValue(), and PATHFINDING_HEIGHT.
Referenced by HUD_InitStartup().
|
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) |
| data | Unused here, but required by cvarChangeListenerFunc_t |
Definition at line 1473 of file cl_hud.cpp.
References cl, CL_OnBattlescape(), data, lengthof, and UI_ExecuteConfunc().
Referenced by HUD_InitStartup().
Definition at line 1274 of file cl_hud.cpp.
References _, BodyData::bleedingFactor(), CHRSH_IsTeamDefRobot(), CL_BattlescapeRunning(), HUD_GetPenaltyString(), BodyData::id(), lengthof, MODIFIER_ACCURACY, MODIFIER_MAX, BodyData::name(), BodyData::numBodyParts(), BodyData::penalty(), Q_strcat(), Q_strncpyz(), selActor, woundInfo_t::treatmentLevel, UI_ExecuteConfunc(), va(), woundInfo_t::woundLevel, and BodyData::woundThreshold().
Referenced by HUD_InitStartup().
|
static |
Checks that the given cvar is a valid hud cvar.
| cvar | The cvar to check |
true if cvar is valid, false otherwise Definition at line 1551 of file cl_hud.cpp.
References uiNode_t::name, Q_streq, cvar_t::string, uiNode_t::super, and UI_GetWindow().
Referenced by HUD_CvarCheckMNHud(), and HUD_InitUI().
|
static |
Check if at least one firemode is available for reservation.
Definition at line 216 of file cl_hud.cpp.
References CL_ActorReservedTUs(), CL_ActorTimeForFireDef(), CL_ActorUsableTUs(), objDef_t::fd, foreachhand, HUD_GetFireDefinitionForHand(), i, objDef_t::numFiredefs, fireDef_t::obj, RES_SHOT, selActor, and fireDef_t::weapFdsIdx.
Referenced by HUD_UpdateButtons().
|
static |
Checks that the given cvar is a valid hud cvar.
| cvar | The cvar to check and to modify if the value is invalid |
true if the valid is invalid, false otherwise Definition at line 1588 of file cl_hud.cpp.
References cl_hud, Cvar_Reset(), and HUD_CheckCLHud().
Referenced by HUD_InitStartup().
|
static |
List actions from a soldier to a callback confunc.
| callback | confunc callback |
| actor | actor who can do the actions |
| type | The action to display |
< Not our turn
Definition at line 443 of file cl_hud.cpp.
References ACTOR_HAND_LEFT, ACTOR_HAND_RIGHT, CID_LEFT, CID_RIGHT, cls, Com_DPrintf(), DEBUG_CLIENT, Item::def(), FIRE_LEFT, FIRE_RIGHT, le_t::getLeftHandItem(), le_t::getRightHandItem(), HUD_CalcReloadTime(), HUD_DisplayFiremodeEntry(), HUD_GetFireDefinitionForHand(), i, Item::isReloadable(), MAX_FIREDEFS_PER_WEAPON, fireDef_t::obj, RELOAD_LEFT, RELOAD_RIGHT, le_t::TU, type, UI_ExecuteConfunc(), UI_PopWindow(), and fireDef_t::weapFdsIdx.
Referenced by HUD_DisplayActions_f(), and HUD_DisplayFiremodes_f().
Displays the firemodes for the given hand.
Definition at line 533 of file cl_hud.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), FIRE_LEFT, FIRE_RIGHT, HUD_DisplayActions(), Q_strncpyz(), RELOAD_LEFT, RELOAD_RIGHT, selActor, and type.
Referenced by HUD_InitStartup().
|
static |
Sets the display for a single weapon/reload HUD button.
| callback | confunc callback |
| actor | The actor local entity |
| ammo | The ammo used by this firemode |
| weapFdsIdx | the weapon index in the fire definition array |
| hand | What list to display |
| index | Index of the actual firemode |
Definition at line 398 of file cl_hud.cpp.
References _, ACTOR_GET_HAND_CHAR, ACTOR_HAND_LEFT, ACTOR_HAND_RIGHT, fireDef_t::ammo, CL_ActorGetChr(), CL_ActorTimeForFireDef(), CL_ActorUsableTUs(), Com_sprintf(), objDef_t::fd, fireDef_t::fdIdx, HUD_UsableReactionTUs(), index, MAX_VAR, fireDef_t::name, objDef_t::numFiredefs, fireDef_t::reaction, character_t::RFmode, THIS_FIREMODE, and UI_ExecuteConfunc().
Referenced by HUD_DisplayActions().
Displays the firemodes for the given hand.
Definition at line 564 of file cl_hud.cpp.
References ACTOR_GET_HAND_INDEX, ACTOR_HAND_RIGHT, Cmd_Argc(), Cmd_Argv(), Com_Printf(), FIRE_LEFT, FIRE_RIGHT, HUD_DisplayActions(), Q_strncpyz(), selActor, and type.
Referenced by HUD_InitStartup().
|
static |
Display 'impossible' (red) reaction buttons.
| [in] | actor | the actor to check for his reaction state. |
Definition at line 724 of file cl_hud.cpp.
References BT_REACTION, BT_STATE_UNINITIALZED, buttonStates, Com_Printf(), LE_IsSelected, le_t::state, STATE_REACTION, and UI_ExecuteConfunc().
Referenced by HUD_UpdateButtons().
| void HUD_DisplayMessage | ( | const char * | text | ) |
Displays a message on the hud.
| [in] | text | text is already translated here |
Definition at line 138 of file cl_hud.cpp.
References cl_hud, cl_hud_message_timeout, and UI_DisplayNotice().
Referenced by CL_ActorAppear(), CL_ActorCheckAction(), CL_ActorDie(), CL_ActorReload(), CL_ActorRevitalised(), CL_ActorStateChange(), CL_ActorWound(), CL_DoEndRound(), CL_NextRound_f(), CL_ParseServerMessage(), GAME_GetImportData(), HUD_CheckReload(), HUD_CheckShooting(), HUD_FireWeapon_f(), HUD_ReloadLeft_f(), HUD_ReloadRight_f(), HUD_ToggleCrouchReservation_f(), HUD_ToggleReaction_f(), HUD_UpdateActorFireMode(), and cgame_import_t::void().
Display 'usable' (blue) reaction buttons.
| [in] | actor | the actor to check for his reaction state. |
Definition at line 751 of file cl_hud.cpp.
References BT_REACTION, BT_STATE_SELECT, buttonStates, LE_IsSelected, le_t::state, STATE_REACTION, and UI_ExecuteConfunc().
Referenced by HUD_UpdateButtons().
Draw the mouse cursor tooltips in battlescape.
| xOffset | |
| yOffset | |
| textId | The text id to get the tooltip string from. |
Definition at line 966 of file cl_hud.cpp.
References cl_show_cursor_tooltips, mousePosX, mousePosY, UI_DrawTooltip(), UI_GetText(), and viddef.
Referenced by HUD_UpdateCursor().
Definition at line 658 of file cl_hud.cpp.
References Item::def(), Item::getFastestFireDef(), and fireDef_t::time.
Referenced by HUD_UpdateButtons().
|
static |
Definition at line 1254 of file cl_hud.cpp.
References _, MODIFIER_ACCURACY, MODIFIER_MOVEMENT, MODIFIER_REACTION, MODIFIER_SHOOTING, MODIFIER_SIGHT, MODIFIER_TU, and type.
Referenced by HUD_ActorWoundData_f().
Definition at line 1597 of file cl_hud.cpp.
References CL_CvarWorldLevel(), cl_hud, cl_hud_message_timeout, cl_show_cursor_tooltips, cl_worldlevel, Cmd_AddCommand(), CVAR_ARCHIVE, Cvar_Get(), CVAR_LATCH, Cvar_RegisterChangeListener(), Cvar_SetCheckFunction(), HUD_ActorSelectionChangeListener(), HUD_ActorWoundData_f(), HUD_CvarCheckMNHud(), HUD_DisplayActions_f(), HUD_DisplayFiremodes_f(), HUD_InitCallbacks(), HUD_LeftHandChangeListener(), HUD_PopupFiremodeReservation_f(), HUD_RemainingTUs_f(), HUD_RightHandChangeListener(), HUD_SelectReactionFiremode_f(), HUD_ShotReserve_f(), HUD_TUChangeListener(), and HUD_UpdateActorLoad_f().
Referenced by CL_InitLocal().
| void HUD_InitUI | ( | const char * | optionWindowName | ) |
Display the user interface.
| optionWindowName | Name of the window used to display options, else nullptr if nothing |
Definition at line 1572 of file cl_hud.cpp.
References buttonStates, cl_hud, Cvar_Set(), HUD_CheckCLHud(), OBJZERO, UI_ExecuteConfunc(), and UI_InitStack().
Referenced by GAME_GetImportData(), GAME_StartBattlescape(), and cgame_import_t::void().
|
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 |
| data | Unused here, but required by cvarChangeListenerFunc_t |
Definition at line 1511 of file cl_hud.cpp.
References CL_OnBattlescape(), data, HUD_UpdateButtons(), Q_streq, and selActor.
Referenced by HUD_InitStartup().
Shows map pathfinding debugging parameters (if activated).
| [in] | le | The current selected actors entity |
Definition at line 1055 of file cl_hud.cpp.
References ACTOR_GET_FIELDSIZE, cl, cl_map_debug, Com_sprintf(), getDVdir, getDVz, Grid_Ceiling(), Grid_Floor(), Grid_MoveNext(), lengthof, MAPDEBUG_TEXT, mousePos, 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] | le | The actor local entity |
| [in] | popupReload | Prevent firemode reservation popup from being closed if no firemode is available because of insufficient TUs. |
Definition at line 270 of file cl_hud.cpp.
References _, ACTOR_HAND_NOT_SET, CL_ActorGetChr(), CL_ActorReservedTUs(), CL_ActorTimeForFireDef(), CL_ActorUsableTUs(), Com_sprintf(), objDef_t::fd, reserveShot_t::fireModeIndex, foreachhand, FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), FiremodeSettings::getWeapon(), reserveShot_t::hand, HUD_GetFireDefinitionForHand(), i, lengthof, LIST_Add(), LIST_AddPointer(), LIST_AddString(), LIST_Count(), LIST_Delete(), MAX_VAR, fireDef_t::name, NONE, objDef_t::numFiredefs, fireDef_t::obj, popupListData, popupListNode, RES_SHOT, character_t::reservedTus, chrReservations_t::shotSettings, TEXT_LIST, reserveShot_t::TUs, UI_PopupList(), UI_ResetData(), UI_TextNodeSelectLine(), VectorSet, fireDef_t::weapFdsIdx, reserveShot_t::weaponIndex, and objDef_t::weapons.
Referenced by HUD_PopupFiremodeReservation_f(), and HUD_UpdateButtons().
Creates a (text) list of all firemodes of the currently selected actor.
Definition at line 335 of file cl_hud.cpp.
References ACTOR_HAND_NOT_SET, Cmd_Argc(), HUD_PopupFiremodeReservation(), HUD_SetShootReservation(), and selActor.
Referenced by HUD_InitStartup().
Get the weapon firing TUs for reaction fire.
| [in] | actor | the actor to check for his reaction TUs. |
Definition at line 774 of file cl_hud.cpp.
References Item::ammoDef(), CL_ActorGetChr(), CL_ActorTimeForFireDef(), Item::getFiredefs(), FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), le_t::getHandItem(), le_t::getLeftHandItem(), le_t::getRightHandItem(), Item::isWeapon(), MAX_FIREDEFS_PER_WEAPON, and character_t::RFmode.
Referenced by HUD_ToggleReaction_f(), and HUD_UpdateButtons().
Remember if we hover over a button that would cost some TUs when pressed.
Definition at line 634 of file cl_hud.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_ParseBoolean(), Com_Printf(), displayRemainingTus, OBJZERO, Q_streq, REMAINING_TU_CROUCH, REMAINING_TU_RELOAD_LEFT, REMAINING_TU_RELOAD_RIGHT, and type.
Referenced by HUD_InitStartup().
|
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 |
| data | Unused here, but required by cvarChangeListenerFunc_t |
Definition at line 1493 of file cl_hud.cpp.
References CL_OnBattlescape(), data, HUD_UpdateButtons(), Q_streq, and selActor.
Referenced by HUD_InitStartup().
Checks if the selected firemode checkbox is ok as a reaction firemode and updates data+display.
Definition at line 610 of file cl_hud.cpp.
References ACTOR_GET_HAND_INDEX, Cmd_Argc(), Cmd_Argv(), Com_Printf(), HUD_UpdateReactionFiremodes(), MAX_FIREDEFS_PER_WEAPON, and selActor.
Referenced by HUD_InitStartup().
|
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 249 of file cl_hud.cpp.
References CL_ActorGetChr(), CL_ActorReserveTUs(), fireModeIndex, RES_SHOT, character_t::reservedTus, FiremodeSettings::set(), and chrReservations_t::shotSettings.
Referenced by HUD_PopupFiremodeReservation_f(), and HUD_ShotReserve_f().
|
static |
Sets the display for a single weapon/reload HUD button.
Definition at line 168 of file cl_hud.cpp.
References BT_STATE_DESELECT, BT_STATE_DISABLE, buttonStates, shootTypeStrings, and UI_ExecuteConfunc().
Referenced by HUD_UpdateButtons().
Get selected firemode in the list of the currently selected actor.
Definition at line 353 of file cl_hud.cpp.
References ACTOR_HAND_NOT_SET, CL_ActorReservedTUs(), CL_ActorUsableTUs(), Cmd_Argc(), Cmd_Argv(), Com_Printf(), reserveShot_t::fireModeIndex, GAME_ItemIsUseable(), reserveShot_t::hand, HUD_SetShootReservation(), INVSH_GetItemByIDX(), LIST_Count(), LIST_GetByIdx(), NONE, popupListData, popupListNode, RES_SHOT, selActor, reserveShot_t::TUs, UI_TextNodeSelectLine(), and reserveShot_t::weaponIndex.
Referenced by HUD_InitStartup().
|
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 |
| data | Unused here, but required by cvarChangeListenerFunc_t |
Definition at line 1529 of file cl_hud.cpp.
References CL_OnBattlescape(), data, HUD_UpdateButtons(), Q_streq, and selActor.
Referenced by HUD_InitStartup().
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 1428 of file cl_hud.cpp.
References ca_active, cl, cl_worldlevel, cls, Cvar_Set(), Cvar_SetValue(), HUD_UpdateActor(), i, PATHFINDING_HEIGHT, selActor, and UI_ExecuteConfunc().
Referenced by CL_SlowFrame().
Updates the hud for one actor.
| actor | The actor to update the hud values for |
Definition at line 1367 of file cl_hud.cpp.
References _, le_t::actorMode, le_t::actorMoveLength, Item::ammoDef(), CID_RIGHT, CL_ActorFireModeActivated(), CL_ActorUsableTUs(), Cvar_Set(), Item::def(), displayRemainingTus, le_t::getLeftHandItem(), le_t::getRightHandItem(), HUD_CalcReloadTime(), HUD_GetLeftHandWeapon(), HUD_MapDebugCursor(), HUD_UpdateActorCvar(), HUD_UpdateActorFireMode(), HUD_UpdateActorMove(), IN_GetMouseSpace, Item::isReloadable(), LE_IsPanicked, M_PEND_MOVE, MS_WORLD, NONE, REMAINING_TU_CROUCH, REMAINING_TU_RELOAD_LEFT, REMAINING_TU_RELOAD_RIGHT, ROUTING_NOT_REACHABLE, TEXT_STANDARD, le_t::TU, TU_CROUCH, and UI_RegisterText().
Referenced by HUD_Update().
Definition at line 1205 of file cl_hud.cpp.
References _, le_t::as, CL_ActorReservedTUs(), CL_ActorUsableTUs(), Cvar_Set(), Cvar_SetValue(), Item::def(), Item::getAmmoLeft(), le_t::getLeftHandItem(), le_t::getRightHandItem(), le_t::HP, HUD_GetLeftHandWeapon(), objDef_t::id, le_t::maxHP, le_t::maxMorale, le_t::maxTU, objDef_t::model, le_t::model1, le_t::morale, R_AnimGetName(), RES_ALL_ACTIVE, le_t::STUN, and le_t::TU.
Referenced by HUD_UpdateActor().
| actor | The actor to update the hud for |
Definition at line 1086 of file cl_hud.cpp.
References _, le_t::actorMode, fireDef_t::ammo, Item::ammoDef(), CL_ActorSetFireDef(), CL_ActorSetMode(), CL_ActorTimeForFireDef(), CL_ActorUsableTUs(), CL_GetHitProbability(), Com_sprintf(), le_t::currentSelectedFiremode, Item::def(), le_t::fd, FIRESH_GetFiredef(), GAME_ItemIsUseable(), Item::getFiredefs(), Inventory::getHeadgear(), le_t::getRightHandItem(), HUD_DisplayMessage(), HUD_GetLeftHandWeapon(), le_t::inv, IS_MODE_FIRE_HEADGEAR, IS_MODE_FIRE_LEFT, Item::isWeapon(), lengthof, M_MOVE, Item::mustReload(), fireDef_t::name, objDef_t::name, objDef_t::numWeapons, Q_strncpyz(), TEXT_MOUSECURSOR_RIGHT, TEXT_STANDARD, UI_MAX_SMALLTEXTLEN, UI_RegisterText(), UI_ResetData(), fireDef_t::weapFdsIdx, and objDef_t::weapons.
Referenced by HUD_UpdateActor().
Update the equipment weight for the selected actor.
Definition at line 1316 of file cl_hud.cpp.
References _, ABILITY_SPEED, CL_ActorGetChr(), CL_BattlescapeRunning(), Com_sprintf(), count, Item::def(), GAME_GetChrMaxLoad(), GET_ENCUMBRANCE_PENALTY, GET_TU, Item::getFiredefs(), Inventory::getNextCont(), Container::getNextItem(), i, character_t::inv, MAX_FIREDEFS_PER_WEAPON, MAX_VAR, fireDef_t::name, objDef_t::name, popupText, Q_strcat(), character_t::score, selActor, chrScoreGlobal_t::skills, fireDef_t::time, UI_ExecuteConfunc(), UI_Popup(), WEIGHT_FACTOR, and WEIGHT_NORMAL_PENALTY.
Referenced by HUD_InitStartup().
| [in] | actor | The actor to update the hud for |
Definition at line 1171 of file cl_hud.cpp.
References _, le_t::actorMoveLength, CL_ActorMoveMode(), CL_ActorReservedTUs(), CL_ActorUsableTUs(), Com_sprintf(), lengthof, le_t::morale, moveModeDescriptions, RES_ALL_ACTIVE, ROUTING_NOT_REACHABLE, TEXT_MOUSECURSOR_RIGHT, TEXT_STANDARD, le_t::TU, UI_MAX_SMALLTEXTLEN, UI_RegisterText(), and UI_ResetData().
Referenced by HUD_UpdateActor().
Definition at line 144 of file cl_hud.cpp.
References _, CL_ActorGetChr(), CL_ActorGetNumber(), CL_ActorReservedTUs(), Item::def(), le_t::getLeftHandItem(), le_t::getRightHandItem(), le_t::headSkin, le_t::HP, Item::isHeldTwoHanded(), LE_IsDead, le_t::maxHP, le_t::maxMorale, le_t::maxTU, le_t::model2, le_t::morale, character_t::name, model_t::name, objDef_t::name, RES_ALL_ACTIVE, le_t::STUN, le_t::TU, UI_ExecuteConfunc(), and va().
Referenced by CL_ActorStats().
Refreshes the weapon/reload buttons on the HUD.
| [in] | le | Pointer to local entity for which we refresh HUD buttons. |
Definition at line 805 of file cl_hud.cpp.
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, BT_STATE_UNINITIALZED, BUTTON_TURESERVE_CROUCH_CLEAR, BUTTON_TURESERVE_CROUCH_DISABLED, BUTTON_TURESERVE_CROUCH_RESERVED, BUTTON_TURESERVE_SHOT_CLEAR, BUTTON_TURESERVE_SHOT_DISABLED, BUTTON_TURESERVE_SHOT_RESERVED, buttonStates, CID_LEFT, CID_RIGHT, CL_ActorInjuryModifier(), CL_ActorReservedTUs(), CL_ActorUsableTUs(), crouchReserveButtonState, Cvar_Set(), Inventory::getHeadgear(), le_t::getLeftHandItem(), le_t::getRightHandItem(), Inventory::holdsReactionFireWeapon(), HUD_CheckFiremodeReservation(), HUD_DisplayImpossibleReaction(), HUD_DisplayPossibleReaction(), HUD_GetMinimumTUsForUsage(), HUD_PopupFiremodeReservation(), HUD_ReactionFireGetTUs(), HUD_SetWeaponButton(), HUD_WeaponCanBeReloaded(), le_t::inv, Item::isHeldTwoHanded(), LE_IsCrouched, MODIFIER_SHOOTING, POPUPLIST_NODE_NAME, RES_CROUCH, RES_SHOT, shotReserveButtonState, le_t::state, STATE_REACTION, TU_CROUCH, UI_ExecuteConfunc(), and UI_GetActiveWindowName().
Referenced by HUD_LeftHandChangeListener(), HUD_RightHandChangeListener(), and HUD_TUChangeListener().
Updates the cursor texts when in battlescape.
Definition at line 976 of file cl_hud.cpp.
References cl_map_debug, image_t::height, HUD_DrawMouseCursorText(), it_pic, LE_IsCrouched, LONGLINES_WRAP, MAPDEBUG_TEXT, mousePosX, mousePosY, R_DrawImage(), R_FindImage(), R_FontTextSize(), selActor, le_t::state, STATE_REACTION, TEXT_MOUSECURSOR_BOTTOM, TEXT_MOUSECURSOR_LEFT, TEXT_MOUSECURSOR_PLAYERNAMES, TEXT_MOUSECURSOR_RIGHT, TEXT_MOUSECURSOR_TOP, UI_GetText(), UI_ResetData(), viddef, and image_t::width.
Referenced by SCR_DrawCursor().
|
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 590 of file cl_hud.cpp.
References le_t::entnum, GAME_ItemIsUseable(), HUD_GetFireDefinitionForHand(), objDef_t::idx, MSG_Write_PA(), NONE, fireDef_t::obj, PA_REACT_SELECT, fireDef_t::weapFdsIdx, and objDef_t::weapons.
Referenced by HUD_SelectReactionFiremode_f().
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 199 of file cl_hud.cpp.
References CL_ActorReservedTUs(), CL_ActorUsableTUs(), RES_REACTION, le_t::state, and STATE_REACTION.
Referenced by HUD_DisplayFiremodeEntry().
|
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 674 of file cl_hud.cpp.
References _, objDef_t::ammo, Item::ammoDef(), CL_ActorUsableTUs(), Item::def(), Item::getAmmoLeft(), Inventory::getContainer2(), HUD_CalcReloadTime(), le_t::inv, and objDef_t::isReloadable().
Referenced by HUD_UpdateButtons().
|
static |
Definition at line 129 of file cl_hud.cpp.
Referenced by HUD_DisplayImpossibleReaction(), HUD_DisplayPossibleReaction(), HUD_InitUI(), HUD_SetWeaponButton(), and HUD_UpdateButtons().
|
static |
Definition at line 45 of file cl_hud.cpp.
Referenced by HUD_CvarCheckMNHud(), HUD_DisplayMessage(), HUD_InitStartup(), and HUD_InitUI().
|
static |
Definition at line 43 of file cl_hud.cpp.
Referenced by HUD_DisplayMessage(), and HUD_InitStartup().
|
static |
Definition at line 44 of file cl_hud.cpp.
Referenced by HUD_DrawMouseCursorText(), and HUD_InitStartup().
| cvar_t* cl_worldlevel |
Definition at line 46 of file cl_hud.cpp.
Referenced by CL_ActorMouseTrace(), CL_ActorMoveMouse(), CL_ActorVis(), CL_AddActorPathing(), CL_AddPathing(), CL_AddTargeting(), CL_CameraMove(), CL_GetWorldCoordsUnderMouse(), CL_LevelDown_f(), CL_LevelUp_f(), CL_ParticleRun2(), CL_StartGame(), CL_ViewUpdateRenderData(), uiRadarNode::draw(), HUD_InitStartup(), HUD_Update(), LE_AddToScene(), LE_BrushModelAction(), LE_PlayFootStepSound(), LM_AddToSceneOrder(), and UI_RadarNodeGetActorColor().
|
static |
Definition at line 131 of file cl_hud.cpp.
Referenced by HUD_UpdateButtons().
|
static |
Definition at line 55 of file cl_hud.cpp.
Referenced by HUD_RemainingTUs_f(), and HUD_UpdateActor().
|
static |
Definition at line 102 of file cl_hud.cpp.
Referenced by CASSERT(), and HUD_UpdateActorMove().
|
static |
Definition at line 258 of file cl_hud.cpp.
Referenced by CL_DisplayHomebasePopup(), CL_PopupChangeHomebase_f(), HUD_PopupFiremodeReservation(), and HUD_ShotReserve_f().
|
static |
Definition at line 259 of file cl_hud.cpp.
Referenced by CL_DisplayHomebasePopup(), HUD_PopupFiremodeReservation(), and HUD_ShotReserve_f().
|
static |
a cbuf string for each button_types_t
Definition at line 78 of file cl_hud.cpp.
Referenced by CASSERT(), and HUD_SetWeaponButton().
|
static |
Definition at line 130 of file cl_hud.cpp.
Referenced by HUD_UpdateButtons().