Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MilitarySymbolUIComponent.c
Go to the documentation of this file.
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.")]
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
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
54#endif
55 }
56 }
57
58 //------------------------------------------------------------------------------------------------
59 override void HandlerDeattached(Widget w)
60 {
61 }
62}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
SCR_MilitarySymbolConfig GetSymbols()
void Update(notnull SCR_MilitarySymbol symbol, SCR_MilitarySymbolConfig config=null)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute