Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
UnitDisplayManager.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Spectating", description: "This brief script description.", color: "0 0 255 255")]
2 class SCR_UnitDisplayManagerClass: GenericEntityClass
3 {
4 };
5 
6 // TODO: Naming conventions
8 {
9  // Whether shape should use faction color alpha or not
10  static bool s_bShapeUseAlpha = true;
11  // Whether shape should get bigger the further camera is
12  static bool s_bShapeUseScaling = true;
13  // Whether there should be text drawn on close proximity with a unit
14  static bool s_bShapeUseText = true;
15  // Whether there should be a healthbar drawn on close proximity with a unit
16  static bool s_bShapeUseHealthbar = true;
17  // Maximum distance in metres at which text will be shown (if enabled)
18  static float s_fShapeTextDistance = 15.0;
19  // Offset of the text from entity's origin in Y axis
20  static float s_fShapeTextHeightOffset = 2.35;
21  // Size of the text. (0.2 is a good value)
22  static float s_fShapeTextSize = 0.1;
23  // Offset of the shape from entity's origin in Y axis
24  static float s_fShapeHeightOffset = 2.15;
25  // Health bar width
26  static float s_fShapeHealthbarWidth = 1.5;
27  // Health bar height
28  static float s_fShapeHealthbarHeight = 0.03;
29 
30  // Radius of the shape
31  static float s_fShapeRadius = 0.125;
32  // The distance from camera at which (and below) the shape will retain it's minimum size
33  static float s_fShapeSizeGoal = 15.0;
34  static float s_fShapeSizeMinimum = 1.0;
35  static float s_fShapeSizeMaximum = 17.5;
36 
37 };
38 
39 //------------------------------------------------------------------------------------------------
41 {
42  [Attribute("1", UIWidgets.CheckBox, "Whether shape should use alpha directly from faction color.", "")]
43  bool m_bShapeUseAlpha;
44  [Attribute("1", UIWidgets.CheckBox, "Whether shape should scale based on camera distance.", "")]
45  bool m_bShapeUseScaling;
46  [Attribute("1", UIWidgets.CheckBox, "Whether info text should be drawn when close to a unit.", "")]
47  bool m_bShapeUseText;
48  [Attribute("1", UIWidgets.CheckBox, "Whether health bar should be drawn when close to a unit.", "")]
49  bool m_bShapeUseHealthbar;
50  [Attribute("15.0", UIWidgets.Slider, "Maximum distance in metres at which text will be shown (if enabled)", "0 100 0.1")]
51  float m_fShapeTextDistance;
52  [Attribute("2.35", UIWidgets.Slider, "Offset of the text from entity's origin in Y axis", "0 100 0.1")]
53  float m_fShapeTextHeightOffset;
54 
55  [Attribute("0.12", UIWidgets.Slider, "Size of the text. (0.1, 0.2 are good values example)", "0 1 0.01")]
56  float m_fShapeTextSize;
57  [Attribute("2.15", UIWidgets.Slider, "Offset of the shape from entity's origin in Y axis", "0 100 0.1")]
58  float m_fShapeHeightOffset;
59 
60  [Attribute("1.5", UIWidgets.Slider, "Health bar width, 1.5 is a fair value", "0 10 0.01")]
61  float m_fShapeHealthbarWidth;
62  [Attribute("0.03", UIWidgets.Slider, "Health bar height, 0.03, 0.05 are a fair value", "0 1 0.0025")]
63  float m_fShapeHealthbarHeight;
64 
65  [Attribute("0.125", UIWidgets.Slider, "Radius of the shape, a value of 0.125 is fine", "0 1 0.0025")]
66  float m_fShapeRadius;
67 
68 
69  [Attribute("15", UIWidgets.Slider, "The distance in metres from camera at which (and below) the shape will retain it's minimum size", "0 100 0.1")]
70  float m_fShapeSizeGoal;
71  [Attribute("1.0", UIWidgets.Slider, "Shape's minimum size", "0 10 0.1")]
72  float m_fShapeSizeMinimum;
73  [Attribute("17.5", UIWidgets.Slider, "Shape's maximum size", "0 100 0.1")]
74  float m_fShapeSizeMaximum;
75 
76  //------------------------------------------------------------------------------------------------
77  override void EOnInit(IEntity owner)
78  {
79  // Ugly, but guarantees this works even without a manager in the world
80  // TODO: Solve in a nicer way (some sort of defaults)
81  SCR_UnitDisplaySettings.s_bShapeUseAlpha = m_bShapeUseAlpha;
82  SCR_UnitDisplaySettings.s_bShapeUseScaling = m_bShapeUseScaling;
83  SCR_UnitDisplaySettings.s_bShapeUseText = m_bShapeUseText;
84  SCR_UnitDisplaySettings.s_bShapeUseHealthbar = m_bShapeUseHealthbar;
85  SCR_UnitDisplaySettings.s_fShapeTextDistance = m_fShapeTextDistance;
86  SCR_UnitDisplaySettings.s_fShapeTextHeightOffset = m_fShapeTextHeightOffset;
87  SCR_UnitDisplaySettings.s_fShapeTextSize = m_fShapeTextSize;
88  SCR_UnitDisplaySettings.s_fShapeHeightOffset = m_fShapeHeightOffset;
89  SCR_UnitDisplaySettings.s_fShapeHealthbarWidth = m_fShapeHealthbarWidth;
90  SCR_UnitDisplaySettings.s_fShapeHealthbarHeight = m_fShapeHealthbarHeight;
91  SCR_UnitDisplaySettings.s_fShapeRadius = m_fShapeRadius;
92  SCR_UnitDisplaySettings.s_fShapeSizeGoal = m_fShapeSizeGoal;
93  SCR_UnitDisplaySettings.s_fShapeSizeMinimum = m_fShapeSizeMinimum;
94  SCR_UnitDisplaySettings.s_fShapeSizeMaximum = m_fShapeSizeMaximum;
95  }
96 
97  //------------------------------------------------------------------------------------------------
98  void SCR_UnitDisplayManager(IEntitySource src, IEntity parent)
99  {
100  SetEventMask(EntityEvent.INIT);
101  }
102 
103  //------------------------------------------------------------------------------------------------
104  void ~SCR_UnitDisplayManager()
105  {
106  }
107 
108 };
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_UnitDisplayManager
Definition: UnitDisplayManager.c:40
SCR_UnitDisplayManagerClass
Definition: UnitDisplayManager.c:2
SCR_UnitDisplaySettings
Definition: UnitDisplayManager.c:7
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180