DayZ 1.24
Loading...
Searching...
No Matches
GameplayEffectWidgets_base Class Reference

grouped gameplay effect widgets and their handling More...

Collaboration diagram for GameplayEffectWidgets_base:
[legend]

Protected Member Functions

void GameplayEffectWidgets ()
 
void ~GameplayEffectWidgets ()
 
void RegisterLayouts (string path, array< int > types)
 Registers new layout and ties effect IDs to it.
 
void PairIDToTypes ()
 
 TranslateIDToType (int typeID)
 
override void RegisterGameplayEffectData (int id, Param p)
 
void InitWidgetSet (int type, bool updating=false, int user_id_override=-1)
 InitWidgetSet.
 
bool CreateHandledClass (typename handled_type, array< ref Widget > input, int type, int user_override)
 
array< intCompileEffectListing ()
 returns all vanilla effects, nested in a vanilla layout. If using different layouts for custom effects, please register and link separately
 
void UpdateVisibility ()
 
override void AddActiveEffects (array< int > effects)
 
override void RemoveActiveEffects (array< int > effects)
 
override void StopAllEffects ()
 
override bool IsAnyEffectRunning ()
 
override void AddSuspendRequest (int request_id)
 
override void RemoveSuspendRequest (int request_id)
 
override void ClearSuspendRequests ()
 
override int GetSuspendRequestCount ()
 
override void UpdateWidgets (int type=-1, float timeSlice=0, Param p=null, int handle=-1)
 Usually called in course of an OnFrame update, can be manually called from elsewhere with parameters.
 
void CalculateValues (int type=-1, float timeSlice=0, Param p=null, int handle=-1)
 Only one calculation per unique WidgetSet.
 
void ProcessWidgetUpdate (Widget w, int type, float timeSlice=0, Param p=null, int handle=-1)
 
void CalculateBreathEffect (float timeSlice=0, int type=-1, Param p=null)
 
void UpdateBreathEffect (ImageWidget w)
 
void CalculateOccluderEffect (int type, float timeSlice, Param p, int handle)
 
void UpdateOccluderEffect (ImageWidget w, int type, float timeSlice, Param p, int handle)
 
void CalculateFlashbangEffect (int type, float timeSlice, Param p, int handle)
 
void UpdateFlashbangEffect (ImageWidget w)
 
void HandleWidgetRoot (float timeSlice=0, Param p=null, int handle=-1)
 
override void Update (float timeSlice)
 Generic update, called on frame from the player.
 
override void OnVoiceEvent (float breathing_resistance01)
 

Protected Attributes

ref Widget m_Root
 
ref map< int, ref Widgetm_Layouts
 
ref set< ref Widgetm_UniqueLayouts
 
ref GameplayEffectDataMap m_WidgetDataMap
 
ref set< intm_RunningEffects
 
ref set< intm_RunningEffectsPrevious
 
ref array< intm_UpdatingEffects
 
ref array< ref Widgetm_UpdatedWidgetsCheck
 
ref array< intm_UpdatedWidgetSetsCheck
 
ref set< intm_SuspendRequests
 
ref map< int, typenamem_IDToTypeMap
 
float m_TimeProgBreath
 
float m_BreathMultStamina
 
float m_BreathResidue
 
const int WIDGETSET_BREATH = 100
 
int m_BreathColor
 
float m_BreathAlphaVal
 
float m_FlashbangCoverAlphaVal
 
const float BREATH_HDR_MIN = 0.005
 
const float BREATH_HDR_MAX = 1.0
 
const float BREATH_COLOR_MULT_MIN = 0.5
 
const float BREATH_COLOR_MULT_MAX = 0.8
 

Detailed Description

grouped gameplay effect widgets and their handling

Definition at line 6 of file GameplayEffectWidgets.c.

Constructor & Destructor Documentation

◆ ~GameplayEffectWidgets()

void GameplayEffectWidgets_base::~GameplayEffectWidgets ( )
inlineprotected

Definition at line 73 of file GameplayEffectWidgets.c.

74 {
75 for (int i = 0; i < m_Layouts.Count(); i++)
76 {
77 if (m_Layouts.GetElement(i))
78 m_Layouts.GetElement(i).Unlink();
79 }
80 }
ref map< int, ref Widget > m_Layouts

