Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_GroupEditableEntityUIComponent.c
Go to the documentation of this file.
2 {
4  protected ref array<ref SCR_GroupEditableEntityTextureUIComponent> m_Textures;
5 
7  protected string m_sIconWidgetName;
8 
9  protected SCR_MilitarySymbolUIComponent m_SymbolUI;
10 
11  //------------------------------------------------------------------------------------------------
12  protected bool RefreshSymbol(SCR_EditableEntityComponent entity)
13  {
14  SCR_GroupIdentityComponent identity = SCR_GroupIdentityComponent.Cast(entity.GetOwner().FindComponent(SCR_GroupIdentityComponent));
15  if (identity)
16  return RefreshSymbol(identity.GetMilitarySymbol());
17  else
18  return false;
19  }
20 
21  //------------------------------------------------------------------------------------------------
22  protected bool RefreshSymbol(SCR_UIInfo info)
23  {
24  SCR_EditableGroupUIInfo groupInfo = SCR_EditableGroupUIInfo.Cast(info);
25  if (groupInfo)
26  return RefreshSymbol(groupInfo.GetMilitarySymbol());
27  else
28  return false;
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  protected bool RefreshSymbol(SCR_MilitarySymbol symbol)
33  {
34  if (!symbol)
35  return false;
36 
37  if (m_SymbolUI)
38  m_SymbolUI.Update(symbol);
39 
40  if (!m_Textures.IsEmpty())
41  {
42  ImageWidget iconWidget = ImageWidget.Cast(GetWidget().FindAnyWidget(m_sIconWidgetName));
43  if (iconWidget)
44  {
45  bool hasTexture;
46  foreach (SCR_GroupEditableEntityTextureUIComponent texture: m_Textures)
47  {
48  if (texture.m_Identity == symbol.GetIdentity() && texture.m_Dimension == symbol.GetDimension())
49  {
50  string ext;
51  FilePath.StripExtension(texture.m_Texture, ext);
52  if (ext == "imageset")
53  iconWidget.LoadImageFromSet(0, texture.m_Texture, texture.m_ImageName);
54  else
55  iconWidget.LoadImageTexture(0, texture.m_Texture);
56 
57  iconWidget.SetVisible(true);
58  hasTexture = true;
59  break;
60  }
61  }
62  iconWidget.SetVisible(hasTexture);
63  }
64  }
65  return true;
66  }
67 
68  //------------------------------------------------------------------------------------------------
69  override void OnRefresh(SCR_EditableEntityBaseSlotUIComponent slot)
70  {
71  RefreshSymbol(m_Entity);
72  }
73 
74  //------------------------------------------------------------------------------------------------
76  {
77  super.OnInit(entity, info, slot);
78 
80 
81  if (entity && RefreshSymbol(entity))
82  return;
83 
84  RefreshSymbol(info);
85  }
86 }
87 
89 class SCR_GroupEditableEntityTextureUIComponent
90 {
91  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolIdentity))]
92  EMilitarySymbolIdentity m_Identity;
93 
94  [Attribute("1", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolDimension))]
95  EMilitarySymbolDimension m_Dimension;
96 
97  [Attribute(uiwidget:UIWidgets.ResourcePickerThumbnail, params: "edds imageset")]
98  ResourceName m_Texture;
99 
100  [Attribute()]
101  string m_ImageName;
102 }
m_Textures
protected ref array< ref SCR_GroupEditableEntityTextureUIComponent > m_Textures
Definition: SCR_GroupEditableEntityUIComponent.c:3
SCR_MilitarySymbol
Definition: SCR_MilitarySymbol.c:2
SCR_EditableEntityBaseSlotUIComponent
Definition: SCR_EditableEntityBaseSlotUIComponent.c:6
m_Entity
enum EAITargetInfoCategory m_Entity
m_sIconWidgetName
protected string m_sIconWidgetName
Definition: SCR_GroupEditableEntityUIComponent.c:6
EMilitarySymbolIdentity
EMilitarySymbolIdentity
Definition: EMilitarySymbol.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseContainerMilitaryLayout
SCR_GroupEditableEntityUIComponent SCR_BaseEditableEntityUIComponent SCR_BaseContainerMilitaryLayout()] class SCR_GroupEditableEntityTextureUIComponent
Definition: SCR_GroupEditableEntityUIComponent.c:88
SCR_BaseEditableEntityUIComponent
Definition: SCR_BaseEditableEntityUIComponent.c:8
SCR_UIInfo
Definition: SCR_UIInfo.c:7
m_SymbolUI
protected SCR_MilitarySymbolUIComponent m_SymbolUI
Definition: SCR_GroupEditableEntityUIComponent.c:8
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
EMilitarySymbolDimension
EMilitarySymbolDimension
Definition: EMilitarySymbol.c:14
SCR_EditableGroupUIInfo
Definition: SCR_EditableGroupUIInfo.c:2
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_GroupEditableEntityUIComponent
Definition: SCR_GroupEditableEntityUIComponent.c:1
BaseContainerProps
SCR_GroupEditableEntityUIComponent SCR_BaseEditableEntityUIComponent BaseContainerProps()
SCR_MilitarySymbolUIComponent
Definition: SCR_MilitarySymbolUIComponent.c:1
GetWidget
protected Widget GetWidget()
Definition: SCR_VonDisplay.c:155