Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LightFireplaceUserAction.c
Go to the documentation of this file.
1 //simple script for lighting fireplces
2 
4 {
5  [Attribute("#AR-UserAction_LightFire", UIWidgets.EditBox, "Description for action menu (light up)", "")]
6  protected LocalizedString m_sLightDescription;
7  [Attribute("#AR-UserAction_PutOutFire", UIWidgets.EditBox, "Description for action menu (extinguish)", "")]
8  protected LocalizedString m_sExtinguishDescription;
9 
10  protected SCR_FireplaceComponent m_FireplaceComponent;
11 
12  //------------------------------------------------------------------------------------------------
13  override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
14  {
15  m_FireplaceComponent = SCR_FireplaceComponent.Cast(pOwnerEntity.FindComponent(SCR_FireplaceComponent));
16  }
17 
18  //------------------------------------------------------------------------------------------------
19  override bool CanBeShownScript(IEntity user)
20  {
21  if (!m_FireplaceComponent)
22  return false;
23 
24  return true;
25  }
26 
27  //------------------------------------------------------------------------------------------------
28  override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
29  {
30  m_FireplaceComponent.ToggleLight(!m_FireplaceComponent.IsOn())
31  }
32 
33  //------------------------------------------------------------------------------------------------
34  override bool GetActionNameScript(out string outName)
35  {
36  if (!m_FireplaceComponent)
37  return false;
38 
39  if (!m_FireplaceComponent.IsOn())
40  outName = m_sLightDescription;
41  else
42  outName = m_sExtinguishDescription;
43 
44  return true;
45  }
46 };
ScriptedUserAction
Definition: ScriptedUserAction.c:12
Attribute
typedef Attribute
Post-process effect of scripted camera.
LocalizedString
Definition: LocalizedString.c:21
SCR_LightFireplaceUserAction
Definition: SCR_LightFireplaceUserAction.c:3