Member Function Documentation

◆ AddActiveEffects()

override void GameplayEffectWidgets_base::AddActiveEffects ( array< int > effects)
inlineprotected

Definition at line 263 of file GameplayEffectWidgets.c.

264 {
265 if (effects && effects.Count() > 0)
266 {
268
269 int value;
270 for (int i = 0; i < effects.Count(); i++)
271 {
272 value = effects.Get(i);
273 m_RunningEffects.Insert(value);
274 }
275
276 if (m_RunningEffectsPrevious.Count() != m_RunningEffects.Count())
278 }
279 }

References UpdateVisibility().

Referenced by ManBase::OnCommandHandlerTick().

◆ AddSuspendRequest()

override void GameplayEffectWidgets_base::AddSuspendRequest ( int request_id)
inlineprotected

Definition at line 327 of file GameplayEffectWidgets.c.

328 {
331 }

References UpdateVisibility().

Referenced by ManBase::OnUnconsciousStart().

◆ CalculateBreathEffect()

void GameplayEffectWidgets_base::CalculateBreathEffect ( float timeSlice = 0,
int type = -1,
Param p = null )
inlineprotected

Definition at line 509 of file GameplayEffectWidgets.c.

510 {
511 float modifier = Math.Lerp(0.25, 0.5, m_BreathResidue);
512 float speed = timeSlice * modifier;
513 m_BreathResidue -= speed;
515 float residue_final = Math.Lerp(0, 0.7, m_BreathResidue);
516
517 float hdr_mult;
522 m_BreathColor = ARGBF(0.0, 1.0 * hdr_mult, 1.0 * hdr_mult, 1.0 * hdr_mult); //grayscaling of the image
523
524
526 }
Definition EnMath.c:7
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.
Definition proto.c:332

References ARGBF(), Math::Clamp(), GetSceneHDRMul(), Math::InverseLerp(), and Math::Lerp().

Referenced by CalculateValues().

◆ CalculateFlashbangEffect()

void GameplayEffectWidgets_base::CalculateFlashbangEffect ( int type,
float timeSlice,
Param p,
int handle )
inlineprotected

Definition at line 548 of file GameplayEffectWidgets.c.

549 {
552
553 /*if (m_FlashbangCoverAlphaVal <= 0.0)
554 {
555 RemoveActiveEffects({EffectWidgetsTypes.COVER_FLASHBANG});
556 return;
557 }*/
558 }

Referenced by CalculateValues().

◆ CalculateOccluderEffect()

void GameplayEffectWidgets_base::CalculateOccluderEffect ( int type,
float timeSlice,
Param p,
int handle )
inlineprotected

Definition at line 537 of file GameplayEffectWidgets.c.

538 {
539 }

Referenced by CalculateValues().

◆ CalculateValues()

void GameplayEffectWidgets_base::CalculateValues ( int type = -1,
float timeSlice = 0,
Param p = null,
int handle = -1 )
inlineprotected

Only one calculation per unique WidgetSet.

Definition at line 422 of file GameplayEffectWidgets.c.

423 {
424 if (m_UpdatedWidgetSetsCheck.Find(m_WidgetDataMap.Get(type).GetWidgetSetID()) != -1)
425 {
426 //Print("skipped updating set ID " + m_WidgetDataMap.Get(type).GetWidgetSetID() + " | effect: " + type);
427 return;
428 }
429
430 switch (type)
431 {
432 case EffectWidgetsTypes.MOTO_BREATH:
433 case EffectWidgetsTypes.HELMET_BREATH:
434 case EffectWidgetsTypes.MASK_BREATH:
435 {
437 }
438 break;
439
440 case EffectWidgetsTypes.MOTO_OCCLUDER:
441 case EffectWidgetsTypes.EYEPATCH_OCCLUDER:
442 case EffectWidgetsTypes.HELMET_OCCLUDER:
443 case EffectWidgetsTypes.HELMET2_OCCLUDER:
444 case EffectWidgetsTypes.MASK_OCCLUDER:
445 {
446 CalculateOccluderEffect(type, timeSlice, p, handle);
447 }
448 break;
449
450 case EffectWidgetsTypes.COVER_FLASHBANG:
451 {
452 CalculateFlashbangEffect(type, timeSlice, p, handle);
453 }
454 break;
455
456 default:
457 return; //no need to calculate anything
458 break;
459 }
460
461 m_UpdatedWidgetSetsCheck.Insert(m_WidgetDataMap.Get(type).GetWidgetSetID());
462 }
ref array< int > m_UpdatedWidgetSetsCheck
void CalculateFlashbangEffect(int type, float timeSlice, Param p, int handle)
ref GameplayEffectDataMap m_WidgetDataMap
void CalculateBreathEffect(float timeSlice=0, int type=-1, Param p=null)
void CalculateOccluderEffect(int type, float timeSlice, Param p, int handle)

