Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIMessageSelectionMenuEntry.c
Go to the documentation of this file.
2 {
3  private AICommunicationComponent m_ParentComms;
4  private AIAgent m_Receiver;
5 
6  void SetParentComms(AICommunicationComponent parentComms, AIAgent receiver)
7  {
8  m_ParentComms = parentComms;
9  m_Receiver = receiver;
10  }
11 
13  protected override event void OnPerform(IEntity user, BaseSelectionMenu sourceMenu)
14  {
15  super.OnPerform(user, sourceMenu);
16  if (m_ParentComms)
17  {
18  m_ParentComms.RequestBroadcast(GetAIMessage(), m_Receiver);
19  }
20  }
21 
22  protected override bool CanBeShownScript(IEntity user, BaseSelectionMenu sourceMenu)
23  {
24  // TODO: custom show logic
25  return true;
26  }
27 
28  protected override bool CanBePerformedScript(IEntity user, BaseSelectionMenu sourceMenu)
29  {
30 
31  // TODO: custom perform logic
32  return true;
33  }
34 
35  protected override bool GetEntryNameScript(out string outName)
36  {
37  auto pMessage = GetAIMessage();
38  if (!pMessage)
39  {
40  outName = "Command";
41  return true;
42  }
43 
44  string sName = pMessage.GetText();
45  outName = sName;
46  return true;
47  }
48 
49  protected override bool GetEntryDescriptionScript(out string outDescription)
50  {
51  return false;
52  }
53 };
AIMessageSelectionMenuEntry
Definition: AIMessageSelectionMenuEntry.c:12
SCR_AIMessageSelectionMenuEntry
Definition: SCR_AIMessageSelectionMenuEntry.c:1
BaseSelectionMenu
Definition: BaseSelectionMenu.c:12