DayZ 1.24
Loading...
Searching...
No Matches
BleedingIndicatorDropData Class Reference
Collaboration diagram for BleedingIndicatorDropData:
[legend]

Protected Member Functions

void BleedingIndicatorDropData (ImageWidget image, int severity)
 
void ~BleedingIndicatorDropData ()
 
void InitImageScale ()
 
void ScatterPosition (vector pos)
 
void StartDrop ()
 
void StopDrop ()
 
void SetBasePosition (vector pos)
 
bool IsRunning ()
 
ImageWidget GetImage ()
 
void AdjustColorSaturation ()
 
void UpdateAlpha (float progress, float progressFade)
 
void UpdateTransform (float progress, float progressFade)
 scaling and transformation
 
void Update (float timeSlice)
 

Protected Attributes

ImageWidget m_Widget
 
int m_Severity
 
float m_TimeTotal
 
float m_ProgressBreakpointTime
 
float m_ProgressFadingDuration
 
float m_ProgressBreakpoint
 
float m_Duration
 
float m_SpeedCoef
 
int m_ScatterPx
 
float m_SlideDistance
 
float m_ColorAlphaStart
 
float m_ColorAlphaEnd
 
float m_ColorAlphaCurrent
 
float m_ImageBaseSizeX
 
float m_ImageBaseSizeY
 
float m_ImageStartingSizeX
 
float m_ImageStartingSizeY
 
float m_ImageEndSizeX
 
float m_ImageEndSizeY
 
float m_ImageMaxSizeX
 
float m_ImageMaxSizeY
 
float m_ImageBaseRotation
 
bool m_IsRunning
 
vector m_BasePosition
 
int m_ScreenSizeX
 
int m_ScreenSizeY
 
float m_PosX
 
float m_PosY
 
float m_StartSizeCoef
 
float m_EndSizeCoef
 
float m_RandomSizeMin
 
float m_RandomSizeMax
 

Detailed Description

Definition at line 2 of file BleedingDrop.c.

Constructor & Destructor Documentation

◆ BleedingIndicatorDropData()

void BleedingIndicatorDropData::BleedingIndicatorDropData ( ImageWidget image,
int severity )
inlineprotected

Definition at line 39 of file BleedingDrop.c.

40 {
43 m_TimeTotal = 0;
44 m_IsRunning = false;
45
46#ifdef DIAG_DEVELOPER
48 {
58 }
59 else
60#endif
61 {
62 switch (m_Severity)
63 {
65 {
73 break;
74 }
76 {
84 break;
85 }
87 {
95 break;
96 }
97 }
98
101 }
103
104 m_SpeedCoef = 1.0; //TODO ??
105#ifdef DIAG_DEVELOPER
107 {
110 }
111 else
112#endif
113 {
116 }
120 }
Definition EnMath.c:7
static proto float Max(float x, float y)
Returns bigger of two given values.
proto void GetScreenSize(out int x, out int y)

References AdjustColorSaturation(), BleedingIndicationConstants::DROP_COLOR_ALPHA_END, BleedingIndicationConstants::DROP_COLOR_ALPHA_START, BleedingIndicationConstants::DROP_DURATION_HIGH, BleedingIndicationConstants::DROP_DURATION_LOW, BleedingIndicationConstants::DROP_DURATION_MEDIUM, BleedingIndicationConstants::DROP_PROGRESS_THRESHOLD, BleedingIndicationConstants::DROP_SCATTER_HIGH, BleedingIndicationConstants::DROP_SCATTER_LOW, BleedingIndicationConstants::DROP_SCATTER_MEDIUM, BleedingIndicationConstants::DROP_SIZE_END_HIGH, BleedingIndicationConstants::DROP_SIZE_END_LOW, BleedingIndicationConstants::DROP_SIZE_END_MEDIUM, BleedingIndicationConstants::DROP_SIZE_START_HIGH, BleedingIndicationConstants::DROP_SIZE_START_LOW, BleedingIndicationConstants::DROP_SIZE_START_MEDIUM, BleedingIndicationConstants::DROP_SIZE_VARIATION_MAX_HIGH, BleedingIndicationConstants::DROP_SIZE_VARIATION_MAX_LOW, BleedingIndicationConstants::DROP_SIZE_VARIATION_MAX_MEDIUM, BleedingIndicationConstants::DROP_SIZE_VARIATION_MIN_HIGH, BleedingIndicationConstants::DROP_SIZE_VARIATION_MIN_LOW, BleedingIndicationConstants::DROP_SIZE_VARIATION_MIN_MEDIUM, BleedingIndicationConstants::DROP_SLIDE_DISTANCE_HIGH, BleedingIndicationConstants::DROP_SLIDE_DISTANCE_LOW, BleedingIndicationConstants::DROP_SLIDE_DISTANCE_MEDIUM, GetScreenSize(), BleedingIndicationConstants::INDICATOR_SEVERITY_HIGH, BleedingIndicationConstants::INDICATOR_SEVERITY_LOW, BleedingIndicationConstants::INDICATOR_SEVERITY_MEDIUM, InitImageScale(), m_ColorAlphaEnd, m_ColorAlphaStart, DbgBleedingIndicationStaticInfo::m_DbgDropColorAlphaEnd, DbgBleedingIndicationStaticInfo::m_DbgDropColorAlphaStart, DbgBleedingIndicationStaticInfo::m_DbgDropDurationBase, DbgBleedingIndicationStaticInfo::m_DbgDropEndSize, DbgBleedingIndicationStaticInfo::m_DbgDropProgressTreshold, DbgBleedingIndicationStaticInfo::m_DbgDropScatter, DbgBleedingIndicationStaticInfo::m_DbgDropSizeVariationMax, DbgBleedingIndicationStaticInfo::m_DbgDropSizeVariationMin, DbgBleedingIndicationStaticInfo::m_DbgDropSlideDistance, DbgBleedingIndicationStaticInfo::m_DbgDropStartSize, DbgBleedingIndicationStaticInfo::m_DbgUseOverrideValues, m_Duration, m_EndSizeCoef, m_IsRunning, m_ProgressBreakpoint, m_ProgressBreakpointTime, m_ProgressFadingDuration, m_RandomSizeMax, m_RandomSizeMin, m_ScatterPx, m_ScreenSizeX, m_ScreenSizeY, m_Severity, m_SlideDistance, m_SpeedCoef, m_StartSizeCoef, m_TimeTotal, m_Widget, and Math::Max().