References CalculateBreathEffect(), CalculateFlashbangEffect(), and CalculateOccluderEffect().

Referenced by UpdateWidgets().

◆ ClearSuspendRequests()

override void GameplayEffectWidgets_base::ClearSuspendRequests ( )
inlineprotected

Definition at line 341 of file GameplayEffectWidgets.c.

342 {
343 m_SuspendRequests.Clear();
345 }

References UpdateVisibility().

Referenced by ManBase::SimulateDeath().

◆ CompileEffectListing()

array< int > GameplayEffectWidgets_base::CompileEffectListing ( )
inlineprotected

returns all vanilla effects, nested in a vanilla layout. If using different layouts for custom effects, please register and link separately

Definition at line 181 of file GameplayEffectWidgets.c.

182 {
184 ret.Insert(EffectWidgetsTypes.MASK_OCCLUDER);
185 ret.Insert(EffectWidgetsTypes.MASK_BREATH);
186 ret.Insert(EffectWidgetsTypes.HELMET_OCCLUDER);
187 ret.Insert(EffectWidgetsTypes.HELMET_BREATH);
188 ret.Insert(EffectWidgetsTypes.MOTO_OCCLUDER);
189 ret.Insert(EffectWidgetsTypes.MOTO_BREATH);
190 ret.Insert(EffectWidgetsTypes.COVER_FLASHBANG);
191 ret.Insert(EffectWidgetsTypes.NVG_OCCLUDER);
192 ret.Insert(EffectWidgetsTypes.PUMPKIN_OCCLUDER);
193 ret.Insert(EffectWidgetsTypes.EYEPATCH_OCCLUDER);
194 ret.Insert(EffectWidgetsTypes.HELMET2_OCCLUDER);
195
196 return ret;
197 }

Referenced by GameplayEffectWidgets().

◆ CreateHandledClass()

bool GameplayEffectWidgets_base::CreateHandledClass ( typename handled_type ,
array< ref Widget > input,
int type,
int user_override )
inlineprotected

Definition at line 168 of file GameplayEffectWidgets.c.

169 {
170 if (handled_type)
171 {
173 data.Init(input, type, m_Layouts.Get(type), user_override);
174 m_WidgetDataMap.Set(type, data);
175 return true;
176 }
177 return false;
178 }
Manages all bleeding indicators and their updates.

Referenced by InitWidgetSet().

◆ GameplayEffectWidgets()

void GameplayEffectWidgets_base::GameplayEffectWidgets ( )
inlineprotected

Definition at line 32 of file GameplayEffectWidgets.c.

