Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ExplosiveChargeDetail.c
Go to the documentation of this file.
3{
4 [Attribute("#AR-ValueUnit_Short_Seconds")]
5 protected string m_sShortSecondsFormat;
6
7 [Attribute("#AR-ValueUnit_Short_Minutes")]
8 protected string m_sShortMinutesFormat;
9
11
13
14 //------------------------------------------------------------------------------------------------
15 override bool NeedUpdate()
16 {
17 return true;
18 }
19
20 //------------------------------------------------------------------------------------------------
22 {
24 return;
25
26 ChimeraWorld world = ChimeraWorld.CastFrom(GetGame().GetWorld());
27 if (!world)
28 return;
29
30 TimeAndWeatherManagerEntity timeAndWeatherManager = world.GetTimeAndWeatherManager();
31 if (!timeAndWeatherManager)
32 return;
33
34 int remainingTime;
35 if (m_ExplosiveChargeComp.GetUsedFuzeType() == SCR_EFuzeType.TIMED)
36 remainingTime = Math.Max((m_ExplosiveChargeComp.GetTimeOfDetonation() - timeAndWeatherManager.GetEngineTime()), 0);
37
38 if (!m_wText)
39 return;
40
41 if (remainingTime < 120)
42 {
43 m_wText.SetTextFormat(m_sShortSecondsFormat, remainingTime);
44 }
45 else
46 {
47 remainingTime /= 60;
48 m_wText.SetTextFormat(m_sShortMinutesFormat, remainingTime);
49 }
50 }
51
52 //------------------------------------------------------------------------------------------------
53 override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
54 {
55 m_wText = TextWidget.Cast(widget);
56
57 if (!m_wText)
58 return false;
59
62 return false;
63
64 return m_ExplosiveChargeComp.GetUsedFuzeType() == SCR_EFuzeType.TIMED;
65 }
66}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_EFuzeType
Enum with all types of fuzes.
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition Math.c:13
override void UpdateDetail(SCR_EditableEntityComponent entity)
override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
SCR_ExplosiveChargeComponent m_ExplosiveChargeComp
SCR_FieldOfViewSettings Attribute