DayZ 1.24
Loading...
Searching...
No Matches
StaminaSoundHandler.c File Reference

Go to the source code of this file.

Classes

class  SoundHandlerBase
 
class  StaminaSoundHandlerBase
 

Enumerations

enum  eStaminaZones { ZONE0 , ZONE1 , ZONE2 }
 

Functions

void Update ()
 
eSoundHandlers GetID ()
 
void SoundHandlerBase (PlayerBase player)
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
void SetStaminaZoneOffset (int zone_offset)
 
eStaminaZones GetZone (float stamina)
 

Variables

const float TICK_INTERVAL = 1
 
const float STAMINA_SOUND_TR1 = 0.55
 
const float STAMINA_SOUND_TR2 = 0.25
 
enum eStaminaZones UP
 
enum eStaminaZones DOWN
 
enum eStaminaZones ZONE0_UP = 1
 
enum eStaminaZones ZONE0_DOWN = 1
 
enum eStaminaZones ZONE1_UP = 1
 
enum eStaminaZones ZONE1_DOWN = 1
 
enum eStaminaZones ZONE2_UP = 1
 
enum eStaminaZones ZONE2_DOWN = 1
 
enum eStaminaZones m_Id = 1
 
PlayerBase m_Player
 
class StaminaSoundHandlerBase extends SoundHandlerBase m_Stamina
 
StaminaHandler m_StaminaHandler
 
float m_StaminaLastValue
 
int m_StaminaZoneOffset
 

Enumeration Type Documentation

◆ eStaminaZones

Enumerator
ZONE0 
ZONE1 
ZONE2 

Definition at line 6 of file StaminaSoundHandler.c.

7{
8 ZONE0,
9 ZONE1,
10 ZONE2,
11}

Function Documentation

◆ GetID()

eSoundHandlers GetID ( )

Definition at line 39 of file StaminaSoundHandler.c.

40 {
41 return m_Id;
42 }
enum eStaminaZones m_Id

References m_Id.

◆ GetZone()

eStaminaZones GetZone ( float stamina)

Definition at line 137 of file StaminaSoundHandler.c.

138 {
139 float stamina_normalized = Math.InverseLerp(0, m_Player.GetStaminaHandler().GetStaminaCap(), stamina);
141 //PrintString(" stamina_normalized " +stamina_normalized.ToString());
143
146
149
150 return stamina_zone;
151 }
const float STAMINA_SOUND_TR1
PlayerBase m_Player
const float STAMINA_SOUND_TR2
eStaminaZones
Definition EnMath.c:7
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'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

References Math::Clamp(), Math::InverseLerp(), m_Player, STAMINA_SOUND_TR1, and STAMINA_SOUND_TR2.

Referenced by Update().

◆ Init()

void Init ( )

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

pre-init arrays

Definition at line 120 of file DayZGame.c.

121 {
122 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/dialog_queue_position.layout");
123 m_HintPanel = new UiHintPanelLoading(layoutRoot.FindAnyWidget("hint_frame0"));
124 m_txtPosition = TextWidget.Cast(layoutRoot.FindAnyWidget("txtPosition"));
125 m_txtNote = TextWidget.Cast(layoutRoot.FindAnyWidget("txtNote"));
126 m_btnLeave = ButtonWidget.Cast(layoutRoot.FindAnyWidget("btnLeave"));
127 m_txtNote.Show(true);
128 layoutRoot.FindAnyWidget("notification_root").Show(false);
129
130#ifdef PLATFORM_CONSOLE
131 layoutRoot.FindAnyWidget("toolbar_bg").Show(true);
132 RichTextWidget toolbar_b = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon"));
134#ifdef PLATFORM_XBOX
135#ifdef BUILD_EXPERIMENTAL
136 layoutRoot.FindAnyWidget("notification_root").Show(true);
137#endif
138#endif
139#endif
140
141 return layoutRoot;
142 }
ref UiHintPanelLoading m_HintPanel
Definition DayZGame.c:676
ButtonWidget m_btnLeave
Definition DayZGame.c:107
class LoginScreenBase extends UIScriptedMenu m_txtPosition
TextWidget m_txtNote
Definition DayZGame.c:106
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:151
static const float ICON_SCALE_TOOLBAR
Definition InputUtils.c:15
proto native CGame GetGame()

◆ SetStaminaZoneOffset()

void SetStaminaZoneOffset ( int zone_offset)

Definition at line 100 of file StaminaSoundHandler.c.

101 {
103 }
int m_StaminaZoneOffset

References m_StaminaZoneOffset.

◆ SoundHandlerBase()

void SoundHandlerBase ( PlayerBase player)

Definition at line 44 of file StaminaSoundHandler.c.

45 {
47 Init();
48 }
void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Definition DayZGame.c:120

References SoundHandlerBase::Init(), and m_Player.

Variable Documentation

◆ DOWN

◆ m_Id

enum eStaminaZones m_Id = 1

Referenced by GetID(), and SoundHandlerBase::Init().

◆ m_Player

PlayerBase m_Player

Definition at line 35 of file StaminaSoundHandler.c.

Referenced by SoundHandlerBase().

◆ m_Stamina

◆ m_StaminaHandler

◆ m_StaminaLastValue

float m_StaminaLastValue

Definition at line 97 of file StaminaSoundHandler.c.

Referenced by Update().

◆ m_StaminaZoneOffset

int m_StaminaZoneOffset

Definition at line 98 of file StaminaSoundHandler.c.

Referenced by SetStaminaZoneOffset(), and Update().

◆ STAMINA_SOUND_TR1

const float STAMINA_SOUND_TR1 = 0.55

Definition at line 3 of file StaminaSoundHandler.c.

Referenced by GetZone().

◆ STAMINA_SOUND_TR2

const float STAMINA_SOUND_TR2 = 0.25

Definition at line 4 of file StaminaSoundHandler.c.

Referenced by GetZone().

◆ TICK_INTERVAL

const float TICK_INTERVAL = 1

Definition at line 1 of file StaminaSoundHandler.c.

◆ UP

◆ ZONE0_DOWN

enum eStaminaZones ZONE0_DOWN = 1

◆ ZONE0_UP

enum eStaminaZones ZONE0_UP = 1

◆ ZONE1_DOWN

enum eStaminaZones ZONE1_DOWN = 1

◆ ZONE1_UP

enum eStaminaZones ZONE1_UP = 1

◆ ZONE2_DOWN

enum eStaminaZones ZONE2_DOWN = 1

◆ ZONE2_UP

enum eStaminaZones ZONE2_UP = 1