25 protected const int WIDGETSET_BREATH = 100;
39 m_RunningEffectsPrevious =
new set<int>;
46 m_TimeProgBreath = 0.0;
47 m_BreathMultStamina = 1.0;
75 for (
int i = 0;
i < m_Layouts.Count();
i++)
77 if (m_Layouts.GetElement(
i))
78 m_Layouts.GetElement(
i).Unlink();
89 m_UniqueLayouts.Insert(
w);
102 return m_IDToTypeMap.Get(
typeID);
107 if (!m_WidgetDataMap.Get(
id).DataInitialized())
108 m_WidgetDataMap.Get(
id).RegisterData(
p);
127 parent = m_Layouts.Get(type).FindAnyWidgetById(type);
131 Print(
"InitWidgetSet | type: " + type +
" - parent not found!");
136 Widget w = parent.GetChildren();
149 if (parent.GetChildren())
164 m_UpdatingEffects.Insert(type);
174 m_WidgetDataMap.Set(type,
data);
207 for (
int i = 0;
i < m_RunningEffectsPrevious.Count();
i++)
209 value = m_RunningEffectsPrevious.Get(
i);
213 if (
dta.HasDefinedHandle())
214 dta.UpdateVisibility(
false);
217 for (
int j = 0;
j < m_WidgetDataMap.Get(
value).GetWidgetSet().
Count();
j++)
219 w = m_WidgetDataMap.Get(
value).GetWidgetSet().Get(
j);
222 w.GetParent().Show(
false);
233 value = m_RunningEffects.Get(
i);
235 if (
dta.HasDefinedHandle())
237 dta.m_LayoutRoot.Show(
true);
238 dta.UpdateVisibility(
true);
242 for (
j = 0;
j < m_WidgetDataMap.Get(
value).GetWidgetSet().
Count();
j++)
244 w = m_WidgetDataMap.Get(
value).GetWidgetSet().Get(
j);
260 m_RunningEffectsPrevious.Clear();
267 m_RunningEffectsPrevious.Copy(m_RunningEffects);
273 m_RunningEffects.Insert(
value);
276 if (m_RunningEffectsPrevious.Count() != m_RunningEffects.Count())
285 m_RunningEffectsPrevious.Copy(m_RunningEffects);
294 m_RunningEffects.Remove(
idx);
297 if (m_RunningEffectsPrevious.Count() != m_RunningEffects.Count())
308 int count = m_RunningEffects.Count();
312 data = m_WidgetDataMap.Get(m_RunningEffects[
i]);
317 m_RunningEffectsPrevious.Copy(m_RunningEffects);
318 m_RunningEffects.Clear();
324 return m_RunningEffects && m_RunningEffects.Count() > 0;
337 m_SuspendRequests.Remove(
idx);
343 m_SuspendRequests.Clear();
349 return m_SuspendRequests.Count();
363 for (
int i = 0;
i < m_UpdatingEffects.Count();
i++)
365 if (m_RunningEffects.Find(m_UpdatingEffects.Get(
i)) != -1)
371 if (
dta.HasDefinedHandle() &&
dta.DataInitialized())
381 if (
w.IsVisibleHierarchy() && m_UpdatedWidgetsCheck.Find(
w) == -1)
383 m_UpdatedWidgetsCheck.Insert(
w);
393 if (m_RunningEffects.Find(type) != -1)
395 dta = m_WidgetDataMap.Get(type);
397 if (
dta.HasDefinedHandle() &&
dta.DataInitialized())
407 if (
w2.IsVisibleHierarchy() && m_UpdatedWidgetsCheck.Find(
w2) == -1)
409 m_UpdatedWidgetsCheck.Insert(
w2);
417 m_UpdatedWidgetsCheck.Clear();
418 m_UpdatedWidgetSetsCheck.Clear();
424 if (m_UpdatedWidgetSetsCheck.Find(m_WidgetDataMap.Get(type).GetWidgetSetID()) != -1)
461 m_UpdatedWidgetSetsCheck.Insert(m_WidgetDataMap.Get(type).GetWidgetSetID());
501 const float BREATH_HDR_MIN = 0.005;
502 const float BREATH_HDR_MAX = 1.0;
503 const float BREATH_COLOR_MULT_MIN = 0.5;
504 const float BREATH_COLOR_MULT_MAX = 0.8;
513 m_BreathResidue -= speed;
514 m_BreathResidue =
Math.
Clamp(m_BreathResidue, 0, 1);
530 w.SetColor(m_BreathColor);
531 w.SetAlpha(m_BreathAlphaVal);
551 m_FlashbangCoverAlphaVal =
par.param1;
562 w.SetAlpha(1 - m_FlashbangCoverAlphaVal);
590 if (m_SuspendRequests.Count() > 0)
619 m_BreathResidue =
Math.
Clamp(m_BreathResidue, 0, 1);
Manages all bleeding indicators and their updates.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
proto native float GetSceneHDRMul(int camera)
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
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,...
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.