◆ ~BleedingIndicatorDropData()

void BleedingIndicatorDropData::~BleedingIndicatorDropData ( )
inlineprotected

Definition at line 122 of file BleedingDrop.c.

123 {
124 }

Member Function Documentation

◆ AdjustColorSaturation()

void BleedingIndicatorDropData::AdjustColorSaturation ( )
inlineprotected

Definition at line 195 of file BleedingDrop.c.

196 {
197 //color adjustment
202#ifdef DIAG_DEVELOPER
204 {
209 }
210#endif
211
212 //saturation adjustment
213#ifdef DIAG_DEVELOPER
215 {
216#endif
218 float saturationProgress = Param1<float>.Cast(par).param1;
221 float lowest_channel = Math.Min(Math.Min(r, g), b);
225#ifdef DIAG_DEVELOPER
226 }
227#endif
228
229 int color = ARGB(0x00, r, g, b);
230 m_Widget.SetColor(color);
231 }
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition Easing.c:3
static float EaseOutSine(float t)
Definition Easing.c:9
Glow - PostProcessEffectType.Glow.
Definition PPEGlow.c:8
static const int PARAM_SATURATION
Definition PPEGlow.c:31
Static component of PPE manager, used to hold the instance.
Definition PPEManager.c:3
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Definition PPEManager.c:27
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
PostProcessEffectType
Post-process effect type.
Definition EnWorld.c:72
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Min(float x, float y)
Returns smaller of two given values.
int ARGB(int a, int r, int g, int b)
Definition proto.c:322

References ARGB(), BleedingIndicationConstants::DROP_COLOR_BLUE, BleedingIndicationConstants::DROP_COLOR_DESATURATIONEND, BleedingIndicationConstants::DROP_COLOR_GREEN, BleedingIndicationConstants::DROP_COLOR_RED, Easing::EaseOutSine(), PPEManagerStatic::GetPPEManager(), Math::Lerp(), DbgBleedingIndicationStaticInfo::m_DbgDesaturationEnd, DbgBleedingIndicationStaticInfo::m_DbgDropColorBlue, DbgBleedingIndicationStaticInfo::m_DbgDropColorGreen, DbgBleedingIndicationStaticInfo::m_DbgDropColorRed, DbgBleedingIndicationStaticInfo::m_DbgDropDesaturate, DbgBleedingIndicationStaticInfo::m_DbgUseOverrideValues, m_Widget, Math::Min(), and PPEGlow::PARAM_SATURATION.

Referenced by BleedingIndicatorDropData().

◆ GetImage()

ImageWidget BleedingIndicatorDropData::GetImage ( )
inlineprotected

Definition at line 190 of file BleedingDrop.c.

191 {
192 return m_Widget;
193 }

References m_Widget.

◆ InitImageScale()

void BleedingIndicatorDropData::InitImageScale ( )
inlineprotected

Definition at line 126 of file BleedingDrop.c.

