Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MapMarkerMenuEntry.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  const string WIDGET_SYMBOL = "SymbolOverlay";
6 
7  protected int m_iMarkerConfigID; // used to load proper config entry when placing from selection menu
8  protected SCR_EMapMarkerType m_eMarkerType;
9  protected SCR_MilitarySymbolUIComponent m_SymbolComp;
10 
11  protected ref Color m_Color = GUIColors.DEFAULT;
12  protected ref SCR_MilitarySymbol m_MilSymbol = new SCR_MilitarySymbol();
13 
14 
15  //------------------------------------------------------------------------------------------------
16  SCR_EMapMarkerType GetMarkerType()
17  {
18  return m_eMarkerType;
19  }
20 
21  //------------------------------------------------------------------------------------------------
22  void SetMarkerType(SCR_EMapMarkerType type)
23  {
24  m_eMarkerType = type;
25  }
26 
27  //------------------------------------------------------------------------------------------------
28  int GetMarkerConfigID()
29  {
30  return m_iMarkerConfigID;
31  }
32 
33  //------------------------------------------------------------------------------------------------
34  void SetMarkerConfigID(int id)
35  {
36  m_iMarkerConfigID = id;
37  }
38 
39  //------------------------------------------------------------------------------------------------
41  void SetSymbolProps(EMilitarySymbolIdentity faction, Color color, EMilitarySymbolDimension dimension, EMilitarySymbolIcon iconFlag, EMilitarySymbolAmplifier amplifier)
42  {
43  m_Color = color;
44 
45  m_MilSymbol.SetIdentity(faction);
46  m_MilSymbol.SetDimension(dimension);
47  m_MilSymbol.SetIcons(iconFlag);
48  m_MilSymbol.SetAmplifier(amplifier);
49 
50  // component will be created with entry layout, which is only done after category is entered from the menu
52  if (!entryComp)
53  return;
54 
55  Widget symbolWidget = entryComp.GetRootWidget().FindAnyWidget(WIDGET_SYMBOL);
56  if (!symbolWidget)
57  return;
58 
59  symbolWidget.SetColor(m_Color);
60 
61  m_SymbolComp = SCR_MilitarySymbolUIComponent.Cast(symbolWidget.FindHandler(SCR_MilitarySymbolUIComponent));
62  if (m_SymbolComp)
63  m_SymbolComp.Update(m_MilSymbol);
64  }
65 
66  //------------------------------------------------------------------------------------------------
68  void SetLayout()
69  {
70  if (m_eMarkerType == SCR_EMapMarkerType.PLACED_MILITARY)
71  SetCustomLayout("{F328D6835DA3BCFC}UI/layouts/Common/RadialMenu/RadialMenuMarkerEntry.layout");
72  else
73  SetCustomLayout("{B7B4E9F530904414}UI/layouts/Common/RadialMenu/SelectionMenuEntryIcon.layout");
74  }
75 
76  //------------------------------------------------------------------------------------------------
77  override void SetEntryComponent(SCR_SelectionMenuEntryComponent entryComponent)
78  {
79  super.SetEntryComponent(entryComponent);
80 
82  if (!entryComp)
83  return;
84 
85  Widget symbolWidget = entryComp.GetRootWidget().FindAnyWidget(WIDGET_SYMBOL);
86  if (!symbolWidget)
87  return;
88 
89  symbolWidget.SetColor(m_Color);
90 
91  m_SymbolComp = SCR_MilitarySymbolUIComponent.Cast(symbolWidget.FindHandler(SCR_MilitarySymbolUIComponent));
92  if (m_SymbolComp)
93  m_SymbolComp.Update(m_MilSymbol);
94  }
95 
96  //------------------------------------------------------------------------------------------------
98  {
99  SetLayout();
100  }
101 };
SCR_MilitarySymbol
Definition: SCR_MilitarySymbol.c:2
SCR_SelectionMenuEntryIconComponent
Definition: SCR_SelectionMenuEntryIconComponent.c:2
EMilitarySymbolIdentity
EMilitarySymbolIdentity
Definition: EMilitarySymbol.c:1
SCR_EMapMarkerType
SCR_EMapMarkerType
Definition: SCR_MapMarkerConfig.c:5
EMilitarySymbolAmplifier
EMilitarySymbolAmplifier
Definition: EMilitarySymbol.c:63
SCR_SelectionMenuEntryComponent
Definition: SCR_SelectionMenuEntryComponent.c:6
m_Color
ref Color m_Color
Definition: SCR_GeneratorBaseEntity.c:3
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
SCR_MapMarkerMenuEntry
Base entry for marker selection menu.
Definition: SCR_MapMarkerMenuEntry.c:3
EMilitarySymbolDimension
EMilitarySymbolDimension
Definition: EMilitarySymbol.c:14
SCR_SelectionMenuEntry
Definition: SCR_SelectionMenuEntry.c:7
SCR_MilitarySymbolUIComponent
Definition: SCR_MilitarySymbolUIComponent.c:1
EMilitarySymbolIcon
EMilitarySymbolIcon
Definition: EMilitarySymbol.c:29