Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DoubleClickAction.c
Go to the documentation of this file.
2{
3 [Attribute("1", desc: "When enabled, action will not be performed if its shotcut is mouse double-click and mouse moved between two clicks.")]
4 protected bool m_bIsDoubleClick;
5
6 protected const string LMB_ACTION = "MouseLeft";
7 protected const int MAX_CURSOR_DIST_SQ = 100;
8
10
11 protected void CachePosition()
12 {
14 }
15 protected void OnLMB()
16 {
17 GetGame().GetCallqueue().CallLater(CachePosition, 1);
18 }
20 {
21 int mouseX, mouseY;
22 WidgetManager.GetMousePos(mouseX, mouseY);
23 return Vector(mouseX, mouseY, 0);
24 }
26 {
27 if (!m_bIsDoubleClick || !GetGame().GetInputManager().IsUsingMouseAndKeyboard() || m_vMouseLeftPos == vector.Zero)
28 return false;
29
30 bool didMove = vector.DistanceSq(m_vMouseLeftPos, GetMousePosVector()) > MAX_CURSOR_DIST_SQ;
32 return didMove;
33 }
34
35 override void AddShortcut(SCR_BaseActionsEditorComponent actionsManager)
36 {
37 super.AddShortcut(actionsManager);
38
40 GetGame().GetInputManager().AddActionListener(LMB_ACTION, EActionTrigger.DOWN, OnLMB);
41 }
42 override void RemoveShortcut()
43 {
45 GetGame().GetInputManager().RemoveActionListener(LMB_ACTION, EActionTrigger.DOWN, OnLMB);
46
47 super.RemoveShortcut();
48 }
49};
ArmaReforgerScripted GetGame()
Definition game.c:1398
InputManager GetInputManager()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_BaseActionsEditorComponent m_ActionsManager
override void AddShortcut(SCR_BaseActionsEditorComponent actionsManager)
SCR_FieldOfViewSettings Attribute
EActionTrigger
proto native vector Vector(float x, float y, float z)