Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MilitarySymbolUIComponent.c
Go to the documentation of this file.
1 class SCR_MilitarySymbolUIComponent : ScriptedWidgetComponent
2 {
3  protected const ResourceName DEBUG_CONFIG = "{9D381AA96A15D6B4}Configs/GroupIdentity/MilitarySymbolConfig.conf";
4 
5  [Attribute(desc: "Initial military symbol data. When undefined, it has to be set by script.")]
6  protected ref SCR_MilitarySymbol m_MilitarySymbol;
7 
8  protected Widget m_Widget;
9 
10  //------------------------------------------------------------------------------------------------
14  void Update(notnull SCR_MilitarySymbol symbol, SCR_MilitarySymbolConfig config = null)
15  {
16  //--- Use default config
17  if (!config)
18  {
20  if (core)
21  config = core.GetSymbols();
22  }
23 
24  if (!config)
25  {
26  Print("Cannot show military symbol, config not found!", LogLevel.WARNING);
27  return;
28  }
29 
30  SCR_WidgetTools.RemoveChildrenFromHierarchy(m_Widget);
31  config.CreateWidgets(symbol, m_Widget);
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  override void HandlerAttached(Widget w)
36  {
37  m_Widget = w;
38 
39  if (m_MilitarySymbol)
40  {
41 #ifdef WORKBENCH
42  //--- Core not loaded when the game is running, use debug config
43  Resource resource = Resource.Load(DEBUG_CONFIG);
44  if (!resource.IsValid())
45  {
46  Print("Invalid config " + DEBUG_CONFIG, LogLevel.WARNING);
47  return;
48  }
49 
50  SCR_MilitarySymbolConfig config = SCR_MilitarySymbolConfig.Cast(BaseContainerTools.CreateInstanceFromContainer(resource.GetResource().ToBaseContainer()));
51  Update(m_MilitarySymbol, config);
52 #else
53  Update(m_MilitarySymbol);
54 #endif
55  }
56  }
57 
58  //------------------------------------------------------------------------------------------------
59  override void HandlerDeattached(Widget w)
60  {
61  }
62 }
SCR_WidgetTools
Definition: SCR_WidgetTools.c:1
SCR_MilitarySymbol
Definition: SCR_MilitarySymbol.c:2
SCR_GroupIdentityCore
Definition: SCR_GroupIdentityCore.c:2
SCR_MilitarySymbolConfig
Definition: SCR_MilitarySymbolConfig.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_MilitarySymbolUIComponent
Definition: SCR_MilitarySymbolUIComponent.c:1