Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDrawDebugSphere.c
Go to the documentation of this file.
2{
3 static const string PORT_ORIGIN = "OriginIn";
4 static const string PORT_RADIUS = "RadiusIn";
5
6 [Attribute("1", UIWidgets.EditBox, desc: "Radius of sphere" )]
7 private float m_fRadius;
8
9 [Attribute("0.18 0.80 0.44 1", UIWidgets.ColorPicker, desc: "Color of sphere" )]
10 private ref Color m_Color;
11
12 ref Shape sphere;
13
14 //------------------------------------------------------------------------------------------------
15 protected static ref TStringArray s_aVarsIn = {
16 PORT_ORIGIN,
17 PORT_RADIUS
18 };
20 {
21 return s_aVarsIn;
22 }
23
24 //------------------------------------------------------------------------------------------------
25 static override bool VisibleInPalette()
26 {
27 return true;
28 }
29
30 //------------------------------------------------------------------------------------------------
31 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
32 {
33#ifdef WORKBENCH
34 if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_AI_SHOW_DEBUG_SHAPES))
35 {
37 float radius;
38 int color;
39
40 GetVariableIn(PORT_ORIGIN, position);
41 if(!GetVariableIn(PORT_RADIUS, radius))
42 radius = m_fRadius;
43 if (m_Color)
44 color =m_Color.PackToInt();
45 else
46 color = COLOR_GREEN_A;
47 sphere = Shape.CreateSphere(color, ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE, position, radius);
48 }
49#endif
50 return ENodeResult.SUCCESS;
51 }
52
53 //------------------------------------------------------------------------------------------------
54 protected static override string GetOnHoverDescription()
55 {
56 return "Draws a sphere of given radius";
57 }
58};
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition DebugMenuID.c:4
vector position
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
Diagnostic and developer menu system.
Definition DiagMenu.c:18
proto bool GetVariableIn(string name, out void val)
override TStringArray GetVariablesIn()
static override bool VisibleInPalette()
static ref TStringArray s_aVarsIn
static override string GetOnHoverDescription()
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Instance of created debug visualizer.
Definition Shape.c:14
ENodeResult
Definition ENodeResult.c:13
const int COLOR_GREEN_A
Definition constants.c:27
ShapeFlags
Definition ShapeFlags.c:13
SCR_FieldOfViewSettings Attribute
array< string > TStringArray
Definition Types.c:385