Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SelectionMenu.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
5 [BaseContainerProps(configRoot: true)]
7 {
8  protected const int OPEN_DELAY = 200;
9 
10  // Attributes
11  [Attribute()]
12  protected ref SCR_SelectionMenuInputs m_Inputs;
13 
14  [Attribute()]
15  protected string m_sOpenSound;
16 
17  [Attribute()]
18  protected string m_sCloseSound;
19 
20  [Attribute()]
21  protected string m_sSelectionSound;
22 
23  [Attribute()]
24  protected string m_sPerformSound;
25 
26  [Attribute()]
27  protected string m_sEnterCategorySound;
28 
29  [Attribute()]
30  protected string m_sLeaveCategorySound;
31 
32  // Variables
33  protected SCR_SelectionMenuDisplay m_Display;
34 
35  protected ref array<ref SCR_SelectionMenuEntry> m_aRootEntries = {}; // 1st layer of entries
36  protected ref array<ref SCR_SelectionMenuEntry> m_aEntries = {}; // Current layer entries
37  protected SCR_SelectionMenuEntry m_SelectedEntry;
38  protected int m_iSelectedEntryId;
39 
40  protected ref SCR_SelectionMenuControllerInputs m_ControllerInputs;
41  protected bool m_bOpened;
42  protected bool m_bEntryPerformed;
43  protected bool m_bUsingAlternativeToggle;
44  protected bool m_bClosingMenu;
45  protected bool m_bOpenedForTime;
46 
47  // Categories and multi layering
48  protected ref array<SCR_SelectionMenuCategoryEntry> m_aSelectedCategories = {};
49 
50  // Events
51  protected ref ScriptInvoker<SCR_SelectionMenu> m_OnBeforeOpen;
52  protected ref ScriptInvoker<SCR_SelectionMenu> m_OnOpen;
53  protected ref ScriptInvoker<SCR_SelectionMenu> m_OnClose;
54  protected ref ScriptInvoker<SCR_SelectionMenu, SCR_SelectionMenuEntry, int> m_OnSelect;
55  protected ref ScriptInvoker<SCR_SelectionMenu, SCR_SelectionMenuEntry> m_OnPerform;
56  protected ref ScriptInvoker<SCR_SelectionMenu, SCR_SelectionMenuCategoryEntry, int> m_OnOpenCategory;
57 
58  protected ref ScriptInvoker<SCR_SelectionMenu, SCR_SelectionMenuEntry> m_OnAddEntry;
59  protected ref ScriptInvoker<SCR_SelectionMenu, SCR_SelectionMenuEntry> m_OnRemoveEntry;
60  protected ref ScriptInvoker<SCR_SelectionMenu, array<ref SCR_SelectionMenuEntry>> m_OnUpdateEntries;
61 
62  protected ref ScriptInvoker<SCR_SelectionMenu, SCR_SelectionMenuControllerInputs> m_OnControllerChanged;
63 
64  //------------------------------------------------------------------------------------------------
65  protected void InvokeOnBeforeOpen()
66  {
67  if (m_OnBeforeOpen)
68  m_OnBeforeOpen.Invoke(this);
69  }
70 
71  //------------------------------------------------------------------------------------------------
72  ScriptInvoker GetOnBeforeOpen()
73  {
74  if (!m_OnBeforeOpen)
75  m_OnBeforeOpen = new ScriptInvoker();
76 
77  return m_OnBeforeOpen;
78  }
79 
80  //------------------------------------------------------------------------------------------------
81  protected void InvokeOnOpen()
82  {
83  if (m_OnOpen)
84  m_OnOpen.Invoke(this);
85  }
86 
87  //------------------------------------------------------------------------------------------------
88  ScriptInvoker GetOnOpen()
89  {
90  if (!m_OnOpen)
91  m_OnOpen = new ScriptInvoker();
92 
93  return m_OnOpen;
94  }
95 
96  //------------------------------------------------------------------------------------------------
97  protected void InvokeOnClose()
98  {
99  if (m_OnClose)
100  m_OnClose.Invoke(this);
101  }
102 
103  //------------------------------------------------------------------------------------------------
104  ScriptInvoker GetOnClose()
105  {
106  if (!m_OnClose)
107  m_OnClose = new ScriptInvoker();
108 
109  return m_OnClose;
110  }
111 
112  //------------------------------------------------------------------------------------------------
113  protected void InvokeOnSelect(SCR_SelectionMenuEntry entry, int id)
114  {
115  if (m_OnSelect)
116  m_OnSelect.Invoke(this, entry, id);
117  }
118 
119  //------------------------------------------------------------------------------------------------
120  ScriptInvoker GetOnSelect()
121  {
122  if (!m_OnSelect)
123  m_OnSelect = new ScriptInvoker();
124 
125  return m_OnSelect;
126  }
127 
128  //------------------------------------------------------------------------------------------------
129  protected void InvokeOnPerform(SCR_SelectionMenuEntry entry)
130  {
131  if (m_OnPerform)
132  m_OnPerform.Invoke(this, entry);
133  }
134 
135  //------------------------------------------------------------------------------------------------
136  ScriptInvoker GetOnPerform()
137  {
138  if (!m_OnPerform)
139  m_OnPerform = new ScriptInvoker();
140 
141  return m_OnPerform;
142  }
143 
144  //------------------------------------------------------------------------------------------------
145  protected void InvokeOnOpenCategory(SCR_SelectionMenuCategoryEntry entry, int level)
146  {
147  if (m_OnOpenCategory)
148  m_OnOpenCategory.Invoke(this, entry, level);
149  }
150 
151  //------------------------------------------------------------------------------------------------
152  ScriptInvoker GetOnOpenCategory()
153  {
154  if (!m_OnOpenCategory)
155  m_OnOpenCategory = new ScriptInvoker();
156 
157  return m_OnOpenCategory;
158  }
159 
160  //------------------------------------------------------------------------------------------------
161  protected void InvokeOnAddEntry(SCR_SelectionMenuEntry entry)
162  {
163  if (m_OnAddEntry)
164  m_OnAddEntry.Invoke(this, entry);
165  }
166 
167  //------------------------------------------------------------------------------------------------
168  ScriptInvoker GetOnAddEntry()
169  {
170  if (!m_OnAddEntry)
171  m_OnAddEntry = new ScriptInvoker();
172 
173  return m_OnAddEntry;
174  }
175 
176  //------------------------------------------------------------------------------------------------
177  protected void InvokeOnRemoveEntry(SCR_SelectionMenuEntry entry)
178  {
179  if (m_OnRemoveEntry)
180  m_OnRemoveEntry.Invoke(this, entry);
181  }
182 
183  //------------------------------------------------------------------------------------------------
184  ScriptInvoker GetOnRemoveEntry()
185  {
186  if (!m_OnRemoveEntry)
187  m_OnRemoveEntry = new ScriptInvoker();
188 
189  return m_OnRemoveEntry;
190  }
191 
192  //------------------------------------------------------------------------------------------------
193  protected void InvokeOnUpdateEntries(array<ref SCR_SelectionMenuEntry> entries)
194  {
195  if (m_OnUpdateEntries)
196  m_OnUpdateEntries.Invoke(this, entries);
197  }
198 
199  //------------------------------------------------------------------------------------------------
200  ScriptInvoker GetOnUpdateEntries()
201  {
202  if (!m_OnUpdateEntries)
203  m_OnUpdateEntries = new ScriptInvoker();
204 
205  return m_OnUpdateEntries;
206  }
207 
208  //------------------------------------------------------------------------------------------------
209  protected void InvokeOnControllerChanged(SCR_SelectionMenuControllerInputs inputs)
210  {
211  if (m_OnControllerChanged)
212  m_OnControllerChanged.Invoke(this, inputs);
213  }
214 
215  //------------------------------------------------------------------------------------------------
216  ScriptInvoker GetOnControllerChanged()
217  {
218  if (!m_OnControllerChanged)
219  m_OnControllerChanged = new ScriptInvoker();
220 
221  return m_OnControllerChanged;
222  }
223 
224  //------------------------------------------------------------------------------------------------
225  // Custom methods
226  //------------------------------------------------------------------------------------------------
227 
228  //------------------------------------------------------------------------------------------------
229  void Open()
230  {
231  InvokeOnBeforeOpen();
232 
233  // Prevent opening emtpy menu
234  if (m_ControllerInputs.m_bPreventEmptyMenuOpen && m_aEntries.IsEmpty())
235  return;
236 
237  if (m_bOpened)
238  return;
239 
240  m_bOpened = true;
241  m_bEntryPerformed = false;
242  m_bClosingMenu = false;
243  m_bUsingAlternativeToggle = false;
244 
245  // Call later to set opened for time to allow closing after reaching the delay
246  m_bOpenedForTime = false;
247 
248  if (!m_ControllerInputs.m_sToggleActionAlternative.IsEmpty())
249  GetGame().GetCallqueue().CallLater(AllowClosing, OPEN_DELAY);
250  else
251  AllowClosing(); // Allow closing immidiatelly when toggle is not set
252 
253  // Start on root
254  if (m_ControllerInputs.m_bOpenInRoot)
255  OpenInRoot();
256 
257  OnOpen();
258 
259  InvokeOnOpen();
260  PlaySound(m_sOpenSound);
261 
262  // Call update in next frame to be sure item preview is prepared
263  GetGame().GetCallqueue().CallLater(UpdateEntries);
264  }
265 
266  //------------------------------------------------------------------------------------------------
268  protected void AllowClosing()
269  {
270  // Set true to state that time for allow closing has already passed
271  m_bOpenedForTime = true;
272 
273  // Close menu if closing was requested before it was possible
274  if (m_bClosingMenu && !m_bUsingAlternativeToggle)
275  {
276  Close();
277  return;
278  }
279 
280  m_bClosingMenu = false;
281  }
282 
283  //------------------------------------------------------------------------------------------------
285  protected void OnOpen(){}
286 
287  //------------------------------------------------------------------------------------------------
289  void Close()
290  {
291  m_bClosingMenu = true;
292 
293  if (!m_bOpenedForTime)
294  return;
295 
296  // Perform
297  if (m_ControllerInputs && m_ControllerInputs.m_bPerformOnClose && m_SelectedEntry && !m_bEntryPerformed)
298  PerformEntry(m_SelectedEntry);
299 
300  m_bOpened = false;
301  m_bUsingAlternativeToggle = false;
302  OnClose();
303 
304  InvokeOnClose();
305 
306  if (!m_bEntryPerformed || !m_SelectedEntry)
307  PlaySound(m_sCloseSound);
308  }
309 
310  //------------------------------------------------------------------------------------------------
312  protected void OnClose(){}
313 
314  //------------------------------------------------------------------------------------------------
315  void Update(float timeSlice)
316  {
317  // Context
318  if (m_bOpened)
319  GetGame().GetInputManager().ActivateContext(m_Inputs.m_sContext);
320 
321  if (m_ControllerInputs)
322  GetGame().GetInputManager().ActivateContext(m_ControllerInputs.m_sControllerContext);
323 
324  OnUpdate(timeSlice);
325  }
326 
327  //------------------------------------------------------------------------------------------------
329  protected void OnUpdate(float timeSlice){}
330 
331  //------------------------------------------------------------------------------------------------
332  void Init()
333  {
334  Close();
335  }
336 
337  //------------------------------------------------------------------------------------------------
338  protected void PlaySound(string sound)
339  {
340  if (!sound.IsEmpty())
341  SCR_UISoundEntity.SoundEvent(sound);
342  }
343 
344  //------------------------------------------------------------------------------------------------
345  // Entries handling
346  //------------------------------------------------------------------------------------------------
347 
348  //------------------------------------------------------------------------------------------------
350  protected void SelectEntry() {}
351 
352  //------------------------------------------------------------------------------------------------
353  void PerformEntry(notnull SCR_SelectionMenuEntry entry)
354  {
355  if (!entry.IsEnabled())
356  return;
357 
358  // Is category entry
360 
361  entry.Perform();
362 
363  // Generic entry
364  if (!category)
365  {
366  m_bEntryPerformed = true;
367 
368  if (m_ControllerInputs.m_bCloseOnPerform)
369  Close();
370  }
371 
372  // Category
373  if (category)
374  {
375  if (!m_bClosingMenu)
376  OpenCategoryEntry(category);
377  // Perform default action on closing
378 
379  return;
380  }
381 
382  PlaySound(m_sPerformSound);
383 
384  InvokeOnPerform(entry);
385 
386  if (!category && !m_bClosingMenu)
387  m_bEntryPerformed = false;
388  }
389 
390  //------------------------------------------------------------------------------------------------
392  protected void OpenCategoryEntry(notnull SCR_SelectionMenuCategoryEntry category)
393  {
394  //AddEntries(category.GetEntries(), true);
395 
396  m_aSelectedCategories.Insert(category);
397 
398  // Repopulate entries
399  m_aEntries.Clear();
400 
401  for (int i = 0, count = category.GetEntries().Count(); i < count; i++)
402  {
403  m_aEntries.Insert(category.GetEntries()[i]);
404  }
405 
406  // Update
407  InvokeOnOpenCategory(category, m_aSelectedCategories.Count());
408  InvokeOnUpdateEntries(category.GetEntries());
409 
410  PlaySound(m_sEnterCategorySound);
411  }
412 
413  //------------------------------------------------------------------------------------------------
414  protected void LeaveCategory()
415  {
416  SCR_SelectionMenuCategoryEntry category = CurrentCategory();
417  if (!category)
418  return;
419 
420  m_aSelectedCategories.RemoveItem(category);
421 
422  category = CurrentCategory();
423  m_aEntries.Clear();
424 
425 
426  // Repopulate entries with previous entry
427  if (category)
428  {
429  array<ref SCR_SelectionMenuEntry> catEntries = category.GetEntries();
430 
431  // Previous category
432  for (int i = 0, count = catEntries.Count(); i < count; i++)
433  {
434  m_aEntries.Insert(catEntries[i]);
435  }
436  }
437  else
438  {
439  // Root
440  for (int i = 0, count = m_aRootEntries.Count(); i < count; i++)
441  {
442  m_aEntries.Insert(m_aRootEntries[i]);
443  }
444  }
445 
446  InvokeOnOpenCategory(category, m_aSelectedCategories.Count());
447  InvokeOnUpdateEntries(m_aEntries);
448 
449  PlaySound(m_sLeaveCategorySound);
450  }
451 
452  //------------------------------------------------------------------------------------------------
454  protected void OpenInRoot()
455  {
456  m_aSelectedCategories.Clear();
457  m_aEntries.Clear();
458 
459  for (int i = 0, count = m_aRootEntries.Count(); i < count; i++)
460  {
461  m_aEntries.Insert(m_aRootEntries[i]);
462  }
463 
464  InvokeOnOpenCategory(null, 0);
465  InvokeOnUpdateEntries(m_aEntries);
466  }
467 
468  //------------------------------------------------------------------------------------------------
471  void AddEntry(SCR_SelectionMenuEntry entry = null)
472  {
473  if (!entry)
474  {
476  m_aRootEntries.Insert(newEntry);
477  return;
478  }
479 
480  m_aRootEntries.Insert(entry);
481 
482  // Update entries
483  if (!CurrentCategory())
484  {
485  m_aEntries.Insert(entry);
486  InvokeOnAddEntry(entry);
487  InvokeOnUpdateEntries(m_aEntries);
488  }
489  }
490 
491  //------------------------------------------------------------------------------------------------
493  void AddCategoryEntry(SCR_SelectionMenuCategoryEntry category = null)
494  {
496 
497  if (!entry)
498  entry = new SCR_SelectionMenuCategoryEntry();
499 
500  AddEntry(entry);
501  }
502 
503  //------------------------------------------------------------------------------------------------
506  void AddEntries(notnull array<ref SCR_SelectionMenuEntry> entries, bool replace = false)
507  {
508  // Clear
509  if (replace)
510  {
511  m_aRootEntries.Clear();
512 
513  if (!CurrentCategory())
514  m_aEntries.Clear();
515  }
516 
517  // Add
518  for (int i = 0, count = entries.Count(); i < count; i++)
519  {
520  AddEntry(entries[i]);
521  }
522 
523  if (!CurrentCategory())
524  InvokeOnUpdateEntries(m_aEntries);
525 
526  UpdateEntries();
527  }
528 
529  //------------------------------------------------------------------------------------------------
531  void UpdateEntries()
532  {
533  InvokeOnUpdateEntries(m_aEntries);
534 
535  foreach (SCR_SelectionMenuEntry entry : m_aEntries)
536  {
537  if (entry)
538  entry.Update();
539  }
540  }
541 
542  //------------------------------------------------------------------------------------------------
544  void UpdateSelectedEntries(notnull array<ref SCR_SelectionMenuEntry> entries)
545  {
546  InvokeOnUpdateEntries(entries);
547 
548  foreach (SCR_SelectionMenuEntry entry : entries)
549  {
550  if (entry)
551  entry.Update();
552  }
553  }
554 
555  //------------------------------------------------------------------------------------------------
557  void RemoveEntry(notnull SCR_SelectionMenuEntry entry)
558  {
559  m_aRootEntries.RemoveItem(entry);
560 
561  // Update entries
562  if (!CurrentCategory())
563  {
564  m_aEntries.RemoveItem(entry);
565  InvokeOnUpdateEntries(m_aEntries);
566  }
567  }
568 
569  //------------------------------------------------------------------------------------------------
571  void ClearEntries()
572  {
573  m_aRootEntries.Clear();
574 
575  // Update entries
576  if (!CurrentCategory())
577  {
578  m_aEntries.Clear();
579  InvokeOnUpdateEntries(m_aEntries);
580  }
581  }
582 
583  //------------------------------------------------------------------------------------------------
586  SCR_SelectionMenuCategoryEntry CurrentCategory()
587  {
588  if (m_aSelectedCategories.IsEmpty())
589  return null;
590 
591  return m_aSelectedCategories[m_aSelectedCategories.Count() - 1];
592  }
593 
594  //------------------------------------------------------------------------------------------------
596  void SetMenuDisplay(SCR_SelectionMenuDisplay display = null)
597  {
598  m_Display = display;
599 
600  if (display)
601  display.SetupMenu(this);
602  }
603 
604  //------------------------------------------------------------------------------------------------
605  // Inputs
606  //------------------------------------------------------------------------------------------------
607 
608  //------------------------------------------------------------------------------------------------
610  protected void AddActionListeners()
611  {
612  if (m_ControllerInputs.m_bCloseOnReleaseOpen)
613  GetGame().GetInputManager().AddActionListener(m_ControllerInputs.m_sOpenAction, EActionTrigger.UP, OnOpenInputRelease);
614 
615  if (!m_ControllerInputs.m_sToggleActionAlternative.IsEmpty())
616  GetGame().GetInputManager().AddActionListener(m_ControllerInputs.m_sToggleActionAlternative, EActionTrigger.DOWN, OnAlternativeToggleInput);
617 
618  if (!m_Inputs.m_sPerformAction.IsEmpty())
619  GetGame().GetInputManager().AddActionListener(m_Inputs.m_sPerformAction, EActionTrigger.DOWN, OnPerformInput);
620 
621  if (!m_Inputs.m_sBackAction.IsEmpty())
622  GetGame().GetInputManager().AddActionListener(m_Inputs.m_sBackAction, EActionTrigger.DOWN, OnBackInput);
623  }
624 
625  //------------------------------------------------------------------------------------------------
627  protected void RemoveActionListeners()
628  {
629  if (!m_ControllerInputs || !m_Inputs)
630  return;
631 
632  GetGame().GetInputManager().RemoveActionListener(m_ControllerInputs.m_sOpenAction, EActionTrigger.UP, OnOpenInputRelease);
633  GetGame().GetInputManager().RemoveActionListener(m_ControllerInputs.m_sToggleActionAlternative, EActionTrigger.DOWN, OnAlternativeToggleInput);
634  GetGame().GetInputManager().RemoveActionListener(m_Inputs.m_sPerformAction, EActionTrigger.DOWN, OnPerformInput);
635  GetGame().GetInputManager().RemoveActionListener(m_Inputs.m_sBackAction, EActionTrigger.DOWN, OnBackInput);
636  }
637 
638  //------------------------------------------------------------------------------------------------
640  protected void OnOpenInputRelease(float value, EActionTrigger reason)
641  {
642  if (m_bUsingAlternativeToggle)
643  return;
644 
645  Close();
646  }
647 
648  //------------------------------------------------------------------------------------------------
650  protected void OnPerformInput()
651  {
652  if (m_SelectedEntry)
653  PerformEntry(m_SelectedEntry);
654  }
655 
656  //------------------------------------------------------------------------------------------------
657  protected void OnBackInput()
658  {
659  // Prevent entry performing
660  m_SelectedEntry = null;
661 
662  // Should close on top level
663  if (CurrentCategory())
664  {
665  LeaveCategory();
666  }
667  else
668  {
669  // Close on top level
670  Close();
671  }
672  }
673 
674  //------------------------------------------------------------------------------------------------
675  protected void OnAlternativeToggleInput()
676  {
677  m_bUsingAlternativeToggle = true;
678  }
679 
680  //------------------------------------------------------------------------------------------------
681  // API
682  //------------------------------------------------------------------------------------------------
683 
684  //------------------------------------------------------------------------------------------------
685  bool IsOpened()
686  {
687  return m_bOpened;
688  }
689 
690  //------------------------------------------------------------------------------------------------
692  void SetController(IEntity owner, SCR_SelectionMenuControllerInputs controls)
693  {
694  if (controls)
695  controls.m_Owner = owner;
696 
697  if (m_ControllerInputs != controls)
698  InvokeOnControllerChanged(controls);
699 
700  m_ControllerInputs = controls;
701  }
702 
703  //------------------------------------------------------------------------------------------------
704  SCR_SelectionMenuControllerInputs GetControllerInputs()
705  {
706  return m_ControllerInputs;
707  }
708 
709  //------------------------------------------------------------------------------------------------
710  SCR_SelectionMenuEntry GetSelectionEntry()
711  {
712  return m_SelectedEntry;
713  }
714 
715  //------------------------------------------------------------------------------------------------
716  int GetSelectedEntryId()
717  {
718  return m_iSelectedEntryId;
719  }
720 
721  //------------------------------------------------------------------------------------------------
722  bool GetEntryPerformed()
723  {
724  return m_bEntryPerformed;
725  }
726 
727  //------------------------------------------------------------------------------------------------
728  array<ref SCR_SelectionMenuEntry> GetEntries()
729  {
730  array<ref SCR_SelectionMenuEntry> entries = {};
731 
732  for (int i = 0, count = m_aEntries.Count(); i < count; i++)
733  {
734  entries.Insert(m_aEntries[i]);
735  }
736 
737  return entries;
738  }
739 
740  //------------------------------------------------------------------------------------------------
741  int GetEntryCount()
742  {
743  if (!m_aEntries)
744  return 0;
745 
746  return m_aEntries.Count();
747  }
748 
749  //------------------------------------------------------------------------------------------------
750  bool HasDisplay()
751  {
752  return m_Display != null;
753  }
754 
755  //------------------------------------------------------------------------------------------------
756  // Debug
757  //------------------------------------------------------------------------------------------------
758 
759  //------------------------------------------------------------------------------------------------
760  protected void DebugPrint(string method, string msg)
761  {
762  Print(string.Format("[SCR_SelectionMenu] - %1() - '%2'", method, msg), LogLevel.DEBUG);
763  }
764 };
765 
766 //------------------------------------------------------------------------------------------------
770 [BaseContainerProps(configRoot: true)]
772 {
773  [Attribute("", desc: "Input context used for menu controls")]
774  string m_sContext;
775 
776  [Attribute("", desc: "Action used for closing menu or moving back between the layers")]
777  string m_sBackAction;
778 
779  [Attribute("", desc: "Input action used for performing selected entry")]
780  string m_sPerformAction;
781 
782  //------------------------------------------------------------------------------------------------
784  void Init() {}
785 };
786 
787 //------------------------------------------------------------------------------------------------
793 [BaseContainerProps(configRoot: true)]
795 {
796  IEntity m_Owner;
797 
798  [Attribute("", desc: "Input context used for extra menu controls from controller entity")]
799  string m_sControllerContext;
800 
801  [Attribute("", desc: "Action for opening (and closing) radial menu")]
802  string m_sOpenAction;
803 
804  [Attribute("", desc: "Alternative action for always toggling menu")]
805  string m_sToggleActionAlternative;
806 
807  [Attribute("1", desc: "If this field is checked - Menu is closed if open input is released. Otherwise separate close input has to be used")]
808  bool m_bCloseOnReleaseOpen;
809 
810  [Attribute("1", desc: "If this field is checked - Perform entry(call entry action) when closing menu and having selected entry")]
811  bool m_bPerformOnClose;
812 
813  [Attribute("0", desc: "If this field is checked - Close the menu after performing the entry (selecting enabled entry)")]
814  bool m_bCloseOnPerform;
815 
816  [Attribute("1", desc: "Checked - on opening menu is always filled with root entries. Otherwise menu will stay in last category.")]
817  bool m_bOpenInRoot;
818 
819  [Attribute("0", desc: "If checked, menu won't open if there are no entries in the menu")]
820  bool m_bPreventEmptyMenuOpen;
821 
822  [Attribute("1", UIWidgets.Slider, desc: "Unchecked will prevent opening of radial menu while character is unconcious.")]
823  bool m_bShowWhileUnconcious;
824 
825  //------------------------------------------------------------------------------------------------
826  void SCR_SelectionMenuOpening(string openAction = "")
827  {
828  if (!openAction.IsEmpty())
829  m_sOpenAction = openAction;
830  }
831 
832  //------------------------------------------------------------------------------------------------
834  bool IsControllingMenu(IEntity controller)
835  {
836  return controller == m_Owner;
837  }
838 };
839 
840 //------------------------------------------------------------------------------------------------
844 [BaseContainerProps(configRoot: true)]
846 {
847  [Attribute()]
848  protected ref array<ref SCR_SelectionMenuEntry> m_aEntries;
849 
850  //------------------------------------------------------------------------------------------------
851  array<ref SCR_SelectionMenuEntry> GetEntries()
852  {
853  array<ref SCR_SelectionMenuEntry> entries = {};
854 
855  for (int i = 0, count = m_aEntries.Count(); i < count; i++)
856  {
857  entries.Insert(m_aEntries[i]);
858  }
859 
860  return entries;
861  }
862 };
863 
864 //------------------------------------------------------------------------------------------------
868 {
869  [Attribute("10")]
870  float m_fCustomFov;
871 
872  [Attribute("-1", desc: "Adjust how final render preview size should be big by current icon size multiplicaiton")]
873  float m_fIconSizeXMultiplier;
874 
875  [Attribute(desc: "If true colorize item shadow in Radial Menu to medical color")]
876  bool m_bShowMedicalColor;
877 };
SCR_SelectionMenuCategoryEntry
Definition: SCR_SelectionMenuCategory.c:6
SCR_UISoundEntity
Definition: SCR_UISoundEntity.c:7
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_SelectionMenu
Definition: SCR_SelectionMenu.c:6
SCR_SelectionMenuPreviewAttributes
Definition: SCR_SelectionMenu.c:867
m_aEntries
protected ref array< ref SCR_TextsTaskManagerEntry > m_aEntries
Definition: SCR_TextsTaskManagerComponent.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_SelectionMenuInputs
Definition: SCR_SelectionMenu.c:771
SCR_SelectionMenuControllerInputs
Definition: SCR_SelectionMenu.c:794
SCR_SelectionMenuDisplay
Definition: SCR_SelectionMenuDisplay.c:7
SCR_SelectionMenuEntry
Definition: SCR_SelectionMenuEntry.c:7
SCR_SelectionMenuData
Definition: SCR_SelectionMenu.c:845
m_Owner
SCR_AIGroupUtilityComponentClass m_Owner
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
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
BaseItemAttributeData
Definition: BaseItemAttributeData.c:12