33 {
34 m_Root = GetGame().GetWorkspace().CreateWidget(FrameWidgetTypeID, 0, 0, 1.0, 1.0, WidgetFlags.VISIBLE | WidgetFlags.HEXACTPOS | WidgetFlags.VEXACTPOS, 0xffffffff, 0);
45
46 m_TimeProgBreath = 0.0;
48
50
51 RegisterLayouts("gui/layouts/gameplay/CameraEffects.layout", CompileEffectListing());
52 RegisterLayouts("gui/layouts/gameplay/BleedingEffects.layout", {EffectWidgetsTypes.BLEEDING_LAYER});
53
57
58 InitWidgetSet(EffectWidgetsTypes.MASK_OCCLUDER, false, EffectWidgetsTypes.MASK_OCCLUDER);
59 InitWidgetSet(EffectWidgetsTypes.HELMET_OCCLUDER);
60 InitWidgetSet(EffectWidgetsTypes.HELMET2_OCCLUDER);
61 InitWidgetSet(EffectWidgetsTypes.MOTO_OCCLUDER);
62 InitWidgetSet(EffectWidgetsTypes.NVG_OCCLUDER, false, EffectWidgetsTypes.NVG_OCCLUDER);
63 InitWidgetSet(EffectWidgetsTypes.PUMPKIN_OCCLUDER, false, EffectWidgetsTypes.NVG_OCCLUDER);
64 InitWidgetSet(EffectWidgetsTypes.EYEPATCH_OCCLUDER);
65
66 InitWidgetSet(EffectWidgetsTypes.COVER_FLASHBANG);
67
68 InitWidgetSet(EffectWidgetsTypes.BLEEDING_LAYER, true);
69
71 }
map< int, ref GameplayEffectsData > GameplayEffectDataMap
array< int > CompileEffectListing()
returns all vanilla effects, nested in a vanilla layout. If using different layouts for custom effect...
void RegisterLayouts(string path, array< int > types)
Registers new layout and ties effect IDs to it.
ref map< int, typename > m_IDToTypeMap
ref set< ref Widget > m_UniqueLayouts
void InitWidgetSet(int type, bool updating=false, int user_id_override=-1)
InitWidgetSet.
ref array< ref Widget > m_UpdatedWidgetsCheck
proto native CGame GetGame()
WidgetFlags
Definition EnWidgets.c:58

References CompileEffectListing(), GetGame(), InitWidgetSet(), m_Root, PairIDToTypes(), RegisterLayouts(), and UpdateVisibility().

◆ GetSuspendRequestCount()

override int GameplayEffectWidgets_base::GetSuspendRequestCount ( )
inlineprotected

Definition at line 347 of file GameplayEffectWidgets.c.

348 {
349 return m_SuspendRequests.Count();
350 }

◆ HandleWidgetRoot()

void GameplayEffectWidgets_base::HandleWidgetRoot ( float timeSlice = 0,
Param p = null,
int handle = -1 )
inlineprotected

Definition at line 568 of file GameplayEffectWidgets.c.

569 {
570 switch (handle)
571 {
572 default:
573 {
575 if (par)
576 {
577 float alpha_mod = Math.Clamp(par.param1, 0.0, 1.0);
578 //Print(alpha_mod);
579 m_Root.SetAlpha(alpha_mod);
580 }
581 }
582 break;
583 }
584 }

References Math::Clamp(), and m_Root.

Referenced by UpdateWidgets().

◆ InitWidgetSet()

void GameplayEffectWidgets_base::InitWidgetSet ( int type,
bool updating = false,
int user_id_override = -1 )
inlineprotected

InitWidgetSet.

Parameters
typeint ID of effect widget type
updatingbool Marks widgets for 'PlayerBase.EOnFrame' updating
user_id_overrideint UserID of a widget to be used instead (allows multiple types to use single widget)
Note
All child widgets MUST be of the same type if special functionality is required (ImageWidget etc.)

Definition at line 121 of file GameplayEffectWidgets.c.

122 {
123 Widget parent = null;
124 if (user_id_override != -1)
125 parent = m_Layouts.Get(type).FindAnyWidgetById(user_id_override);
126 else
127 parent = m_Layouts.Get(type).FindAnyWidgetById(type);
128
129 if (!parent)
130 {
131 Print("InitWidgetSet | type: " + type + " - parent not found!");
132 return;
133 }
134
136 Widget w = parent.GetChildren();
137 if (w)
138 {
140 while (w)
141 {
142 w.Update();
143 w.Show(false, true);
144 output.Insert(w);
145
146 w = w.GetSibling();
147 }
148
149 if (parent.GetChildren())
150 {
151 typename handled_type = TranslateIDToType(type);
152 if (handled_type)
154 else
155 {
156 if (ImageWidget.Cast(parent.GetChildren()))
158 else
160 }
161 }
162
163 if (updating)
164 m_UpdatingEffects.Insert(type);
165 }
166 }
void GameplayEffectsDataImage(array< ref Widget > input, int type, int user_override=-1)
bool CreateHandledClass(typename handled_type, array< ref Widget > input, int type, int user_override)
proto void Print(void var)
Prints content of variable to console/log.

