Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PingEditorUIComponent.c
Go to the documentation of this file.
1
2
4{
7
8 //------------------------------------------------------------------------------------------------
9 protected void OnEditorPing(float value, EActionTrigger reason)
10 {
11 SendPing(false);
12 }
13
14 //------------------------------------------------------------------------------------------------
15 protected void OnEditorPingUnlimitedOnly(float value, EActionTrigger reason)
16 {
17 SendPing(true);
18 }
19
20 //------------------------------------------------------------------------------------------------
21 protected void SendPing(bool unlimitedOnly)
22 {
24 SCR_CursorEditorUIComponent cursorComponent = SCR_CursorEditorUIComponent.Cast(GetRootComponent().FindComponent(SCR_CursorEditorUIComponent, true));
25 if (cursorComponent)
26 {
27 if (!cursorComponent.GetCursorWorldPos(position))
28 return;
29 }
30
32 if (m_HoverFilter)
33 target = m_HoverFilter.GetEntityUnderCursor();
34
35 m_PingManager.SendPing(unlimitedOnly, position, target);
36 }
37
38 //------------------------------------------------------------------------------------------------
40 {
42 if (!m_PingManager)
43 return;
44
46
47 InputManager inputManager = GetGame().GetInputManager();
48 if (inputManager)
49 {
50 inputManager.AddActionListener("EditorPing", EActionTrigger.DOWN, OnEditorPing);
51 inputManager.AddActionListener("EditorPingUnlimitedOnly", EActionTrigger.DOWN, OnEditorPingUnlimitedOnly);
52 }
53 }
54
55 //------------------------------------------------------------------------------------------------
56 override void HandlerDeattached(Widget w)
57 {
58 super.HandlerDeattached(w);
59
60 InputManager inputManager = GetGame().GetInputManager();
61 if (inputManager)
62 {
63 inputManager.RemoveActionListener("EditorPing", EActionTrigger.DOWN, OnEditorPing);
64 inputManager.RemoveActionListener("EditorPingUnlimitedOnly", EActionTrigger.DOWN, OnEditorPingUnlimitedOnly);
65 }
66 }
67}
ArmaReforgerScripted GetGame()
Definition game.c:1398
vector position
Input management system for user interactions.
bool GetCursorWorldPos(out vector worldPos, bool isNormalized=false, TraceFlags flags=-1)
SCR_PingEditorComponent m_PingManager
override void HandlerDeattached(Widget w)
override void HandlerAttachedScripted(Widget w)
void OnEditorPing(float value, EActionTrigger reason)
SCR_HoverEditableEntityFilter m_HoverFilter
void OnEditorPingUnlimitedOnly(float value, EActionTrigger reason)
void SendPing(bool unlimitedOnly)
EEditableEntityState
EActionTrigger