References m_EndSizeCoef, m_ImageBaseSizeX, m_ImageBaseSizeY, m_ImageEndSizeX, m_ImageEndSizeY, m_ImageStartingSizeX, m_ImageStartingSizeY, m_RandomSizeMax, m_RandomSizeMin, m_StartSizeCoef, m_Widget, and Math::RandomFloatInclusive().

Referenced by BleedingIndicatorDropData().

◆ IsRunning()

bool BleedingIndicatorDropData::IsRunning ( )
inlineprotected

Definition at line 185 of file BleedingDrop.c.

186 {
187 return m_IsRunning;
188 }

References m_IsRunning.

◆ ScatterPosition()

void BleedingIndicatorDropData::ScatterPosition ( vector pos)
inlineprotected

Definition at line 137 of file BleedingDrop.c.

138 {
139#ifdef DIAG_DEVELOPER
142#endif
145 m_PosX = pos[0];
147
148 m_PosY = pos[1];
150 }
static const float PI2
Definition EnMath.c:13
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Sin(float angle)
Returns sinus of angle in radians.

References Math::Cos(), DbgBleedingIndicationStaticInfo::m_DbgDropScatter, DbgBleedingIndicationStaticInfo::m_DbgUseOverrideValues, m_PosX, m_PosY, m_ScatterPx, Math::PI2, Math::RandomFloatInclusive(), and Math::Sin().

Referenced by StartDrop().

◆ SetBasePosition()

void BleedingIndicatorDropData::SetBasePosition ( vector pos)
inlineprotected

Definition at line 178 of file BleedingDrop.c.

References m_BasePosition, m_ScreenSizeX, and m_ScreenSizeY.

◆ StartDrop()

void BleedingIndicatorDropData::StartDrop ( )
inlineprotected

◆ StopDrop()

void BleedingIndicatorDropData::StopDrop ( )
inlineprotected

Definition at line 171 of file BleedingDrop.c.

172 {
173 m_IsRunning = false;
174 m_Widget.SetSize(m_ImageBaseSizeX, m_ImageBaseSizeY); //resets image size
175 m_Widget.Show(false);
176 }

References m_ImageBaseSizeX, m_ImageBaseSizeY, m_IsRunning, and m_Widget.

Referenced by Update().

◆ Update()

void BleedingIndicatorDropData::Update ( float timeSlice)
inlineprotected

Definition at line 263 of file BleedingDrop.c.

264 {
265 if (m_IsRunning)
266 {
267 float progress, progressFade;
270
271 //alpha
273 //transform + scaling
275
277
278 if (m_TimeTotal >= m_Duration)
279 {
280 //deletes this;
281 StopDrop();
282 }
283 }
284 }
void UpdateAlpha(float progress, float progressFade)
void UpdateTransform(float progress, float progressFade)
scaling and transformation

References m_Duration, m_IsRunning, m_ProgressBreakpointTime, m_ProgressFadingDuration, m_SpeedCoef, m_TimeTotal, StopDrop(), UpdateAlpha(), and UpdateTransform().

◆ UpdateAlpha()

void BleedingIndicatorDropData::UpdateAlpha ( float progress,
float progressFade )
inlineprotected

◆ UpdateTransform()

void BleedingIndicatorDropData::UpdateTransform ( float progress,
float progressFade )
inlineprotected

scaling and transformation

Definition at line 244 of file BleedingDrop.c.

245 {
249 m_Widget.SetSize(sizeX, sizeY);
250
252 {
253 //do stuff before breakpoint
254 }
255 else
256 {
257 //do stuff after breakpoint
259 m_Widget.SetPos(m_PosX, posYTemp);
260 }
261 }
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(), Math::Lerp(), m_ImageEndSizeX, m_ImageEndSizeY, m_ImageStartingSizeX, m_ImageStartingSizeY, m_PosX, m_PosY, m_ProgressBreakpoint, m_SlideDistance, and m_Widget.

Referenced by Update().

Member Data Documentation

◆ m_BasePosition

vector BleedingIndicatorDropData::m_BasePosition
protected

Definition at line 29 of file BleedingDrop.c.

Referenced by SetBasePosition(), and StartDrop().

◆ m_ColorAlphaCurrent

float BleedingIndicatorDropData::m_ColorAlphaCurrent
protected

Definition at line 17 of file BleedingDrop.c.

Referenced by UpdateAlpha().

◆ m_ColorAlphaEnd

float BleedingIndicatorDropData::m_ColorAlphaEnd
protected

Definition at line 16 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and UpdateAlpha().

◆ m_ColorAlphaStart

float BleedingIndicatorDropData::m_ColorAlphaStart
protected

Definition at line 15 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and UpdateAlpha().

◆ m_Duration

float BleedingIndicatorDropData::m_Duration
protected

Definition at line 10 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and Update().