References CreateHandledClass(), GameplayEffectsDataImage(), Print(), and TranslateIDToType().

Referenced by GameplayEffectWidgets().

◆ IsAnyEffectRunning()

override bool GameplayEffectWidgets_base::IsAnyEffectRunning ( )
inlineprotected

Definition at line 322 of file GameplayEffectWidgets.c.

323 {
324 return m_RunningEffects && m_RunningEffects.Count() > 0;
325 }

Referenced by ManBase::EOnFrame(), and StopAllEffects().

◆ OnVoiceEvent()

override void GameplayEffectWidgets_base::OnVoiceEvent ( float breathing_resistance01)
inlineprotected

Definition at line 616 of file GameplayEffectWidgets.c.

References Math::Clamp(), and Math::Lerp().

Referenced by ManBase::UpdateMaskBreathWidget().

◆ PairIDToTypes()

void GameplayEffectWidgets_base::PairIDToTypes ( )
inlineprotected

Definition at line 95 of file GameplayEffectWidgets.c.

96 {
97 m_IDToTypeMap.Insert(EffectWidgetsTypes.BLEEDING_LAYER, GameplayEffectsDataBleeding);
98 }

Referenced by GameplayEffectWidgets().

◆ ProcessWidgetUpdate()

void GameplayEffectWidgets_base::ProcessWidgetUpdate ( Widget w,
int type,
float timeSlice = 0,
Param p = null,
int handle = -1 )
inlineprotected

Definition at line 464 of file GameplayEffectWidgets.c.

465 {
466 switch (type)
467 {
468 case EffectWidgetsTypes.MOTO_BREATH:
469 case EffectWidgetsTypes.HELMET_BREATH:
470 case EffectWidgetsTypes.MASK_BREATH:
471 {
473 }
474 break;
475
476 case EffectWidgetsTypes.MOTO_OCCLUDER:
477 case EffectWidgetsTypes.EYEPATCH_OCCLUDER:
478 case EffectWidgetsTypes.HELMET_OCCLUDER:
479 case EffectWidgetsTypes.HELMET2_OCCLUDER:
480 case EffectWidgetsTypes.MASK_OCCLUDER:
481 {
482 UpdateOccluderEffect(ImageWidget.Cast(w), type, timeSlice, p, handle);
483 }
484 break;
485
486 case EffectWidgetsTypes.COVER_FLASHBANG:
487 {
489 }
490 break;
491
492 default:
493 //Print("---invalid widget type to update---");
494 break;
495 }
496 }
void UpdateBreathEffect(ImageWidget w)
void UpdateFlashbangEffect(ImageWidget w)
void UpdateOccluderEffect(ImageWidget w, int type, float timeSlice, Param p, int handle)

References UpdateBreathEffect(), UpdateFlashbangEffect(), and UpdateOccluderEffect().

Referenced by UpdateWidgets().

◆ RegisterGameplayEffectData()

override void GameplayEffectWidgets_base::RegisterGameplayEffectData ( int id,
Param p )
inlineprotected

Definition at line 105 of file GameplayEffectWidgets.c.

106 {
107 if (!m_WidgetDataMap.Get(id).DataInitialized())
108 m_WidgetDataMap.Get(id).RegisterData(p);
109 }

◆ RegisterLayouts()

void GameplayEffectWidgets_base::RegisterLayouts ( string path,
array< int > types )
inlineprotected

Registers new layout and ties effect IDs to it.

Note
Order of layout creation matters, they get layered on top of each other. Within a single layout, widget priorities govern the widget order.

Definition at line 86 of file GameplayEffectWidgets.c.

87 {
88 Widget w = GetGame().GetWorkspace().CreateWidgets(path, m_Root, false);
89 m_UniqueLayouts.Insert(w);
90 w.Show(false);
91 foreach (int i : types)
92 m_Layouts.Set(i, w);
93 }

References GetGame(), m_Root, and path.

Referenced by GameplayEffectWidgets().

◆ RemoveActiveEffects()

override void GameplayEffectWidgets_base::RemoveActiveEffects ( array< int > effects)
inlineprotected

