Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDrawDebugSphere.c
Go to the documentation of this file.
1 class SCR_AIDrawDebugSphere: AITaskScripted
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  };
19  override TStringArray GetVariablesIn()
20  {
21  return s_aVarsIn;
22  }
23 
24  //------------------------------------------------------------------------------------------------
25  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  {
36  vector position;
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 override string GetOnHoverDescription()
55  {
56  return "Draws a sphere of given radius";
57  }
58 };
SCR_AIDrawDebugSphere
Definition: SCR_AIDrawDebugSphere.c:1
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_fRadius
float m_fRadius
Definition: SCR_AITargetClusterState.c:30
m_Color
ref Color m_Color
Definition: SCR_GeneratorBaseEntity.c:3
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition: DebugMenuID.c:3
position
vector position
Definition: SCR_DestructibleTreeV2.c:30