◆ m_EndSizeCoef

float BleedingIndicatorDropData::m_EndSizeCoef
protected

Definition at line 34 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and InitImageScale().

◆ m_ImageBaseRotation

float BleedingIndicatorDropData::m_ImageBaseRotation
protected

Definition at line 27 of file BleedingDrop.c.

◆ m_ImageBaseSizeX

float BleedingIndicatorDropData::m_ImageBaseSizeX
protected

Definition at line 19 of file BleedingDrop.c.

Referenced by InitImageScale(), and StopDrop().

◆ m_ImageBaseSizeY

float BleedingIndicatorDropData::m_ImageBaseSizeY
protected

Definition at line 20 of file BleedingDrop.c.

Referenced by InitImageScale(), and StopDrop().

◆ m_ImageEndSizeX

float BleedingIndicatorDropData::m_ImageEndSizeX
protected

Definition at line 23 of file BleedingDrop.c.

Referenced by InitImageScale(), and UpdateTransform().

◆ m_ImageEndSizeY

float BleedingIndicatorDropData::m_ImageEndSizeY
protected

Definition at line 24 of file BleedingDrop.c.

Referenced by InitImageScale(), and UpdateTransform().

◆ m_ImageMaxSizeX

float BleedingIndicatorDropData::m_ImageMaxSizeX
protected

Definition at line 25 of file BleedingDrop.c.

◆ m_ImageMaxSizeY

float BleedingIndicatorDropData::m_ImageMaxSizeY
protected

Definition at line 26 of file BleedingDrop.c.

◆ m_ImageStartingSizeX

float BleedingIndicatorDropData::m_ImageStartingSizeX
protected

Definition at line 21 of file BleedingDrop.c.

Referenced by InitImageScale(), and UpdateTransform().

◆ m_ImageStartingSizeY

float BleedingIndicatorDropData::m_ImageStartingSizeY
protected

Definition at line 22 of file BleedingDrop.c.

Referenced by InitImageScale(), and UpdateTransform().

◆ m_IsRunning

bool BleedingIndicatorDropData::m_IsRunning
protected

Definition at line 28 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), IsRunning(), StartDrop(), StopDrop(), and Update().

◆ m_PosX

float BleedingIndicatorDropData::m_PosX
protected

Definition at line 32 of file BleedingDrop.c.

Referenced by ScatterPosition(), StartDrop(), and UpdateTransform().

◆ m_PosY

float BleedingIndicatorDropData::m_PosY
protected

Definition at line 32 of file BleedingDrop.c.

Referenced by ScatterPosition(), StartDrop(), and UpdateTransform().

◆ m_ProgressBreakpoint

float BleedingIndicatorDropData::m_ProgressBreakpoint
protected

Definition at line 9 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), UpdateAlpha(), and UpdateTransform().

◆ m_ProgressBreakpointTime

float BleedingIndicatorDropData::m_ProgressBreakpointTime
protected

Definition at line 7 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and Update().

◆ m_ProgressFadingDuration

float BleedingIndicatorDropData::m_ProgressFadingDuration
protected

Definition at line 8 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and Update().

◆ m_RandomSizeMax

float BleedingIndicatorDropData::m_RandomSizeMax
protected

Definition at line 36 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and InitImageScale().

◆ m_RandomSizeMin

float BleedingIndicatorDropData::m_RandomSizeMin
protected

Definition at line 35 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and InitImageScale().

◆ m_ScatterPx

int BleedingIndicatorDropData::m_ScatterPx
protected

Definition at line 12 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and ScatterPosition().

◆ m_ScreenSizeX

int BleedingIndicatorDropData::m_ScreenSizeX
protected

Definition at line 30 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and SetBasePosition().

◆ m_ScreenSizeY

int BleedingIndicatorDropData::m_ScreenSizeY
protected

Definition at line 31 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and SetBasePosition().

◆ m_Severity

int BleedingIndicatorDropData::m_Severity
protected

Definition at line 5 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData().

◆ m_SlideDistance

float BleedingIndicatorDropData::m_SlideDistance
protected

Definition at line 13 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and UpdateTransform().

◆ m_SpeedCoef

float BleedingIndicatorDropData::m_SpeedCoef
protected

Definition at line 11 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and Update().

◆ m_StartSizeCoef

float BleedingIndicatorDropData::m_StartSizeCoef
protected

Definition at line 33 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), and InitImageScale().

◆ m_TimeTotal

float BleedingIndicatorDropData::m_TimeTotal
protected

Definition at line 6 of file BleedingDrop.c.

Referenced by BleedingIndicatorDropData(), StartDrop(), and Update().

◆ m_Widget

ImageWidget BleedingIndicatorDropData::m_Widget
protected

The documentation for this class was generated from the following file: