Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_PingEditorUIComponent.c
Go to the documentation of this file.
1
2
3
class
SCR_PingEditorUIComponent
:
SCR_BaseEditorUIComponent
4
{
5
protected
SCR_PingEditorComponent
m_PingManager
;
6
protected
SCR_HoverEditableEntityFilter
m_HoverFilter
;
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
{
23
vector
position
;
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
31
SCR_EditableEntityComponent
target;
32
if
(
m_HoverFilter
)
33
target =
m_HoverFilter
.GetEntityUnderCursor();
34
35
m_PingManager
.SendPing(unlimitedOnly,
position
, target);
36
}
37
38
//------------------------------------------------------------------------------------------------
39
override
void
HandlerAttachedScripted
(
Widget
w)
40
{
41
m_PingManager
=
SCR_PingEditorComponent
.Cast(
SCR_PingEditorComponent
.GetInstance(
SCR_PingEditorComponent
,
true
));
42
if
(!
m_PingManager
)
43
return
;
44
45
m_HoverFilter
=
SCR_HoverEditableEntityFilter
.Cast(
SCR_HoverEditableEntityFilter
.GetInstance(
EEditableEntityState
.HOVER));
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
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
position
vector position
Definition
SCR_DestructibleTreeV2.c:30
reason
string reason
Definition
ServerBrowserMenuCallbacks.c:41
InputManager
Input management system for user interactions.
Definition
InputManager.c:20
SCR_BaseEditorUIComponent
Definition
SCR_BaseEditorUIComponent.c:4
SCR_CursorEditorUIComponent
Definition
SCR_CursorEditorUIComponent.c:4
SCR_CursorEditorUIComponent::GetCursorWorldPos
bool GetCursorWorldPos(out vector worldPos, bool isNormalized=false, TraceFlags flags=-1)
Definition
SCR_CursorEditorUIComponent.c:125
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_HoverEditableEntityFilter
Definition
SCR_HoverEditableEntityFilter.c:7
SCR_PingEditorComponent
Definition
SCR_PingEditorComponent.c:71
SCR_PingEditorUIComponent
Definition
SCR_PingEditorUIComponent.c:4
SCR_PingEditorUIComponent::m_PingManager
SCR_PingEditorComponent m_PingManager
Definition
SCR_PingEditorUIComponent.c:5
SCR_PingEditorUIComponent::HandlerDeattached
override void HandlerDeattached(Widget w)
Definition
SCR_PingEditorUIComponent.c:56
SCR_PingEditorUIComponent::HandlerAttachedScripted
override void HandlerAttachedScripted(Widget w)
Definition
SCR_PingEditorUIComponent.c:39
SCR_PingEditorUIComponent::OnEditorPing
void OnEditorPing(float value, EActionTrigger reason)
Definition
SCR_PingEditorUIComponent.c:9
SCR_PingEditorUIComponent::m_HoverFilter
SCR_HoverEditableEntityFilter m_HoverFilter
Definition
SCR_PingEditorUIComponent.c:6
SCR_PingEditorUIComponent::OnEditorPingUnlimitedOnly
void OnEditorPingUnlimitedOnly(float value, EActionTrigger reason)
Definition
SCR_PingEditorUIComponent.c:15
SCR_PingEditorUIComponent::SendPing
void SendPing(bool unlimitedOnly)
Definition
SCR_PingEditorUIComponent.c:21
Widget
Definition
Widget.c:13
vector
Definition
vector.c:13
EEditableEntityState
EEditableEntityState
Definition
EEditableEntityState.c:38
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
scripts
Game
Editor
UI
Components
Common
SCR_PingEditorUIComponent.c
Generated by
1.17.0