Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditableDescriptorUIInfo.c
Go to the documentation of this file.
3 {
4  [Attribute(uiwidget: UIWidgets.LocaleEditBox)]
5  protected LocalizedString m_sNameFormat;
6 
7  [Attribute(uiwidget: UIWidgets.LocaleEditBox)]
8  protected LocalizedString m_sDescriptionFormat;
9 
10  protected LocalizedString m_sLocationName;
11  protected string m_sNameEncoded;
12  protected string m_sDescriptionEncoded;
13 
14  //------------------------------------------------------------------------------------------------
17  LocalizedString GetLocationName()
18  {
19  return m_sLocationName;
20  }
21 
22  //------------------------------------------------------------------------------------------------
25  void SetLocationName(LocalizedString locationName)
26  {
27  m_sLocationName = locationName;
28  //EncodeName();
29  }
30 
31  //------------------------------------------------------------------------------------------------
34  void SetLocationName(vector pos)
35  {
36  m_sLocationName = SCR_MapEntity.GetGridLabel(pos);
37  //EncodeName();
38  }
39 
40  /*
41  //------------------------------------------------------------------------------------------------
42  protected void EncodeName()
43  {
44  m_sNameEncoded = SCR_LocalizationTools.EncodeFormat(m_sNameFormat, m_sLocationName);
45  m_sDescriptionEncoded = SCR_LocalizationTools.EncodeFormat(m_sDescriptionFormat, m_sLocationName);
46  }
47 
48  //------------------------------------------------------------------------------------------------
49  override LocalizedString GetName()
50  {
51  if (m_sLocationName)
52  return m_sNameEncoded;
53  else
54  return super.GetName();
55  }
56 
57  //------------------------------------------------------------------------------------------------
58  override LocalizedString GetDescription()
59  {
60  if (m_sLocationName)
61  return m_sDescriptionEncoded;
62  else
63  return super.GetDescription();
64  }
65  */
66 
67  //------------------------------------------------------------------------------------------------
68  override bool SetNameTo(TextWidget textWidget)
69  {
70  if (!textWidget)
71  return false;
72 
73  if (m_sLocationName.IsEmpty())
74  {
75  return super.SetNameTo(textWidget);
76  }
77  else
78  {
79  textWidget.SetTextFormat(m_sNameFormat, m_sLocationName);
80  return true;
81  }
82  }
83 
84  //------------------------------------------------------------------------------------------------
85  override bool SetDescriptionTo(TextWidget textWidget)
86  {
87  if (!textWidget)
88  return false;
89 
90  if (m_sLocationName.IsEmpty())
91  {
92  return super.SetDescriptionTo(textWidget);
93  }
94  else
95  {
96  textWidget.SetTextFormat(m_sDescriptionFormat, m_sLocationName);
97  return true;
98  }
99  }
100 
101  //------------------------------------------------------------------------------------------------
102  // override without 'protected' keyword
103  override void CopyFrom(SCR_UIName source)
104  {
105  SCR_EditableDescriptorUIInfo descriptorSource = SCR_EditableDescriptorUIInfo.Cast(source);
106  if (descriptorSource)
107  {
108  m_sNameFormat = descriptorSource.m_sNameFormat;
109  m_sDescriptionFormat = descriptorSource.m_sDescriptionFormat;
110  }
111  else
112  {
113  m_sNameFormat = source.Name;
114 
115  SCR_UIDescription descriptionSource = SCR_UIDescription.Cast(source);
116  if (descriptionSource)
117  m_sDescriptionFormat = descriptionSource.Description;
118  }
119 
120  super.CopyFrom(source);
121  }
122 
123  //------------------------------------------------------------------------------------------------
124  // constructor
126  {
127  if (!m_sNameFormat)
128  m_sNameFormat = Name;
129 
130  if (!m_sDescriptionFormat)
131  m_sDescriptionFormat = Description;
132  }
133 }
SCR_EditableDescriptorUIInfo
Definition: SCR_EditableDescriptorUIInfo.c:2
SCR_UIName
Definition: SCR_UIName.c:5
SCR_EditableEntityUIInfo
Definition: SCR_EditableEntityUIInfo.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_sLocationName
protected LocalizedString m_sLocationName
Definition: SCR_EditableDescriptorComponent.c:18
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
LocalizedString
Definition: LocalizedString.c:21
SCR_UIDescription
Definition: SCR_UIDescription.c:5
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