Definition at line 281 of file GameplayEffectWidgets.c.

282 {
283 if (effects && effects.Count() > 0)
284 {
286
287 int value;
288 int idx;
289 for (int i = 0; i < effects.Count(); i++)
290 {
291 value = effects.Get(i);
292 idx = m_RunningEffects.Find(value);
293 if (idx != -1)
294 m_RunningEffects.Remove(idx);
295 }
296
297 if (m_RunningEffectsPrevious.Count() != m_RunningEffects.Count())
299 }
300 }

References UpdateVisibility().

Referenced by ManBase::OnCommandHandlerTick().

◆ RemoveSuspendRequest()

override void GameplayEffectWidgets_base::RemoveSuspendRequest ( int request_id)
inlineprotected

Definition at line 333 of file GameplayEffectWidgets.c.

334 {
335 int idx = m_SuspendRequests.Find(request_id);
336 if (idx != -1)
337 m_SuspendRequests.Remove(idx);
339 }

References UpdateVisibility().

Referenced by ManBase::OnUnconsciousStop().

◆ StopAllEffects()

override void GameplayEffectWidgets_base::StopAllEffects ( )
inlineprotected

Definition at line 302 of file GameplayEffectWidgets.c.

303 {
304 m_Root.Show(false); //to avoid visual 'peeling'
305
306 if (IsAnyEffectRunning())
307 {
308 int count = m_RunningEffects.Count();
310 for (int i = 0; i < count; i++) //iterates over running metadata, in case anything requires its own stop handling
311 {
313 data.ForceStop();
314 }
315 }
316
318 m_RunningEffects.Clear();
320 }

References IsAnyEffectRunning(), m_Root, and UpdateVisibility().

Referenced by ManBase::SimulateDeath().

◆ TranslateIDToType()

GameplayEffectWidgets_base::TranslateIDToType ( int typeID)
inlineprotected

Definition at line 100 of file GameplayEffectWidgets.c.

101 {
102 return m_IDToTypeMap.Get(typeID);
103 }

Referenced by InitWidgetSet().

◆ Update()

override void GameplayEffectWidgets_base::Update ( float timeSlice)
inlineprotected

Generic update, called on frame from the player.

Definition at line 588 of file GameplayEffectWidgets.c.

589 {
590 if (m_SuspendRequests.Count() > 0)
591 return;
592
594 }
override void UpdateWidgets(int type=-1, float timeSlice=0, Param p=null, int handle=-1)
Usually called in course of an OnFrame update, can be manually called from elsewhere with parameters.

References UpdateWidgets().

Referenced by ManBase::EOnFrame().

◆ UpdateBreathEffect()

void GameplayEffectWidgets_base::UpdateBreathEffect ( ImageWidget w)
inlineprotected

Definition at line 528 of file GameplayEffectWidgets.c.

529 {
530 w.SetColor(m_BreathColor);
531 w.SetAlpha(m_BreathAlphaVal);
532 }

Referenced by ProcessWidgetUpdate().

◆ UpdateFlashbangEffect()

void GameplayEffectWidgets_base::UpdateFlashbangEffect ( ImageWidget w)
inlineprotected

Definition at line 560 of file GameplayEffectWidgets.c.

561 {
562 w.SetAlpha(1 - m_FlashbangCoverAlphaVal);
563 }

Referenced by ProcessWidgetUpdate().

◆ UpdateOccluderEffect()

void GameplayEffectWidgets_base::UpdateOccluderEffect ( ImageWidget w,
int type,
float timeSlice,
Param p,
int handle )
inlineprotected

Definition at line 541 of file GameplayEffectWidgets.c.

542 {
543 }

Referenced by ProcessWidgetUpdate().

◆ UpdateVisibility()

void GameplayEffectWidgets_base::UpdateVisibility ( )
inlineprotected

Definition at line 199 of file GameplayEffectWidgets.c.

