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_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 | 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. More... | |
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. More... | |
static int | HUD_UsableReactionTUs (const le_t *le) |
Returns the amount of usable "reaction fire" TUs for this actor (depends on active/inactive RF) More... | |
static bool | HUD_CheckFiremodeReservation (void) |
Check if at least one firemode is available for reservation. More... | |
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. More... | |
static void | HUD_PopupFiremodeReservation (const le_t *le, bool popupReload) |
Creates a (text) list of all firemodes of the currently selected actor. More... | |
static void | HUD_PopupFiremodeReservation_f (void) |
Creates a (text) list of all firemodes of the currently selected actor. More... | |
static void | HUD_ShotReserve_f (void) |
Get selected firemode in the list of the currently selected actor. More... | |
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. More... | |
static void | HUD_DisplayActions (const char *callback, const le_t *actor, actionType_t type) |
List actions from a soldier to a callback confunc. More... | |
static void | HUD_DisplayActions_f (void) |
Displays the firemodes for the given hand. More... | |
static void | HUD_DisplayFiremodes_f (void) |
Displays the firemodes for the given hand. More... | |
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. More... | |
static void | HUD_SelectReactionFiremode_f (void) |
Checks if the selected firemode checkbox is ok as a reaction firemode and updates data+display. More... | |
static void | HUD_RemainingTUs_f (void) |
Remember if we hover over a button that would cost some TUs when pressed. More... | |
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. More... | |
static bool | HUD_DisplayImpossibleReaction (const le_t *actor) |
Display 'impossible' (red) reaction buttons. More... | |
static void | HUD_DisplayPossibleReaction (const le_t *actor) |
Display 'usable' (blue) reaction buttons. More... | |
int | HUD_ReactionFireGetTUs (const le_t *actor) |
Get the weapon firing TUs for reaction fire. More... | |
static void | HUD_UpdateButtons (const le_t *le) |
Refreshes the weapon/reload buttons on the HUD. More... | |
static void | HUD_DrawMouseCursorText (int xOffset, int yOffset, int textId) |
Draw the mouse cursor tooltips in battlescape. More... | |
void | HUD_UpdateCursor (void) |
Updates the cursor texts when in battlescape. More... | |
static void | HUD_MapDebugCursor (const le_t *le) |
Shows map pathfinding debugging parameters (if activated) More... | |
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. More... | |
static void | HUD_UpdateActor (le_t *actor) |
Updates the hud for one actor. More... | |
void | HUD_Update (void) |
Updates console vars for an actor. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static bool | CL_CvarWorldLevel (cvar_t *cvar) |
static bool | HUD_CheckCLHud (cvar_t *cvar) |
Checks that the given cvar is a valid hud cvar. More... | |
void | HUD_InitUI (const char *optionWindowName) |
Display the user interface. More... | |
static bool | HUD_CvarCheckMNHud (cvar_t *cvar) |
Checks that the given cvar is a valid hud cvar. More... | |
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 More... | |
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.
typedef struct reserveShot_s reserveShot_t |
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(shootTypeStrings) | = =BT_NUM_TYPES | ) |
CASSERT | ( | lengthof(moveModeDescriptions) | = =WALKTYPE_MAX | ) |
|
static |
Definition at line 1540 of file cl_hud.cpp.
References cl, Cvar_AssertValue(), clientBattleScape_s::mapMaxLevel, 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(), lengthof, clientBattleScape_s::teamList, and UI_ExecuteConfunc().
Referenced by HUD_InitStartup().
Definition at line 1274 of file cl_hud.cpp.
References _, BodyData::bleedingFactor(), teamDef_s::bodyTemplate, CHRSH_IsTeamDefRobot(), CL_BattlescapeRunning(), HUD_GetPenaltyString(), BodyData::id(), lengthof, le_s::maxHP, MODIFIER_ACCURACY, MODIFIER_MAX, BodyData::name(), BodyData::numBodyParts(), BodyData::penalty(), Q_strcat(), Q_strncpyz(), selActor, le_s::teamDef, woundInfo_s::treatmentLevel, UI_ExecuteConfunc(), va(), woundInfo_s::woundLevel, le_s::wounds, 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_s::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_s::fd, foreachhand, HUD_GetFireDefinitionForHand(), i, objDef_s::numFiredefs, fireDef_s::obj, RES_SHOT, selActor, and fireDef_s::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 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_s::getLeftHandItem(), le_s::getRightHandItem(), HUD_CalcReloadTime(), HUD_DisplayFiremodeEntry(), HUD_GetFireDefinitionForHand(), i, client_static_s::isOurRound(), Item::isReloadable(), MAX_FIREDEFS_PER_WEAPON, fireDef_s::obj, RELOAD_LEFT, RELOAD_RIGHT, le_s::TU, UI_ExecuteConfunc(), UI_PopWindow(), and fireDef_s::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_s::ammo, CL_ActorGetChr(), CL_ActorTimeForFireDef(), CL_ActorUsableTUs(), Com_sprintf(), objDef_s::fd, fireDef_s::fdIdx, HUD_UsableReactionTUs(), index, MAX_VAR, fireDef_s::name, objDef_s::numFiredefs, fireDef_s::reaction, character_s::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(), le_s::isMoving(), 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, Com_Printf(), LE_IsSelected, le_s::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 cvar_s::integer, cvar_s::string, 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(), and HUD_UpdateActorFireMode().
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, LE_IsSelected, le_s::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 cvar_s::integer, mousePosX, mousePosY, UI_DrawTooltip(), UI_GetText(), viddef, and viddef_t::virtualWidth.
Referenced by HUD_UpdateCursor().
Definition at line 658 of file cl_hud.cpp.
References Item::def(), Item::getFastestFireDef(), and fireDef_s::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, and MODIFIER_TU.
Referenced by HUD_ActorWoundData_f().
Definition at line 1597 of file cl_hud.cpp.
References CL_CvarWorldLevel(), 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(), HUD_UpdateActorLoad_f(), and cvar_s::modified.
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 Cvar_Set(), HUD_CheckCLHud(), OBJZERO, cvar_s::string, UI_ExecuteConfunc(), and UI_InitStack().
Referenced by GAME_GetImportData(), and GAME_StartBattlescape().
|
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(), 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(), cvar_s::integer, lengthof, clientBattleScape_s::mapData, MAPDEBUG_TEXT, mousePos, clientBattleScape_s::pathMap, mapData_s::routing, 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_s::fd, reserveShot_s::fireModeIndex, foreachhand, FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), FiremodeSettings::getWeapon(), reserveShot_s::hand, HUD_GetFireDefinitionForHand(), 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, RES_SHOT, character_s::reservedTus, uiNode_t::selectedColor, chrReservations_s::shotSettings, TEXT_LIST, reserveShot_s::TUs, UI_PopupList(), UI_ResetData(), UI_TextNodeSelectLine(), VectorSet, fireDef_s::weapFdsIdx, reserveShot_s::weaponIndex, and objDef_s::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_s::getHandItem(), le_s::getLeftHandItem(), le_s::getRightHandItem(), Item::isWeapon(), MAX_FIREDEFS_PER_WEAPON, and character_s::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(), 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(), RES_SHOT, character_s::reservedTus, FiremodeSettings::set(), and chrReservations_s::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, 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_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 |
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(), 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, cls, Cvar_Set(), Cvar_SetValue(), HUD_UpdateActor(), i, cvar_s::integer, clientBattleScape_s::mapMaxLevel, cvar_s::modified, clientBattleScape_s::numTeamList, PATHFINDING_HEIGHT, selActor, client_static_s::state, 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_s::actorMode, le_s::actorMoveLength, Item::ammoDef(), CID_RIGHT, CL_ActorFireModeActivated(), CL_ActorUsableTUs(), Cvar_Set(), Item::def(), displayRemainingTus, le_s::getLeftHandItem(), le_s::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_s::TU, TU_CROUCH, and UI_RegisterText().
Referenced by HUD_Update().
Definition at line 1205 of file cl_hud.cpp.
References _, le_s::as, CL_ActorReservedTUs(), CL_ActorUsableTUs(), Cvar_Set(), Cvar_SetValue(), Item::def(), Item::getAmmoLeft(), le_s::getLeftHandItem(), le_s::getRightHandItem(), le_s::HP, HUD_GetLeftHandWeapon(), objDef_s::id, le_s::maxHP, le_s::maxMorale, le_s::maxTU, objDef_s::model, le_s::model1, le_s::morale, R_AnimGetName(), RES_ALL_ACTIVE, le_s::STUN, and le_s::TU.
Referenced by HUD_UpdateActor().
actor | The actor to update the hud for |
Definition at line 1086 of file cl_hud.cpp.
References _, le_s::actorMode, fireDef_s::ammo, Item::ammoDef(), CL_ActorSetFireDef(), CL_ActorSetMode(), CL_ActorTimeForFireDef(), CL_ActorUsableTUs(), CL_GetHitProbability(), Com_sprintf(), le_s::currentSelectedFiremode, Item::def(), le_s::fd, FIRESH_GetFiredef(), GAME_ItemIsUseable(), Item::getFiredefs(), Inventory::getHeadgear(), le_s::getRightHandItem(), HUD_DisplayMessage(), HUD_GetLeftHandWeapon(), le_s::inv, IS_MODE_FIRE_HEADGEAR, IS_MODE_FIRE_LEFT, Item::isWeapon(), lengthof, M_MOVE, Item::mustReload(), fireDef_s::name, objDef_s::name, objDef_s::numWeapons, Q_strncpyz(), TEXT_MOUSECURSOR_RIGHT, TEXT_STANDARD, UI_MAX_SMALLTEXTLEN, UI_RegisterText(), UI_ResetData(), fireDef_s::weapFdsIdx, and objDef_s::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(), f, GAME_GetChrMaxLoad(), GET_ENCUMBRANCE_PENALTY, GET_TU, Item::getFiredefs(), Inventory::getNextCont(), Container::getNextItem(), Inventory::getWeight(), i, le_s::inv, character_s::inv, MAX_FIREDEFS_PER_WEAPON, MAX_VAR, fireDef_s::name, objDef_s::name, popupText, Q_strcat(), character_s::score, selActor, chrScoreGlobal_s::skills, fireDef_s::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_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().
Definition at line 144 of file cl_hud.cpp.
References _, CL_ActorGetChr(), CL_ActorGetNumber(), CL_ActorReservedTUs(), Item::def(), le_s::getLeftHandItem(), le_s::getRightHandItem(), le_s::headSkin, le_s::HP, Item::isHeldTwoHanded(), LE_IsDead, le_s::maxHP, le_s::maxMorale, le_s::maxTU, le_s::model2, le_s::morale, model_s::name, objDef_s::name, character_s::name, RES_ALL_ACTIVE, le_s::STUN, le_s::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, CID_LEFT, CID_RIGHT, CL_ActorInjuryModifier(), CL_ActorReservedTUs(), CL_ActorUsableTUs(), Cvar_Set(), Inventory::getHeadgear(), le_s::getLeftHandItem(), le_s::getRightHandItem(), Inventory::holdsReactionFireWeapon(), HUD_CheckFiremodeReservation(), HUD_DisplayImpossibleReaction(), HUD_DisplayPossibleReaction(), HUD_GetMinimumTUsForUsage(), HUD_PopupFiremodeReservation(), HUD_ReactionFireGetTUs(), HUD_SetWeaponButton(), HUD_WeaponCanBeReloaded(), le_s::inv, Item::isHeldTwoHanded(), LE_IsCrouched, MODIFIER_SHOOTING, POPUPLIST_NODE_NAME, RES_CROUCH, RES_SHOT, le_s::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_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, 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 |
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_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().
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_s::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_s::ammo, Item::ammoDef(), CL_ActorUsableTUs(), Item::def(), Item::getAmmoLeft(), Inventory::getContainer2(), HUD_CalcReloadTime(), le_s::inv, and objDef_s::isReloadable().
Referenced by HUD_UpdateButtons().
|
static |
Definition at line 129 of file cl_hud.cpp.
|
static |
Definition at line 45 of file cl_hud.cpp.
|
static |
Definition at line 43 of file cl_hud.cpp.
|
static |
Definition at line 44 of file cl_hud.cpp.
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(), LE_AddToScene(), LE_BrushModelAction(), LE_PlayFootStepSound(), LM_AddToSceneOrder(), and UI_RadarNodeGetActorColor().
|
static |
Definition at line 131 of file cl_hud.cpp.
|
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.
|
static |
Definition at line 258 of file cl_hud.cpp.
|
static |
Definition at line 259 of file cl_hud.cpp.
|
static |
a cbuf string for each button_types_t
Definition at line 78 of file cl_hud.cpp.
Referenced by HUD_SetWeaponButton().
|
static |
Definition at line 130 of file cl_hud.cpp.