Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AvailableActionsDisplay.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
3 {
4  protected Widget m_wRootWidget;
5  protected OverlayWidget m_wOverlayWidget;
6 
7  protected ButtonWidget m_wButtonWidget;
8  protected SCR_InputButtonComponent m_NavigationButton;
9 
10  protected const string BUTTON_WIDGET_NAME = "NavigationButton1";
11 
12  //------------------------------------------------------------------------------------------------
13  void SetText(string text, string name)
14  {
15  if (!m_NavigationButton)
16  return;
17 
18  m_NavigationButton.SetAction(text);
19  m_NavigationButton.SetLabel(name);
20  }
21 
22  //------------------------------------------------------------------------------------------------
23  void SetSize(int size)
24  {
25  if (m_NavigationButton)
26  m_NavigationButton.SetSize(size);
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  void SetVisible(bool isVisible)
31  {
32  if (m_wRootWidget)
33  m_wRootWidget.SetVisible(isVisible);
34  }
35 
36 
37  void SetPadding(float padding)
38  {
39  if (!m_wOverlayWidget)
40  return;
41 
42  float left, top, right, bottom;
43  OverlaySlot.GetPadding(m_wOverlayWidget, left, top, right, bottom);
44  OverlaySlot.SetPadding(m_wOverlayWidget, left, padding, right, padding);
45  }
46 
47  //------------------------------------------------------------------------------------------------
48  bool IsVisible()
49  {
50  if (m_wRootWidget)
51  return m_wRootWidget.IsVisible();
52 
53  return false;
54  }
55 
56  //------------------------------------------------------------------------------------------------
57  static SCR_AvailableActionsWidget CreateActionsWidget(string layout, Widget parent, string text = "", string name = "")
58  {
59  if (layout == string.Empty)
60  return null;
61 
62  if (!parent)
63  return null;
64 
66  if (!instance)
67  return null;
68 
69  Widget root = GetGame().GetWorkspace().CreateWidgets(layout, parent);
70  instance.m_wRootWidget = root;
71  if (root)
72  {
73  instance.m_wButtonWidget = ButtonWidget.Cast(root.FindAnyWidget(instance.BUTTON_WIDGET_NAME));
74  instance.m_NavigationButton = SCR_InputButtonComponent.FindComponent(instance.m_wButtonWidget);
75 
76  if (instance.m_NavigationButton)
77  instance.m_NavigationButton.SetClickSoundDisabled(true);
78  }
79  instance.SetText(text, name);
80 
81  return instance;
82  }
83 
84  //------------------------------------------------------------------------------------------------
85  Widget GetRootWidget() { return m_wRootWidget; }
86 
87  //------------------------------------------------------------------------------------------------
88  private void SCR_AvailableActionsWidget() {}
89 
90  //------------------------------------------------------------------------------------------------
92  {
93  if (m_wRootWidget)
94  m_wRootWidget.RemoveFromHierarchy();
95  }
96 };
97 
98 //------------------------------------------------------------------------------------------------
99 class SCR_AvailableActionContextTitle : BaseContainerCustomTitle
100 {
101  //------------------------------------------------------------------------------------------------
102  override bool _WB_GetCustomTitle(BaseContainer source, out string title)
103  {
104  // Make sure variable exists
105  int index = source.GetVarIndex("m_sAction");
106  if (index == -1)
107  return false;
108 
109  // Tag string
110  string tag = "";
111  source.Get("m_sTag", tag);
112 
113  source.Get("m_sAction", title);
114 
115  // Enabled string
116  bool enabled;
117  source.Get("m_bEnabled", enabled);
118 
119  string enabledStr = "x";
120  if (enabled)
121  enabledStr = "on";
122 
123  // Setup title string
124  title = "(" + title + ") " + tag + " - " + enabledStr;
125 
126  return true;
127  }
128 };
129 
130 //------------------------------------------------------------------------------------------------
133 {
134  [Attribute("true")]
135  protected bool m_bEnabled;
136 
137  [Attribute("0", UIWidgets.EditBox, "Amount of mili seconds to hide this hint, 0 and less means no hidding")]
138  protected int m_iTimeForHide;
139 
140  [Attribute("", UIWidgets.Object)]
141  protected ref array<ref SCR_AvailableActionCondition> m_aConditions;
142 
143  [Attribute("DefaultTag", UIWidgets.EditBox, "Tag for quick search and recongnition. Change default tag to allow easier search.")]
144  protected string m_sTag;
145 
146  [Attribute("", UIWidgets.EditBox, "Name of the action in action manager")]
147  protected string m_sAction;
148 
149  [Attribute("", UIWidgets.EditBox, "Name of the action in to be displayed in UI")]
150  protected string m_sName;
151 
152  protected const string MARKUP_FORMAT = "<action name=\"%1\"/>";
153 
154  protected bool m_bActivated = false;
155  protected bool m_bHideTimeOver = true;
156 
157  //------------------------------------------------------------------------------------------------
158  string ToString(bool forceText = true)
159  {
160  string text = "";
161  if (forceText)
162  text = string.Format(MARKUP_FORMAT, m_sAction);
163  else
164  text = string.Format(MARKUP_FORMAT, m_sAction);
165 
166  return string.Format("%1", text);
167  }
168 
169  //------------------------------------------------------------------------------------------------
170  string GetActionName()
171  {
172  return m_sAction;
173  }
174 
175  //------------------------------------------------------------------------------------------------
176  // TODO: This should possibly be setup somewhere in the actions manager,
177  // so it can be reused instead of having to rely on setting it up manually in this object?
178  string GetUIName()
179  {
180  if (m_sName == string.Empty)
181  return m_sAction;
182 
183  return m_sName;
184  }
185 
186  //------------------------------------------------------------------------------------------------
187  bool IsAvailable(SCR_AvailableActionsConditionData data)
188  {
189  if (!m_bEnabled)
190  return false;
191 
192  bool isOk = true;
193  foreach (auto cond : m_aConditions)
194  {
195  if (!cond.IsEnabled())
196  continue;
197 
198  if (!cond.IsAvailable(data))
199  {
200  if (m_bActivated)
201  m_bActivated = false;
202 
203  GetGame().GetCallqueue().Remove(CountHideTime);
204  m_bHideTimeOver = true;
205 
206  isOk = false;
207  break;
208  }
209 
210  // Restart hide time counter
211  if (m_iTimeForHide > 0 && m_bHideTimeOver && !m_bActivated)
212  {
213  m_bHideTimeOver = false;
214  GetGame().GetCallqueue().Remove(CountHideTime);
215  GetGame().GetCallqueue().CallLater(CountHideTime, m_iTimeForHide, false);
216  }
217 
218  if (!m_bActivated)
219  m_bActivated = true;
220  }
221 
222  // Hide if time is over
223  if (m_iTimeForHide > 0 && m_bHideTimeOver)
224  isOk = false;
225 
226  return isOk;
227  }
228 
229  //------------------------------------------------------------------------------------------------
230  protected void CountHideTime()
231  {
232  m_bHideTimeOver = true;
233  }
234 };
235 
236 //------------------------------------------------------------------------------------------------
237 class SCR_AvailableActionsDisplay : SCR_InfoDisplayExtended
238 {
240  [Attribute("", UIWidgets.Object, "List of all actions to process at any given moment, these are filtered and available ones are displayed")]
241  protected ref array<ref SCR_AvailableActionContext> m_aActions;
242 
243  [Attribute("", UIWidgets.ResourceNamePicker, "Layout used for individual action widgets", params: "layout")]
244  protected ResourceName m_sChildLayout;
245 
246  [Attribute()]
247  protected float m_fDefaultOffsetY;
248 
249  protected float m_fOffsetY;
250  protected float m_fAdditionalOffsetY = 0;
251 
252  [Attribute("", UIWidgets.Object, "")]
253  protected ref array<ref AvailableActionLayoutBehaviorBase> m_aBehaviors;
254 
255  [Attribute("40", desc: "Size of the small button which will be used when there are too many bigger buttons. (Height in px)")]
256  protected int m_iButtonSizeSmall;
257 
258  [Attribute("44", desc: "Size of the medium button which will be used when there are too many bigger buttons. (Height in px)")]
259  protected int m_iButtonSizeMedium;
260 
261  [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)")]
262  protected int m_iButtonSizeLarge;
263 
265  protected const int PRELOADED_WIDGETS_COUNT = 16;
266 
268  protected ref array<ref SCR_AvailableActionsWidget> m_aWidgets = new array<ref SCR_AvailableActionsWidget>();
269 
271  protected Widget m_wLayoutWidget;
272 
274  protected int m_iLastCount;
275 
277  protected bool m_bIsEnabledSettings;
278 
280  protected ref SCR_AvailableActionsConditionData m_data;
281  protected SCR_InfoDisplaySlotHandler m_slotHandler;
282  protected SCR_HUDSlotUIComponent m_HUDSlotComponent;
283 
285  protected float m_fDataFetchTimer;
286 
288  protected int m_iMaxActionsBig = 5;
289  protected int m_iMaxActionsMedium = 7;
290 
292  const int HEIGHT_DIVIDER_BIG = 70;
293  const int HEIGHT_DIVIDER_MEDIUM = 50;
294 
295  const int HINT_SIZE_Y = 34;
296  const int DEFAULT_FONT_SIZE = 20;
297  const int MIN_FONT_SIZE = 16;
298 
299  //protected ref array<SCR_AvailableActionContext> availableActions;
300  //protected int actionsCount;
301 
302  //------------------------------------------------------------------------------------------------
306  protected int GetAvailableActions(SCR_AvailableActionsConditionData data, array<ref SCR_AvailableActionContext> inActions, out array<SCR_AvailableActionContext> outActions)
307  {
308  ArmaReforgerScripted game = GetGame();
309  if (!game)
310  return 0;
311 
312  InputManager inputManager = game.GetInputManager();
313  if (!inputManager)
314  return 0;
315 
316  outActions.Clear();
317  int count = 0;
318  foreach (auto action : inActions)
319  {
320  auto actionName = action.GetActionName();
321 
322  if (actionName == string.Empty)
323  continue;
324 
325  if (inputManager.IsActionActive(actionName) && action.IsAvailable(data))
326  {
327  outActions.Insert(action);
328  count++;
329  }
330  }
331 
332  return count;
333  }
334 
335  //------------------------------------------------------------------------------------------------
336  protected bool CanBeShown(IEntity controlledEntity)
337  {
338  if (SCR_EditorManagerEntity.IsOpenedInstance())
339  return true;
340 
341  ChimeraCharacter character = ChimeraCharacter.Cast(controlledEntity);
342  if (!character)
343  return false;
344 
345  CharacterControllerComponent controller = character.GetCharacterController();
346  if (!controller)
347  return false;
348 
349  ECharacterLifeState lifeState = controller.GetLifeState();
350  if (lifeState == ECharacterLifeState.ALIVE)
351  return true;
352 
353  return false;
354  }
355 
356  //------------------------------------------------------------------------------------------------
357  protected void UpdateIsEnabled()
358  {
359  // In case settings are not found, fallback to enabled
360  m_bIsEnabledSettings = true;
361 
362  BaseContainer gameplaySettings = GetGame().GetGameUserSettings().GetModule("SCR_GameplaySettings");
363  if (gameplaySettings)
364  gameplaySettings.Get("m_bControlHints", m_bIsEnabledSettings);
365  }
366 
367  //------------------------------------------------------------------------------------------------
368  override event void DisplayUpdate(IEntity owner, float timeSlice)
369  {
370  if (!m_wRoot)
371  return; // Mandatory
372 
373  //Check if the SlotUIComponent is still valid otherwise change to the new one
374  if (m_HUDSlotComponent != m_slotHandler.GetSlotUIComponent())
375  {
376  if (m_HUDSlotComponent)
377  m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
378 
379  m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
380  if (!m_HUDSlotComponent)
381  return;
382 
383  m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
384  }
385 
386  IEntity controlledEntity = SCR_PlayerController.GetLocalControlledEntity();
387 
388  //~ Can show checks if controlledEntity is valid or if editor is open
389  if (m_bIsEnabledSettings && CanBeShown(controlledEntity))
390  m_wRoot.SetVisible(true);
391  else
392  {
393  m_wRoot.SetVisible(false);
394  return;
395  }
396 
397  if (!m_data)
398  m_data = new SCR_AvailableActionsConditionData();
399 
400  m_fDataFetchTimer += timeSlice;
401 
402  if (m_fDataFetchTimer >= 0.25)
403  {
404  m_data.FetchData(controlledEntity, m_fDataFetchTimer);
405  DisplayWidgetsUpdate();
406 
407  m_fDataFetchTimer = 0;
408  }
409  }
410 
411  //------------------------------------------------------------------------------------------------
412  private void DisplayWidgetsUpdate()
413  {
414  array<SCR_AvailableActionContext> availableActions = new array<SCR_AvailableActionContext>();
415  int actionsCount = GetAvailableActions(m_data, m_aActions, availableActions);
416 
417  // Enable additional ones
418  if (actionsCount > m_iLastCount)
419  {
420  for (int i = m_iLastCount; i < actionsCount; i++)
421  {
422  // OOR
423  if (i >= m_aWidgets.Count())
424  break;
425 
426  if (m_aWidgets[i])
427  DisplayHint(m_aWidgets[i].GetRootWidget(), UIConstants.FADE_RATE_SUPER_FAST, UIConstants.FADE_RATE_SUPER_FAST);
428  }
429  }
430  // Or hide previously shown
431  else
432  {
433  for (int i = actionsCount; i < m_iLastCount; i++)
434  {
435  // OOR
436  if (i >= m_aWidgets.Count())
437  break;
438 
439  /*if (m_aWidgets[i])
440  m_aWidgets[i].SetVisible(false);*/
441  if (m_aWidgets[i])
442  HintFadeOut(m_aWidgets[i].GetRootWidget(), UIConstants.FADE_RATE_DEFAULT, UIConstants.FADE_RATE_FAST);
443  }
444  }
445 
446  for (int i = 0; i < actionsCount; i++)
447  {
448  // OOR
449  if (i >= m_aWidgets.Count())
450  break;
451 
452  if (m_aWidgets[i] && availableActions[i])
453  m_aWidgets[i].SetText(availableActions[i].GetActionName(), availableActions[i].GetUIName());
454 
455  if (actionsCount > m_iMaxActionsMedium)
456  {
457  m_aWidgets[i].SetSize(m_iButtonSizeSmall);
458  }
459  else if (actionsCount > m_iMaxActionsBig)
460  {
461  m_aWidgets[i].SetSize(m_iButtonSizeMedium);
462  }
463  else
464  {
465  m_aWidgets[i].SetSize(m_iButtonSizeLarge);
466  }
467  }
468 
469  // Acknowledge new count
470  m_iLastCount = actionsCount;
471 
472 
473  ApplyLayoutBehavior();
474  }
475 
476  //------------------------------------------------------------------------------------------------
477  protected void DisplayHint(Widget widget, float delayFade, float delayShrink)
478  {
479  widget.SetOpacity(0);
480  VerticalLayoutSlot.SetPadding(widget, 0, -HINT_SIZE_Y, 0, 0);
481  widget.SetVisible(true);
482 
483  // Clear hiding
484  GetGame().GetCallqueue().Remove(HintShrink);
485  GetGame().GetCallqueue().Remove(HintHide);
486 
487  // Animations
488  float padding[4] = {0, 0, 0, 0};
489  AnimateWidget.Padding(widget, padding, delayShrink);
490  AnimateWidget.Opacity(widget, 1, delayFade);
491  }
492 
493  //------------------------------------------------------------------------------------------------
495  protected void HintFadeOut(Widget widget, float delayFade, float delayShrink)
496  {
497  /*GetGame().GetCallqueue().Remove(HintShrink);
498  GetGame().GetCallqueue().Remove(HintHide);*/
499 
500  AnimateWidget.Opacity(widget, 0, delayFade);
501  GetGame().GetCallqueue().CallLater(HintShrink, 1000 / delayFade, false, widget, delayShrink);
502  //HintShrink(widget, delayShrink);
503  }
504 
505  //------------------------------------------------------------------------------------------------
507  protected void HintShrink(Widget widget, float delayShrink)
508  {
509  float padding[4] = {0, -HINT_SIZE_Y, 0, 0};
510  AnimateWidget.Padding(widget, padding, delayShrink);
511  GetGame().GetCallqueue().CallLater(HintHide, 1000 / delayShrink, false, widget);
512  }
513 
514  //------------------------------------------------------------------------------------------------
516  protected void HintHide(Widget widget)
517  {
518  widget.SetVisible(false);
519  }
520 
521  //------------------------------------------------------------------------------------------------
523  void SetOffsetY(float offset = -1)
524  {
525  return;
526  // Default position
527  if (offset == -1)
528  offset = m_fDefaultOffsetY;
529 
530  m_fOffsetY = offset;
531 
532  // Set layout position
533  //ApplyOffsets();
534  }
535 
536  //------------------------------------------------------------------------------------------------
537  void SetAdditionalOffsetY(float offset)
538  {
539  return;
540  m_fAdditionalOffsetY = offset;
541  //ApplyOffsets();
542  }
543 
544  //------------------------------------------------------------------------------------------------
545  protected void ApplyOffsets()
546  {
547  return;
548  float sum = (-m_fOffsetY) + (-m_fAdditionalOffsetY);
549 
550  if (m_wLayoutWidget)
551  FrameSlot.SetPosY(m_wLayoutWidget, sum);
552  }
553 
554  //------------------------------------------------------------------------------------------------
555  override event void DisplayStartDraw(IEntity owner)
556  {
557  if (m_wRoot)
558  m_wLayoutWidget = m_wRoot.FindAnyWidget("VerticalLayout");
559 
560  // Layout setup
561  SetOffsetY();
562 
563  int count = m_aWidgets.Count();
564  int toGenerate = PRELOADED_WIDGETS_COUNT - count;
565  for (int i = 0; i < toGenerate; i++)
566  {
567  if (i < toGenerate)
568  {
569  SCR_AvailableActionsWidget widgetContainer = SCR_AvailableActionsWidget.CreateActionsWidget(m_sChildLayout, m_wLayoutWidget, "");
570  if (widgetContainer)
571  widgetContainer.SetVisible(false);
572 
573  m_aWidgets.Insert(widgetContainer);
574  }
575 
576  if (m_aWidgets[i])
577  m_aWidgets[i].SetVisible(false);
578  }
579 
581  if(!m_slotHandler)
582  return;
583 
584  m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
585  if (!m_HUDSlotComponent)
586  return;
587 
588  m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
589  }
590 
591  //------------------------------------------------------------------------------------------------
592  override event void DisplayStopDraw(IEntity owner)
593  {
594  m_aWidgets.Clear();
595  m_wLayoutWidget = null;
596  m_iLastCount = 0;
597  }
598 
599  //------------------------------------------------------------------------------------------------
600  override event void DisplayInit(IEntity owner)
601  {
602  PlayerController playerController = PlayerController.Cast(owner);
603  if (!playerController)
604  {
605  Print("SCR_AvailableActionsDisplay is not an object in HUDManagerComponent attached onto a PlayerController entity! May result in undefined behaviour.", LogLevel.WARNING);
606  }
607 
608  UpdateIsEnabled();
609  GetGame().OnUserSettingsChangedInvoker().Insert(UpdateIsEnabled);
610  }
611 
612  //------------------------------------------------------------------------------------------------
613  protected void OnSlotUIResize()
614  {
615  // Assign it again in case the SlotUIComponent has changed
616  m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
617  if (!m_HUDSlotComponent)
618  return;
619 
620  int height = m_HUDSlotComponent.GetHeight();
621 
622  m_iMaxActionsBig = (int)height / HEIGHT_DIVIDER_BIG;
623  m_iMaxActionsMedium = (int)height / HEIGHT_DIVIDER_MEDIUM;
624  if (m_iMaxActionsMedium < 1)
625  m_iMaxActionsMedium = 1;
626  }
627 
628  //------------------------------------------------------------------------------------------------
629  protected void ApplyLayoutBehavior()
630  {
631  AvailableActionLayoutBehaviorBase selectedBehavior;
632 
633  // Go through each behavior
634  foreach (AvailableActionLayoutBehaviorBase beh : m_aBehaviors)
635  {
636  if (beh.ConditionsChecked(this))
637  {
638  // Default
639  if (!selectedBehavior)
640  {
641  selectedBehavior = beh;
642  continue;
643  }
644 
645  // Select this behavior if it has bigger priority
646  if (selectedBehavior.m_iPriority < beh.m_iPriority)
647  selectedBehavior = beh;
648  }
649  }
650 
651  if (selectedBehavior)
652  selectedBehavior.ApplyBehavior(this);
653  else
654  SetOffsetY();
655  }
656 };
657 
658 //------------------------------------------------------------------------------------------------
661 {
662  [Attribute("")]
663  float m_fOffsetY;
664 
665  [Attribute("0")]
666  int m_iPriority;
667 
668  //------------------------------------------------------------------------------------------------
669  bool ConditionsChecked(SCR_AvailableActionsDisplay display)
670  {
671  return true;
672  }
673 
674  //------------------------------------------------------------------------------------------------
675  void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
676  {
677  display.SetOffsetY(m_fOffsetY);
678  }
679 };
680 
681 //------------------------------------------------------------------------------------------------
685 {
686  [Attribute("", UIWidgets.ResourceNamePicker, "Layout", "layout")]
687  ResourceName m_sCheckHUD;
688 
689  [Attribute("0")]
690  protected bool m_bOffsetFromDisplay;
691 
692  [Attribute("0")]
693  protected float m_fAddOffset;
694 
695  protected float m_fAutoOffset;
696 
697  //------------------------------------------------------------------------------------------------
698  override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
699  {
700  SCR_HUDManagerComponent HUDManager = SCR_HUDManagerComponent.GetHUDManager();
701  if (!HUDManager)
702  return false;
703 
704  Widget hud = HUDManager.FindLayoutByResourceName(m_sCheckHUD);
705  if (!hud)
706  return false;
707 
708  // Callculate auto offset
709  if (m_bOffsetFromDisplay)
710  {
711  float w;
712 
713  SCR_InfoDisplay hudCmp = HUDManager.FindInfoDisplayByResourceName(m_sCheckHUD);
714  if (hudCmp)
715  hudCmp.GetDimensions(w, m_fAutoOffset);
716  }
717 
718  return (!SCR_EditorManagerEntity.IsOpenedInstance() && hud && hud.IsEnabled());
719  }
720 
721  //------------------------------------------------------------------------------------------------
722  //------------------------------------------------------------------------------------------------
723  override void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
724  {
725  // Manual offset
726  if (!m_bOffsetFromDisplay)
727  {
728  super.ApplyBehavior(display);
729  return;
730  }
731 
732  // Auto offset from check HUD
733  display.SetOffsetY(m_fAutoOffset + m_fAddOffset);
734  }
735 };
736 
737 //------------------------------------------------------------------------------------------------
740 {
741  [Attribute("0", UIWidgets.ComboBox, "Is this menu active", "", ParamEnumArray.FromEnum(ChimeraMenuPreset))]
742  ChimeraMenuPreset m_ActiveMenu;
743 
744  //------------------------------------------------------------------------------------------------
745  override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
746  {
747  return (GetGame().GetMenuManager().FindMenuByPreset(m_ActiveMenu) != null);
748  }
749 };
750 
751 //------------------------------------------------------------------------------------------------
754 {
755  [Attribute("1", UIWidgets.ComboBox, "In which mode should be this behavior applied", "", ParamEnumArray.FromEnum(EEditorMode))]
756  EEditorMode m_eEditorMode;
757 
758  [Attribute("0", desc: "Additional offset applied when editor is no legal in given scenario.")]
759  protected float m_fIllegalEditorOffset;
760 
761  //------------------------------------------------------------------------------------------------
762  override bool ConditionsChecked(SCR_AvailableActionsDisplay display)
763  {
764  SCR_EditorManagerEntity editorManagerEntity = SCR_EditorManagerEntity.GetInstance();
765  if (!editorManagerEntity)
766  return false;
767 
768  EEditorMode mode = editorManagerEntity.GetCurrentMode();
769 
770  return (SCR_EditorManagerEntity.IsOpenedInstance() && mode == m_eEditorMode);
771  }
772  override void ApplyBehavior(notnull SCR_AvailableActionsDisplay display)
773  {
774  float offset = m_fOffsetY;
775 
776  if (m_fIllegalEditorOffset != 0)
777  {
779  if (core)
780  {
781  SCR_EditorSettingsEntity editorSettings = core.GetSettingsEntity();
782  if (editorSettings && !editorSettings.IsUnlimitedEditorLegal())
783  offset += m_fIllegalEditorOffset;
784  }
785  }
786 
787  display.SetOffsetY(offset);
788  }
789 };
GetHandler
SCR_InfoDisplayHandler GetHandler(typename handlerType)
Definition: SCR_InfoDisplay.c:80
SCR_HUDManagerComponent
Definition: SCR_HUDManagerComponent.c:23
SCR_AvailableActionsWidget
Definition: SCR_AvailableActionsDisplay.c:2
SCR_PlayerController
Definition: SCR_PlayerController.c:31
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
ECharacterLifeState
ECharacterLifeState
Definition: ECharacterLifeState.c:12
UIConstants
Definition: Constants.c:130
SCR_AvailableActionsConditionData
Definition: SCR_AvailableActionsConditionData.c:5
m_aActions
ref SCR_SortedArray< SCR_BaseEditorAction > m_aActions
Definition: SCR_BaseActionsEditorComponent.c:8
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
AvailableActionLayoutBehaviorBase
Definition: SCR_AvailableActionsDisplay.c:660
SCR_AvailableActionContext
Definition: SCR_AvailableActionsDisplay.c:132
GetRootWidget
Widget GetRootWidget()
Definition: SCR_UITaskManagerComponent.c:160
SCR_EditorSettingsEntity
Definition: SCR_EditorSettingsEntity.c:12
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition: SCR_EditorManagerCore.c:5
SCR_InfoDisplaySlotHandler
Definition: SCR_InfoDisplaySlotHandler.c:2
AvailableActionLayoutBehavior
Variables that should be applied on available actions layout whenever given HUD is active.
Definition: SCR_AvailableActionsDisplay.c:684
AvailableActionEditorLayoutBehavior
Definition: SCR_AvailableActionsDisplay.c:753
GetActionName
string GetActionName()
Definition: InteractableBoxComponent.c:66
m_aWidgets
ref array< Widget > m_aWidgets
Definition: SCR_UITaskManagerComponent.c:25
EEditorMode
EEditorMode
Editor mode that defines overall functionality.
Definition: EEditorMode.c:5
AvailableActionMenuLayoutBehavior
Definition: SCR_AvailableActionsDisplay.c:739
layout
UI layouts HUD CampaignMP CampaignMainHUD layout
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:20
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
ChimeraMenuPreset
ChimeraMenuPreset
Menu presets.
Definition: ChimeraMenuBase.c:3
m_bEnabled
private bool m_bEnabled
Definition: SCR_BaseManualCameraComponent.c:3
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
m_HUDSlotComponent
protected SCR_HUDSlotUIComponent m_HUDSlotComponent
Definition: SCR_VonDisplay.c:103
m_sName
protected LocalizedString m_sName
Definition: SCR_GroupIdentityComponent.c:19
int
SCR_PossessingManagerComponentClass int
SCR_AvailableActionsDisplay
Definition: SCR_AvailableActionsDisplay.c:237
SCR_HUDSlotUIComponent
Definition: SCR_HUDSlotUIComponent.c:5
SCR_InputButtonComponent
Definition: SCR_InputButtonComponent.c:1
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468
SCR_AvailableActionContextTitle
Definition: SCR_AvailableActionsDisplay.c:99
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26