200 {
201 Widget w;
202 //Hide diff
203 int value;
207 for (int i = 0; i < m_RunningEffectsPrevious.Count(); i++)
208 {
211 if (runningEffectCount < 1 || m_RunningEffects.Find(value) == -1)
212 {
213 if (dta.HasDefinedHandle())
214 dta.UpdateVisibility(false);
215 else
216 {
217 for (int j = 0; j < m_WidgetDataMap.Get(value).GetWidgetSet().Count(); j++)
218 {
219 w = m_WidgetDataMap.Get(value).GetWidgetSet().Get(j);
220 w.Show(false);
221 }
222 w.GetParent().Show(false);
223 }
224 }
225 }
226
227 //Show running effects
229 {
230 value = 0;
231 for (i = 0; i < runningEffectCount; i++)
232 {
233 value = m_RunningEffects.Get(i);
235 if (dta.HasDefinedHandle())
236 {
237 dta.m_LayoutRoot.Show(true);
238 dta.UpdateVisibility(true);
239 }
240 else
241 {
242 for (j = 0; j < m_WidgetDataMap.Get(value).GetWidgetSet().Count(); j++)
243 {
244 w = m_WidgetDataMap.Get(value).GetWidgetSet().Get(j);
245 w.Update();
246 w.Show(true);
247 }
248
249 while (w) //dumb but necessary because of uncertain "visible" setting of the layout
250 {
251 w = w.GetParent();
252 if (w)
253 w.Show(true);
254 }
255 }
256 }
257 }
258
261 }

References Count, and m_Root.

Referenced by AddActiveEffects(), AddSuspendRequest(), ClearSuspendRequests(), GameplayEffectWidgets(), RemoveActiveEffects(), RemoveSuspendRequest(), and StopAllEffects().

◆ UpdateWidgets()

override void GameplayEffectWidgets_base::UpdateWidgets ( int type = -1,
float timeSlice = 0,
Param p = null,
int handle = -1 )
inlineprotected

Usually called in course of an OnFrame update, can be manually called from elsewhere with parameters.

Definition at line 353 of file GameplayEffectWidgets.c.

354 {
357
358 if (type == EffectWidgetsTypes.ROOT)
359 HandleWidgetRoot(timeSlice, p, handle);
360 else if (type == -1) //update stuff from the m_UpdatingEffects
361 {
362 int type_widgetset = 0;
363 for (int i = 0; i < m_UpdatingEffects.Count(); i++)
364 {
365 if (m_RunningEffects.Find(m_UpdatingEffects.Get(i)) != -1)
366 {
368
370
371 if (dta.HasDefinedHandle() && dta.DataInitialized())
372 {
373 dta.Update(timeSlice, p, handle); //calculate and apply
374 }
375 else
376 {
378 widget_set = dta.GetWidgetSet();
379 foreach (Widget w : widget_set)
380 {
381 if (w.IsVisibleHierarchy() && m_UpdatedWidgetsCheck.Find(w) == -1)
382 {
383 m_UpdatedWidgetsCheck.Insert(w);
385 }
386 }
387 }
388 }
389 }
390 }
391 else //update specific widget set
392 {
393 if (m_RunningEffects.Find(type) != -1) //only do if the effect is running (FPS stonks!)
394 {
395 dta = m_WidgetDataMap.Get(type);
396
397 if (dta.HasDefinedHandle() && dta.DataInitialized())
398 {
399 dta.Update(timeSlice, p, handle); //calculate and apply
400 }
401 else
402 {
403 CalculateValues(type, timeSlice, p, handle);
404 widget_set = dta.GetWidgetSet();
405 foreach (Widget w2 : widget_set)
406 {
407 if (w2.IsVisibleHierarchy() && m_UpdatedWidgetsCheck.Find(w2) == -1)
408 {
410 ProcessWidgetUpdate(w2, type, timeSlice, p, handle);
411 }
412 }
413 }
414 }
415 }
416
417 m_UpdatedWidgetsCheck.Clear();
419 }
void ProcessWidgetUpdate(Widget w, int type, float timeSlice=0, Param p=null, int handle=-1)
void HandleWidgetRoot(float timeSlice=0, Param p=null, int handle=-1)
void CalculateValues(int type=-1, float timeSlice=0, Param p=null, int handle=-1)
Only one calculation per unique WidgetSet.

References CalculateValues(), HandleWidgetRoot(), and ProcessWidgetUpdate().

Referenced by ScriptedWidgetEventHandler::OnBleedingIndicationChanged(), and Update().

