Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AvailableActionsDisplay.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
2class SCR_AvailableActionsWidget
3{
6
9
10 protected bool m_bMustUpdate;
11
12 protected const string BUTTON_WIDGET_NAME = "NavigationButton1";
14 //------------------------------------------------------------------------------------------------
17 {
18 m_bMustUpdate = true;
19 }
20
21 //------------------------------------------------------------------------------------------------
22 void SetText(string text, string name, EInputDeviceType currentInputDevice = EInputDeviceType.KEYBOARD)
23 {
25 return;
26
27 if (m_NavigationButton.SetAction(text, currentInputDevice, m_bMustUpdate))
29 else
30 SetVisible(false);
31
32 if (m_bMustUpdate)
33 m_bMustUpdate = false;
34 }
35
36 //------------------------------------------------------------------------------------------------
37 void SetSize(int size)
38 {
43 //------------------------------------------------------------------------------------------------
44 void SetVisible(bool isVisible)
45 {
46 if (m_wRootWidget)
47 m_wRootWidget.SetVisible(isVisible);
48 }
49
50
51 void SetPadding(float padding)
52 {
54 return;
55
56 float left, top, right, bottom;
57 OverlaySlot.GetPadding(m_wOverlayWidget, left, top, right, bottom);
58 OverlaySlot.SetPadding(m_wOverlayWidget, left, padding, right, padding);
59 }
60
61 //------------------------------------------------------------------------------------------------
62 bool IsVisible()
63 {
64 if (m_wRootWidget)
65 return m_wRootWidget.IsVisible();
66
67 return false;
68 }
69
70 //------------------------------------------------------------------------------------------------
71 static SCR_AvailableActionsWidget CreateActionsWidget(string layout, Widget parent, string text = "", string name = "")
72 {
73 if (layout == string.Empty)
74 return null;
75
76 if (!parent)
77 return null;
78
79 SCR_AvailableActionsWidget instance = new SCR_AvailableActionsWidget();
80 if (!instance)
81 return null;
82
83 Widget root = GetGame().GetWorkspace().CreateWidgets(layout, parent);
84 instance.m_wRootWidget = root;
85 if (root)
86 {
87 instance.m_wButtonWidget = ButtonWidget.Cast(root.FindAnyWidget(instance.BUTTON_WIDGET_NAME));
89
90 if (instance.m_NavigationButton)
92 }
93 instance.SetText(text, name);
94
95 return instance;
96 }
97
98 //------------------------------------------------------------------------------------------------
100
101 //------------------------------------------------------------------------------------------------
102 private void SCR_AvailableActionsWidget() {}
103
104 //------------------------------------------------------------------------------------------------
106 {
107 if (m_wRootWidget)
108 m_wRootWidget.RemoveFromHierarchy();
109 }
110};
112//------------------------------------------------------------------------------------------------
114{
115 //------------------------------------------------------------------------------------------------
116 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
117 {
118 // Make sure variable exists
119 int index = source.GetVarIndex("m_sAction");
120 if (index == -1)
121 return false;
122
123 // Tag string
124 string tag = "";
125 source.Get("m_sTag", tag);
126
127 source.Get("m_sAction", title);
128
129 // Enabled string
130 bool enabled;
131 source.Get("m_bEnabled", enabled);
132
133 string enabledStr = "x";
134 if (enabled)
135 enabledStr = "on";
136
137 // Setup title string
138 title = "(" + title + ") " + tag + " - " + enabledStr;
139
140 return true;
141 }
142};
143
144//------------------------------------------------------------------------------------------------
147{
148 [Attribute("true")]
149 protected bool m_bEnabled;
150
151 [Attribute("0", UIWidgets.EditBox, "Amount of milliseconds to hide this hint after it was shown, 0 means no hiding", params: "0 inf")]
152 protected int m_iTimeForHide;
153
154 [Attribute("0", UIWidgets.EditBox, "Amount of milliseconds that have to pass while conditions are met in oder for this hint to be shown", params: "0 inf")]
155 protected int m_iTimeToShow;
156
157 [Attribute("", UIWidgets.Object)]
158 protected ref array<ref SCR_AvailableActionCondition> m_aConditions;
159
160 [Attribute("DefaultTag", UIWidgets.EditBox, "Tag for quick search and recongnition. Change default tag to allow easier search.")]
161 protected string m_sTag;
162
163 [Attribute("", UIWidgets.EditBox, "Name of the action in action manager")]
164 protected string m_sAction;
165
166 [Attribute("", UIWidgets.EditBox, "Name of the action in to be displayed in UI")]
167 protected string m_sName;
168
169 protected const string MARKUP_FORMAT = "<action name=\"%1\"/>";
170
173
174 //------------------------------------------------------------------------------------------------
175 string ToString(bool forceText = true)
176 {
177 string text = "";
178 if (forceText)
179 text = string.Format(MARKUP_FORMAT, m_sAction);
180 else
181 text = string.Format(MARKUP_FORMAT, m_sAction);
182
183 return string.Format("%1", text);
184 }
185
186 //------------------------------------------------------------------------------------------------
188 {
189 return m_sAction;
190 }
191
192 //------------------------------------------------------------------------------------------------
193 // TODO: This should possibly be setup somewhere in the actions manager,
194 // so it can be reused instead of having to rely on setting it up manually in this object?
195 string GetUIName()
196 {
197 if (m_sName == string.Empty)
198 return m_sAction;
199
200 return m_sName;
201 }
202
203 //------------------------------------------------------------------------------------------------
205 {
206 if (!m_bEnabled)
207 return false;
208
209 bool isOk = true;
211 {
212 if (!cond.IsEnabled())
213 continue;
214
215 if (!cond.IsAvailable(data))
216 {
217 isOk = false;
218 break;
219 }
220 }
221
222 if (m_iTimeToShow > 0)
223 {// Show only when conditions were met for long enough
224 if (!isOk)
225 {
228 }
229 else if (m_fShowCountdown > 0)
230 {
231 m_fShowCountdown -= timeSlice * 1000;
232 }
233
234 isOk = isOk && m_fShowCountdown <= 0;
235 }
236
237 if (m_iTimeForHide > 0 && m_fShowCountdown <= 0)
238 {// Hide if time is over
239 if (!isOk)
241 else if (m_fHideCountdown > 0)
242 m_fHideCountdown -= timeSlice * 1000;
243
244 isOk = isOk && m_fHideCountdown > 0;
245 }
246
247 return isOk;
248 }
249
250 //------------------------------------------------------------------------------------------------
256
257 //------------------------------------------------------------------------------------------------
264}
265
266//------------------------------------------------------------------------------------------------
267class SCR_AvailableActionsDisplay : SCR_InfoDisplayExtended
268{
270 [Attribute("", UIWidgets.Object, "List of all actions to process at any given moment, these are filtered and available ones are displayed")]
271 protected ref array<ref SCR_AvailableActionContext> m_aActions;
272
273 [Attribute("", UIWidgets.ResourceNamePicker, "Layout used for individual action widgets", params: "layout")]
275
276 [Attribute()]
277 protected float m_fDefaultOffsetY;
278
279 protected float m_fOffsetY;
280 protected float m_fAdditionalOffsetY = 0;
281
282 [Attribute("", UIWidgets.Object, "")]
283 protected ref array<ref AvailableActionLayoutBehaviorBase> m_aBehaviors;
284
285 [Attribute("40", desc: "Size of the small button which will be used when there are too many bigger buttons. (Height in px)")]
286 protected int m_iButtonSizeSmall;
287
288 [Attribute("44", desc: "Size of the medium button which will be used when there are too many bigger buttons. (Height in px)")]
289 protected int m_iButtonSizeMedium;
290
291 [Attribute("48", desc: "Size of the large button. This is the maximum size of the shown button. If there are too many one of the above will be used instead. (Height in px)")]
292 protected int m_iButtonSizeLarge;
293
295 protected const int PRELOADED_WIDGETS_COUNT = 16;
296
298 protected ref array<ref SCR_AvailableActionsWidget> m_aWidgets = new array<ref SCR_AvailableActionsWidget>();
299
302
304 protected int m_iLastCount;
305
307 protected bool m_bIsEnabledSettings;
308
310 protected bool m_bForceUpdate;
311
313 protected EInputDeviceType m_eCurrentInputDevice;
314
319
321 protected float m_fDataFetchTimer;
322
324 protected int m_iMaxActionsBig = 5;
325 protected int m_iMaxActionsMedium = 7;
326
328 const int HEIGHT_DIVIDER_BIG = 70;
329 const int HEIGHT_DIVIDER_MEDIUM = 50;
330
331 const int HINT_SIZE_Y = 34;
332 const int DEFAULT_FONT_SIZE = 20;
333 const int MIN_FONT_SIZE = 16;
334
335 //protected ref array<SCR_AvailableActionContext> availableActions;
336 //protected int actionsCount;
337
338 //------------------------------------------------------------------------------------------------
342 protected int GetAvailableActions(notnull SCR_AvailableActionsConditionData data, array<ref SCR_AvailableActionContext> inActions, out array<SCR_AvailableActionContext> outActions, float timeSlice)
343 {
344 ArmaReforgerScripted game = GetGame();
345 if (!game)
346 return 0;
347
348 InputManager inputManager = game.GetInputManager();
349 if (!inputManager)
350 return 0;
351
352 outActions.Clear();
353 int count = 0;
354 foreach (SCR_AvailableActionContext action : inActions)
355 {
356 string actionName = action.GetActionName();
357
358 if (actionName == string.Empty)
359 continue;
360
361 if (!inputManager.IsActionActive(actionName))
362 {
363 if (action.IsDelayed())
364 action.ResetTimers();
365
366 continue;
367 }
368
369 if (!action.IsAvailable(data, timeSlice))
370 continue;
371
372 outActions.Insert(action);
373 count++;
374 }
375
376 return count;
377 }
378
379 //------------------------------------------------------------------------------------------------
380 protected bool CanBeShown(IEntity controlledEntity)
381 {
382 if (SCR_EditorManagerEntity.IsOpenedInstance())
383 return true;
384
385 ChimeraCharacter character = ChimeraCharacter.Cast(controlledEntity);
386 if (!character)
387 return false;
388
389 CharacterControllerComponent controller = character.GetCharacterController();
390 if (!controller)
391 return false;
392
393 ECharacterLifeState lifeState = controller.GetLifeState();
394 if (lifeState == ECharacterLifeState.ALIVE)
395 return true;
396
397 return false;
398 }
399
400 //------------------------------------------------------------------------------------------------
401 protected void UpdateIsEnabled()
402 {
403 // In case settings are not found, fallback to enabled
405
406 BaseContainer gameplaySettings = GetGame().GetGameUserSettings().GetModule("SCR_GameplaySettings");
408 gameplaySettings.Get("m_bControlHints", m_bIsEnabledSettings);
409 }
410
411 //------------------------------------------------------------------------------------------------
412 override event void DisplayUpdate(IEntity owner, float timeSlice)
413 {
414 if (!m_wRoot)
415 return; // Mandatory
416
417 //Check if the SlotUIComponent is still valid otherwise change to the new one
418 if (m_HUDSlotComponent != m_slotHandler.GetSlotUIComponent())
419 {
421 m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
422
423 m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
425 return;
426
427 m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
428 }
429
431
432 //~ Can show checks if controlledEntity is valid or if editor is open
433 if (m_bIsEnabledSettings && CanBeShown(controlledEntity))
434 m_wRoot.SetVisible(true);
435 else
436 {
437 m_wRoot.SetVisible(false);
438 return;
439 }
440
441 if (!m_data)
443
444 m_fDataFetchTimer += timeSlice;
445
446 if (m_fDataFetchTimer >= 0.25)
447 {
448 m_data.FetchData(controlledEntity, m_fDataFetchTimer);
449 DisplayWidgetsUpdate(m_fDataFetchTimer);
450
452 }
453 }
454
455 //------------------------------------------------------------------------------------------------
456 private void DisplayWidgetsUpdate(float timeSlice)
457 {
458 array<SCR_AvailableActionContext> availableActions = new array<SCR_AvailableActionContext>();
459 int actionsCount = GetAvailableActions(m_data, m_aActions, availableActions, timeSlice);
460
461 int updateCount = Math.Max(m_iLastCount, actionsCount);
462 bool shouldBeVisible;
463 SCR_AvailableActionContext availableAction;
464 foreach (int i, SCR_AvailableActionsWidget widget : m_aWidgets)
465 {
466 if (i >= updateCount)
467 break;
468
469 if (!widget)
470 continue;
471
472 shouldBeVisible = i < actionsCount;
473 if (widget.IsVisible() != shouldBeVisible)
474 {
475 if (shouldBeVisible)
476 DisplayHint(widget.GetRootWidget(), UIConstants.FADE_RATE_SUPER_FAST, UIConstants.FADE_RATE_SUPER_FAST);
477 else
478 HintFadeOut(widget.GetRootWidget(), UIConstants.FADE_RATE_DEFAULT, UIConstants.FADE_RATE_FAST);
479 }
480
481 if (actionsCount > m_iMaxActionsMedium)
482 widget.SetSize(m_iButtonSizeSmall);
483 else if (actionsCount > m_iMaxActionsBig)
484 widget.SetSize(m_iButtonSizeMedium);
485 else
486 widget.SetSize(m_iButtonSizeLarge);
487
488 if (!shouldBeVisible)
489 continue;
490
491 if (m_bForceUpdate)
492 widget.SetForcedUpdate();
493
494 if (!availableActions.IsIndexValid(i))
495 continue;
496
497 availableAction = availableActions[i];
498 if (availableAction)
499 widget.SetText(availableAction.GetActionName(), availableAction.GetUIName(), m_eCurrentInputDevice);
500 }
501
502 m_bForceUpdate = false;
503
504 // Acknowledge new count
505 m_iLastCount = actionsCount;
506
508 }
509
510 //------------------------------------------------------------------------------------------------
511 protected void DisplayHint(Widget widget, float delayFade, float delayShrink)
512 {
513 widget.SetOpacity(0);
514 VerticalLayoutSlot.SetPadding(widget, 0, -HINT_SIZE_Y, 0, 0);
515 widget.SetVisible(true);
516
517 // Clear hiding
518 GetGame().GetCallqueue().Remove(HintShrink);
519 GetGame().GetCallqueue().Remove(HintHide);
520
521 // Animations
522 float padding[4] = {0, 0, 0, 0};
523 AnimateWidget.Padding(widget, padding, delayShrink);
524 AnimateWidget.Opacity(widget, 1, delayFade);
525 }
526
527 //------------------------------------------------------------------------------------------------
529 protected void HintFadeOut(Widget widget, float delayFade, float delayShrink)
530 {
531 /*GetGame().GetCallqueue().Remove(HintShrink);
532 GetGame().GetCallqueue().Remove(HintHide);*/
533
534 AnimateWidget.Opacity(widget, 0, delayFade);
535 GetGame().GetCallqueue().CallLater(HintShrink, 1000 / delayFade, false, widget, delayShrink);
536 //HintShrink(widget, delayShrink);
537 }
538
539 //------------------------------------------------------------------------------------------------
541 protected void HintShrink(Widget widget, float delayShrink)
542 {
543 float padding[4] = {0, -HINT_SIZE_Y, 0, 0};
544 AnimateWidget.Padding(widget, padding, delayShrink);
545 GetGame().GetCallqueue().CallLater(HintHide, 1000 / delayShrink, false, widget);
546 }
547
548 //------------------------------------------------------------------------------------------------
550 protected void HintHide(Widget widget)
551 {
552 widget.SetVisible(false);
553 }
554
555 //------------------------------------------------------------------------------------------------
557 void SetOffsetY(float offset = -1)
558 {
559 return;
560 // Default position
561 if (offset == -1)
562 offset = m_fDefaultOffsetY;
563
564 m_fOffsetY = offset;
565
566 // Set layout position
567 //ApplyOffsets();
568 }
569
570 //------------------------------------------------------------------------------------------------
571 void SetAdditionalOffsetY(float offset)
572 {
573 return;
574 m_fAdditionalOffsetY = offset;
575 //ApplyOffsets();
576 }
577
578 //------------------------------------------------------------------------------------------------
579 protected void ApplyOffsets()
580 {
581 return;
582 float sum = (-m_fOffsetY) + (-m_fAdditionalOffsetY);
583
584 if (m_wLayoutWidget)
585 FrameSlot.SetPosY(m_wLayoutWidget, sum);
586 }
587
588 //------------------------------------------------------------------------------------------------
589 override event void DisplayStartDraw(IEntity owner)
590 {
591 if (m_wRoot)
592 m_wLayoutWidget = m_wRoot.FindAnyWidget("VerticalLayout");
593
594 // Layout setup
595 SetOffsetY();
596
597 int count = m_aWidgets.Count();
598 int toGenerate = PRELOADED_WIDGETS_COUNT - count;
599 for (int i = 0; i < toGenerate; i++)
600 {
601 if (i < toGenerate)
602 {
604 if (widgetContainer)
605 widgetContainer.SetVisible(false);
606
607 m_aWidgets.Insert(widgetContainer);
608 }
609
610 if (m_aWidgets[i])
611 m_aWidgets[i].SetVisible(false);
612 }
613
615 if(!m_slotHandler)
616 return;
617
618 m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
620 return;
621
622 m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
623 }
624
625 //------------------------------------------------------------------------------------------------
626 override event void DisplayStopDraw(IEntity owner)
627 {
628 m_aWidgets.Clear();
629 m_wLayoutWidget = null;
630 m_iLastCount = 0;
631 }
632
633 //------------------------------------------------------------------------------------------------
634 override event void DisplayInit(IEntity owner)
635 {
636 PlayerController playerController = PlayerController.Cast(owner);
637 if (!playerController)
638 {
639 Print("SCR_AvailableActionsDisplay is not an object in HUDManagerComponent attached onto a PlayerController entity! May result in undefined behaviour.", LogLevel.WARNING);
640 }
641
642 InputManager inputMgr = GetGame().GetInputManager();
643 if (!inputMgr)
644 return;
645
646 OnGamepadDeviceChanged(!inputMgr.IsUsingMouseAndKeyboard());
647
649 GetGame().OnUserSettingsChangedInvoker().Insert(UpdateIsEnabled);
650 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnGamepadDeviceChanged);
652 }
653
654 //------------------------------------------------------------------------------------------------
658 {
659 if (SCR_SettingsSuperMenu.Cast(menu))
660 m_bForceUpdate = true;
661 }
662
663 //------------------------------------------------------------------------------------------------
666 protected void OnGamepadDeviceChanged(bool isUsingGamepad)
667 {
668 if (isUsingGamepad)
669 m_eCurrentInputDevice = EInputDeviceType.GAMEPAD;
670 else
671 m_eCurrentInputDevice = EInputDeviceType.KEYBOARD;
672
673 m_bForceUpdate = true;
674 }
675
676 //------------------------------------------------------------------------------------------------
677 protected void OnSlotUIResize()
678 {
679 // Assign it again in case the SlotUIComponent has changed
680 m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
682 return;
683
684 int height = m_HUDSlotComponent.GetHeight();
685
688 if (m_iMaxActionsMedium < 1)
690 }
691
692 //------------------------------------------------------------------------------------------------
693 protected void ApplyLayoutBehavior()
694 {
695 AvailableActionLayoutBehaviorBase selectedBehavior;
696
697 // Go through each behavior
699 {
700 if (beh.ConditionsChecked(this))
701 {
702 // Default
703 if (!selectedBehavior)
704 {
705 selectedBehavior = beh;
706 continue;
707 }
708
709 // Select this behavior if it has bigger priority
710 if (selectedBehavior.m_iPriority < beh.m_iPriority)
711 selectedBehavior = beh;
712 }
713 }
714
715 if (selectedBehavior)
716 selectedBehavior.ApplyBehavior(this);
717 else
718 SetOffsetY();
719 }
720};
721
722//------------------------------------------------------------------------------------------------
725{
726 [Attribute("")]
727 float m_fOffsetY;
728
729 [Attribute("0")]
730 int m_iPriority;
731
732 //------------------------------------------------------------------------------------------------
733 bool ConditionsChecked(SCR_AvailableActionsDisplay display)
734 {
735 return true;
736 }
737
738 //------------------------------------------------------------------------------------------------
739 void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
740 {
741 display.SetOffsetY(m_fOffsetY);
742 }
743};
744
745//------------------------------------------------------------------------------------------------
749{
750 [Attribute("", UIWidgets.ResourceNamePicker, "Layout", "layout")]
751 ResourceName m_sCheckHUD;
752
753 [Attribute("0")]
754 protected bool m_bOffsetFromDisplay;
755
756 [Attribute("0")]
757 protected float m_fAddOffset;
758
759 protected float m_fAutoOffset;
760
761 //------------------------------------------------------------------------------------------------
762 override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
763 {
765 if (!HUDManager)
766 return false;
767
768 Widget hud = HUDManager.FindLayoutByResourceName(m_sCheckHUD);
769 if (!hud)
770 return false;
771
772 // Callculate auto offset
774 {
775 float w;
776
777 SCR_InfoDisplay hudCmp = HUDManager.FindInfoDisplayByResourceName(m_sCheckHUD);
778 if (hudCmp)
779 hudCmp.GetDimensions(w, m_fAutoOffset);
780 }
781
782 return (!SCR_EditorManagerEntity.IsOpenedInstance() && hud && hud.IsEnabled());
783 }
784
785 //------------------------------------------------------------------------------------------------
786 //------------------------------------------------------------------------------------------------
787 override void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
788 {
789 // Manual offset
791 {
792 super.ApplyBehavior(display);
793 return;
794 }
795
796 // Auto offset from check HUD
797 display.SetOffsetY(m_fAutoOffset + m_fAddOffset);
798 }
799};
800
801//------------------------------------------------------------------------------------------------
804{
805 [Attribute("0", UIWidgets.ComboBox, "Is this menu active", "", ParamEnumArray.FromEnum(ChimeraMenuPreset))]
806 ChimeraMenuPreset m_ActiveMenu;
807
808 //------------------------------------------------------------------------------------------------
809 override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
810 {
811 return (GetGame().GetMenuManager().FindMenuByPreset(m_ActiveMenu) != null);
812 }
813};
814
815//------------------------------------------------------------------------------------------------
818{
819 [Attribute("1", UIWidgets.ComboBox, "In which mode should be this behavior applied", "", ParamEnumArray.FromEnum(EEditorMode))]
820 EEditorMode m_eEditorMode;
821
822 [Attribute("0", desc: "Additional offset applied when editor is no legal in given scenario.")]
823 protected float m_fIllegalEditorOffset;
824
825 //------------------------------------------------------------------------------------------------
826 override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
827 {
828 SCR_EditorManagerEntity editorManagerEntity = SCR_EditorManagerEntity.GetInstance();
829 if (!editorManagerEntity)
830 return false;
831
832 EEditorMode mode = editorManagerEntity.GetCurrentMode();
833
834 return (SCR_EditorManagerEntity.IsOpenedInstance() && mode == m_eEditorMode);
835 }
836 override void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
837 {
838 float offset = m_fOffsetY;
839
840 if (m_fIllegalEditorOffset != 0)
841 {
843 if (core)
844 {
845 SCR_EditorSettingsEntity editorSettings = core.GetSettingsEntity();
846 if (editorSettings && !editorSettings.IsUnlimitedEditorLegal())
847 offset += m_fIllegalEditorOffset;
848 }
849 }
850
851 display.SetOffsetY(offset);
852 }
853};
ChimeraMenuPreset
Menu presets.
ref DSGameConfig game
Definition DSConfig.c:81
ArmaReforgerScripted GetGame()
Definition game.c:1398
int size
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override event void DisplayStartDraw(IEntity owner)
void OnSettingsMenuClosed(ChimeraMenuBase menu)
void SetAdditionalOffsetY(float offset)
void OnSlotUIResize()
void ApplyOffsets()
override event void DisplayInit(IEntity owner)
int GetAvailableActions(notnull SCR_AvailableActionsConditionData data, array< ref SCR_AvailableActionContext > inActions, out array< SCR_AvailableActionContext > outActions, float timeSlice)
void OnGamepadDeviceChanged(bool isUsingGamepad)
ref SCR_AvailableActionsConditionData m_data
const int HEIGHT_DIVIDER_BIG
This values are used to determine how many actions fit in the available space. (Space / devider = Max...
SCR_HUDSlotUIComponent m_HUDSlotComponent
const int DEFAULT_FONT_SIZE
override event void DisplayUpdate(IEntity owner, float timeSlice)
const int MIN_FONT_SIZE
void SetOffsetY(float offset=-1)
Set available actions layout y position.
void HintShrink(Widget widget, float delayShrink)
Hide hint with fadeout.
void HintHide(Widget widget)
Hide hint with fadeout.
const int HINT_SIZE_Y
int m_iLastCount
Amount of previously shown widgets.
float m_fAdditionalOffsetY
bool m_bForceUpdate
If user changed keybing then it should force update of hints.
void HintFadeOut(Widget widget, float delayFade, float delayShrink)
Hide hint with fadeout.
class AvailableActionLayoutBehaviorBase Attribute
float m_fDataFetchTimer
Timer for fetching data limitation.
override event void DisplayStopDraw(IEntity owner)
ResourceName m_sChildLayout
void ApplyLayoutBehavior()
float m_fDefaultOffsetY
bool m_bIsEnabledSettings
Game settings.
SCR_InfoDisplaySlotHandler m_slotHandler
Widget m_wLayoutWidget
Layout widget in root or null if new.
int m_iMaxActionsBig
Default values for how many large / medium buttons will be displayed before they switch to a smaller ...
EInputDeviceType m_eCurrentInputDevice
void UpdateIsEnabled()
void DisplayHint(Widget widget, float delayFade, float delayShrink)
ref array< ref SCR_AvailableActionsWidget > m_aWidgets
List of available action widget containers.
const int HEIGHT_DIVIDER_MEDIUM
const int PRELOADED_WIDGETS_COUNT
Count of maximum elements that will be pre-cached.
ref array< ref AvailableActionLayoutBehaviorBase > m_aBehaviors
ref SCR_SortedArray< SCR_BaseEditorAction > m_aActions
bool CanBeShown(notnull SCR_EditorContentBrowserSaveStateDataUI tab)
Check if the given tab can be shown.
Widget m_wRootWidget
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
Get all prefabs that have the spawner data
UI layouts Menus CleanSweep CleanSweepAreaSelection layout
Widget m_wRoot
SCR_HelicopterControllerComponentClass gameplaySettings
SCR_InfoDisplayHandler GetHandler(typename handlerType)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
static WidgetAnimationPadding Padding(Widget widget, float padding[4], float speed)
static WidgetAnimationOpacity Opacity(Widget widget, float targetValue, float speed, bool toggleVisibility=false)
override void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
Variables that should be applied on available actions layout whenever given HUD is active.
override void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
Constant variables used in various menus.
Input management system for user interactions.
A single available action condition representation.
void ResetTimers()
Reset fade in and fade out timers to their default values.
bool IsAvailable(notnull SCR_AvailableActionsConditionData data, float timeSlice)
bool IsDelayed()
returns true if action display is currently counting down twords its delayed fade in or out
string ToString(bool forceText=true)
ref array< ref SCR_AvailableActionCondition > m_aConditions
static SCR_AvailableActionsWidget CreateActionsWidget(string layout, Widget parent, string text="", string name="")
void SetText(string text, string name, EInputDeviceType currentInputDevice=EInputDeviceType.KEYBOARD)
SCR_InputButtonComponent m_NavigationButton
void SetForcedUpdate()
Method used to inform this hint that it should update its content.
Core component to manage SCR_EditorManagerEntity.
SCR_EditorSettingsEntity GetSettingsEntity()
SCR_InfoDisplay FindInfoDisplayByResourceName(ResourceName path)
Find layout by resorce name.
static SCR_HUDManagerComponent GetHUDManager()
Widget FindLayoutByResourceName(ResourceName path)
Find layout by resorce name.
void SetClickSoundDisabled(bool isEnabled)
Enable / disable the click sound played when button is pressed.
bool SetAction(string action, EInputDeviceType currentInputDevice=-1, bool forceUpdate=false)
void SetLabel(string label)
PUBLIC API\.
static SCR_InputButtonComponent FindComponent(notnull Widget w)
static ScriptInvokerMenu GetOnMenuClose()
static IEntity GetLocalControlledEntity()
Definition int.c:13
ECharacterLifeState
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
EEditorMode
Editor mode that defines overall functionality.
Definition EEditorMode.c:6