1class IngameHud
extends Hud
86 protected Widget m_ActionItemQuantityWrapper
154 myTimer.Run( 1,
this,
"InitQuickbar" );
168 m_Badges = hud_panel_widget.FindAnyWidget(
"BadgesPanel");
216 m_Timer.Run(0.333,
this,
"RefreshQuickbar", NULL,
true );
266 for (
int y = 0;
y < 5;
y++ )
268 w.LoadImageFile(
y,
"set:dayz_gui image:icon" + widget_name +
y );
272 float alpha = w.GetAlpha();
273 w.SetColor(
ARGB( alpha * 255, 220, 220, 220 ) );
276 for (
int x = 1;
x < 4;
x++ )
310 ImageWidget badge_widget;
319 for (
int q = 0; q < badgeCountMax; q++ )
321 badge_widget.LoadImageFile( q,
"set:dayz_gui image:icon" + badge_name + q );
326 badge_widget.Show(
false );
350 Error(
"OnPlayerLoaded: Cannot retreive player");
352 if (!player.IsUnconscious())
370 override void Show(
bool show )
423 m_CursorIcon.FindAnyWidget( type ).GetParent().SetSize(
x * percentage,
y * percentage );
440 m_PermanentCrossHair.Show(show);
457 string arrow_name =
"ArrowUp";
460 arrow_name =
"ArrowDown";
464 for (
int x = 1;
x < 4;
x++ )
490 w.SetImage(
Math.
Clamp( status - 1, 0, 4 ) );
491 float alpha = w.GetAlpha();
496 w.SetColor(
ARGB( alpha * 255, 220, 220, 0 ) );
500 w.SetColor(
ARGB( alpha * 255, 220, 0, 0 ) );
510 w.SetColor(
ARGB( alpha * 255, 220, 220, 220 ) );
523 float alpha = w.GetAlpha();
527 temp_top.Show(
true );
528 temp_bot.Show(
false );
532 temp_top.Show(
false );
533 temp_bot.Show(
true );
539 w.SetColor(
ARGB( alpha * 255, 220, 220, 0 ) );
545 w.SetColor(
ARGB( alpha * 255, 220, 0, 0 ) );
557 w.SetColor(
ARGB( alpha * 255, 0, 206, 209 ) );
562 w.SetColor(
ARGB( alpha * 255, 30, 144, 220 ) );
574 w.SetColor(
ARGB( alpha * 255, 220, 220, 220 ) );
593 ImageWidget badge_widget
597 if ( badge_value > 0 )
601 int levelIndex = badge_value - 1;
603 if (maxSupportedIndex >= levelIndex)
604 badge_widget.SetImage(levelIndex);
607 badge_widget.Show(
true );
611 bleed_count.Show(
true );
619 bleed_count.Show(
false );
621 badge_widget.Show(
false );
632 temp_top.SetText( temp );
633 temp_bot.SetText( temp );
642 temp_top.SetText(
"" );
643 temp_bot.SetText(
"" );
671 ImageWidget stomach = ImageWidget.Cast(
m_Badges.FindAnyWidget(
"Stomach" ) );
672 stomach.LoadImageFile( 0,
"set:dayz_gui image:iconStomach" + state );
679 float percentage = 1;
682 percentage = range / max;
687 m_Stamina.SetCurrent(( value / range ) * 100);
699 if (!
GetGame().IsMultiplayer())
708 float h1 = player.GetHealth(
"",
"");
709 float b1 = player.GetHealth(
"",
"Blood");
736 if ( !
Class.
CastTo(car, player.GetDrivingVehicle()) )
779 int presence_level = player.GetNoisePresenceInAI();
786 if ( presence_level > 0 )
790 if ( presence_level > 1 )
794 if ( presence_level > 2 )
798 if ( presence_level > 3 )
802 if ( presence_level > 4 )
853 else if (
m_HudVisibility.IsContextFlagActive(EHudContextFlags.VEHICLE))
880 #ifdef PLATFORM_CONSOLE
890 m_HudVisibility.SetContextFlag(EHudContextFlags.QUICKBAR_DISABLE, !show);
920 m_HudVisibility.SetContextFlag(EHudContextFlags.QUICKBAR_GLOBAL, !show);
939 m_HudVisibility.SetContextFlag(EHudContextFlags.VEHICLE_DISABLE, state);
948 case EConnectivityStatLevel.OFF:
952 case EConnectivityStatLevel.LEVEL1:
956 case EConnectivityStatLevel.LEVEL2:
966 case EConnectivityStatLevel.OFF:
970 case EConnectivityStatLevel.LEVEL1:
974 case EConnectivityStatLevel.LEVEL2:
984 case EConnectivityStatLevel.OFF:
987 case EConnectivityStatLevel.LEVEL1:
1004 MissionGameplay
mission = MissionGameplay.Cast(
GetGame().GetMission());
1008 inventory =
mission.GetInventory();
1013 inventory.RefreshQuickbar();
1038 bool blood_type_visible = player.HasBloodTypeVisible();
1040 if( blood_type_visible )
1065 vector target_player = player.GetPosition();
1068 target_player[1] = target_player[1] + 1.2;
1079 if( results.Count() > 0 )
1081 if( results.Get( 0 ).
obj == player )
1109 if ( screen_pos[2] > 0 )
1111 if ( screen_pos[0] > 0 && screen_pos[0] < 1 )
1113 if ( screen_pos[1] > 0 && screen_pos[1] < 1 )
1130 if ( new_alpha == 0 )
1140 super.Update( timeslice );
1155 int alpha = widget.GetAlpha() * 255;
1157 int colorA =
ARGB( alpha, 255, 255, 255 );
1161 if ( widget.GetColor() == colorA )
1170 widget.SetColor( color );
1229 hiteff.
Init(player,hit_direction,intensity_max);
1264 Print(
"---------------------");
const int NTFKEY_POISONED
enum eBadgeLevel NTFKEY_THIRSTY
const int NTFKEY_FRACTURE
const int NTFKEY_BLEEDISH
const int NTFKEY_FEVERISH
static string GetBloodTypeName(int bloodtype, out string type, out bool positive)
proto native UIManager GetUIManager()
proto native vector GetScreenPosRelative(vector world_pos)
Transforms position in world to position in screen in percentage (0.0 - 1.0) as x,...
proto native DayZPlayer GetPlayer()
proto native WorkspaceWidget GetWorkspace()
proto native vector GetCurrentCameraPosition()
proto native vector GetCurrentCameraDirection()
static float GetStaminaMax()
Super root of all classes in Enforce script.
static ref array< Man > m_PlayerBaseList
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
void Init(DayZPlayer player, float hit_direction, float intensity_max)
Called manually after object spawn.
void RefreshVehicleHud(float timeslice)
void RefreshVehicleHudVisibility()
ref WidgetFadeTimer m_FadeTimerWalkieTalkieText
Widget m_StaminaBackground
ref array< ref HitDirectionEffectBase > m_HitDirEffectArray
bool m_VehicleHudDisabled
TextWidget m_PlayerTagText
void ShowPlayerTag(float timeslice)
TextWidget m_ActionItemDesc
ref IngameHudHeatBuffer m_HeatBufferUI
override void HideVehicleInfo()
void SetLeftStatsVisibility(bool visible)
TextWidget m_ActionButtonText
ref map< ImageWidget, int > m_TendencyStatusCritical
ref array< VehicleHudBase > m_VehicleHudArray
void RefreshHudVisibility()
override void ShowVehicleInfo()
override void SetTemperature(string temp)
override void DisplayNotifier(int key, int tendency, int status)
ref map< int, string > m_StatesWidgetNames
override void OnResizeScreen()
override void DisplayBadge(int key, int value)
override void ShowHudPlayer(bool show)
ref InventoryQuickbar m_Quickbar
bool m_QuickbarHidePlayer
override void ShowHud(bool show)
const float FADE_OUT_TIME
Widget m_VehicleHudPanels
Widget m_PlayerPanelWidget
TextWidget m_BloodPosType
override void ShowHudInventory(bool show)
override void ShowWalkieTalkie(int fadeOutSeconds)
void SetPermanentCrossHair(bool show)
ImageWidget m_LowServerPerfA
void ShowVehicleHud(bool state)
enter/exit driver seat
ref WidgetFadeTimer m_FadeTimerActionCursor
Widget m_ActionQuantityBox
override void SetCursorIcon(string icon)
ref WidgetFadeTimer m_FadeTimerWeaponName
float m_TimeSinceLastEngineLightChange
Widget m_SpecializationIcon
ImageWidget m_PermanentCrossHair
Widget m_RadialProgressBarCrossHair
const float TENDENCY_BLINK_TIME
override void UpdateBloodName()
override void ShowWalkieTalkie(bool show)
Widget m_ActionMultipleItemsFrame
override void Init(Widget hud_panel_widget)
ref map< int, ImageWidget > m_BadgesWidgets
override void ShowHudUI(bool show)
override void SetConnectivityStatIcon(EConnectivityStatType type, EConnectivityStatLevel level)
void UpdateSpecialtyMeter(float x, float y)
override void HideCursor()
ref WidgetFadeTimer m_FadeTimerZeroingOld
ImageWidget m_ConnectionLost
override void DisplayStance(int stance)
bool m_IsTemperatureVisible
Widget m_HitIndicatorLeft
ref array< ref WidgetFadeTimer > m_FadeTimers
void OnConnectionIconsSettingsChanged(bool enabled)
const float HIDE_MENU_TIME
ref map< int, int > m_BadgesSupportedLevels
Widget m_MouseContinuousAction
ref map< int, int > m_BadgesWidgetDisplay
bool m_IsVehicleHudVisible
IngameHudVisibility GetHudVisibility()
TextWidget m_ActionQuantityBoxText
ActionTargetsCursor m_ActionTargetsCursor
ref IngameHudVisibility m_HudVisibility
override void SetCursorIconScale(string type, float percentage)
ref map< int, string > m_BadgesWidgetNames
void SetStomachState(int state)
Widget m_RadialProgressBar
Widget m_HitIndicatorSingle
Widget m_BadgeNotifierDivider
override void ShowQuickbarPlayer(bool show)
override void DisplayPresence()
void DisplayTendencyTemp(int key, int tendency, int status)
void SetStaminaBarVisibility(bool show)
ref map< int, ImageWidget > m_StatesWidgets
ProgressBarWidget m_ActionQuantityBar
float m_TemperatureShowTime
ImageWidget m_LowServerPerfB
void UpdateHitDirEffects(float timeslice)
void SetVehicleHudDisabled(bool state)
disable vehicle HUD through options menu
ref WidgetFadeTimer m_FadeTimerWeaponStats
Widget m_MouseSingleAction
void ShowQuickBar(bool show)
ref WidgetFadeTimer m_FadeTimerMagazineName
void DisplayTendencyNormal(int key, int tendency, int status)
Widget m_SpecializatonPanel
override void ShowQuickbarUI(bool show)
override void SetStamina(int value, int range)
ref WidgetFadeTimer m_FadeTimerQuickbar
Widget m_HitIndicatorDown
override void SetCursorIconOffset(string type, float x, float y)
InventoryQuickbar GetQuickbar()
ref WidgetFadeTimer m_FadeTimerCrosshair
ProgressBarWidget m_Stamina
ImageWidget m_HeatBufferPlus
Widget GetHudPanelWidget()
override void ShowQuickBar(bool show)
global setting -> used to determine visibility based on platform
void OnUnconsciousStart()
ref map< string, ref VehicleHudBase > m_VehicleHudMap
VehicleHudBase m_ActiveVehicleHUD
Widget m_RadialProgressBar1
void ShowHudPlayer(bool show)
override void ShowCursor()
override void RefreshQuickbar(bool itemChanged=false)
override void InitHeatBufferUI(Man player)
ref WidgetFadeTimer m_FadeTimerWalkieTalkie
Widget m_GameStatusIconsPanel
override void SetStaminaBarVisibility(bool show)
Widget m_HitIndicatorRight
void InitBadgesAndNotifiers()
override void Show(bool show)
override void Update(float timeslice)
override void OnPlayerLoaded()
Widget m_LeftHudPanelWidget
void RefreshQuickbarVisibility()
bool IsHideQuickbarPlayer()
override void SpawnHitDirEffect(DayZPlayer player, float hit_direction, float intensity_max)
PlayerBase m_CurrentTaggedPlayer
void CleanupHitDirEffects()
override void UpdateQuickbarGlobalVisibility()
override void SetWalkieTalkieText(string text)
override void SetCursorIconSize(string type, float x, float y)
ImageWidget m_ActionHealthMark
proto native Transport GetTransport()
bool sorted
used only if groundOnly = false
Base native class for all motorized wheeled vehicles.
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void ShowVehicleInfo(PlayerBase player)
Object obj
Object inside of box.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
static proto int AbsInt(int i)
Returns absolute value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
proto native int Length()
Returns length of string.
int ARGB(int a, int r, int g, int b)