Member Data Documentation

◆ BREATH_COLOR_MULT_MAX

const float GameplayEffectWidgets_base::BREATH_COLOR_MULT_MAX = 0.8
protected

Definition at line 504 of file GameplayEffectWidgets.c.

◆ BREATH_COLOR_MULT_MIN

const float GameplayEffectWidgets_base::BREATH_COLOR_MULT_MIN = 0.5
protected

Definition at line 503 of file GameplayEffectWidgets.c.

◆ BREATH_HDR_MAX

const float GameplayEffectWidgets_base::BREATH_HDR_MAX = 1.0
protected

Definition at line 502 of file GameplayEffectWidgets.c.

◆ BREATH_HDR_MIN

const float GameplayEffectWidgets_base::BREATH_HDR_MIN = 0.005
protected

Definition at line 501 of file GameplayEffectWidgets.c.

◆ m_BreathAlphaVal

float GameplayEffectWidgets_base::m_BreathAlphaVal
protected

Definition at line 29 of file GameplayEffectWidgets.c.

◆ m_BreathColor

int GameplayEffectWidgets_base::m_BreathColor
protected

Definition at line 28 of file GameplayEffectWidgets.c.

◆ m_BreathMultStamina

float GameplayEffectWidgets_base::m_BreathMultStamina
protected

Definition at line 21 of file GameplayEffectWidgets.c.

◆ m_BreathResidue

float GameplayEffectWidgets_base::m_BreathResidue
protected

Definition at line 22 of file GameplayEffectWidgets.c.

◆ m_FlashbangCoverAlphaVal

float GameplayEffectWidgets_base::m_FlashbangCoverAlphaVal
protected

Definition at line 30 of file GameplayEffectWidgets.c.

◆ m_IDToTypeMap

ref map<int, typename> GameplayEffectWidgets_base::m_IDToTypeMap
protected

Definition at line 18 of file GameplayEffectWidgets.c.

◆ m_Layouts

ref map<int, ref Widget> GameplayEffectWidgets_base::m_Layouts
protected

Definition at line 9 of file GameplayEffectWidgets.c.

◆ m_Root

ref Widget GameplayEffectWidgets_base::m_Root
protected

Definition at line 8 of file GameplayEffectWidgets.c.

◆ m_RunningEffects

ref set<int> GameplayEffectWidgets_base::m_RunningEffects
protected

Definition at line 12 of file GameplayEffectWidgets.c.

◆ m_RunningEffectsPrevious

ref set<int> GameplayEffectWidgets_base::m_RunningEffectsPrevious
protected

Definition at line 13 of file GameplayEffectWidgets.c.

◆ m_SuspendRequests

ref set<int> GameplayEffectWidgets_base::m_SuspendRequests
protected

Definition at line 17 of file GameplayEffectWidgets.c.

◆ m_TimeProgBreath

float GameplayEffectWidgets_base::m_TimeProgBreath
protected

Definition at line 20 of file GameplayEffectWidgets.c.

◆ m_UniqueLayouts

ref set<ref Widget> GameplayEffectWidgets_base::m_UniqueLayouts
protected

Definition at line 10 of file GameplayEffectWidgets.c.

◆ m_UpdatedWidgetsCheck

ref array<ref Widget> GameplayEffectWidgets_base::m_UpdatedWidgetsCheck
protected

Definition at line 15 of file GameplayEffectWidgets.c.

◆ m_UpdatedWidgetSetsCheck

ref array<int> GameplayEffectWidgets_base::m_UpdatedWidgetSetsCheck
protected

Definition at line 16 of file GameplayEffectWidgets.c.

◆ m_UpdatingEffects

ref array<int> GameplayEffectWidgets_base::m_UpdatingEffects
protected

Definition at line 14 of file GameplayEffectWidgets.c.

◆ m_WidgetDataMap

ref GameplayEffectDataMap GameplayEffectWidgets_base::m_WidgetDataMap
protected

Definition at line 11 of file GameplayEffectWidgets.c.

◆ WIDGETSET_BREATH

const int GameplayEffectWidgets_base::WIDGETSET_BREATH = 100
protected

Definition at line 25 of file GameplayEffectWidgets.c.


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