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_MapWatchUI.c
Go to the documentation of this file.
1
class
SCR_MapWatchUI
:
SCR_MapRTWBaseUI
2
{
3
protected
static
const
string
ICON_NAME
=
"watch"
;
4
5
protected
SCR_WristwatchComponent
m_WristwatchComp
;
6
protected
string
m_sPrefabResource
;
7
8
//------------------------------------------------------------------------------------------------
9
override
void
SetWidgetNames
()
10
{
11
WIDGET_NAME
=
"WatchFrame"
;
12
RT_WIDGET_NAME
=
"WatchRTW"
;
13
WORLD_NAME
=
"WatchUIWorld"
;
14
}
15
16
//------------------------------------------------------------------------------------------------
17
override
void
InitPositionVectors
()
18
{
19
m_WristwatchComp
= SCR_WristwatchComponent.Cast(
m_RTEntity
.FindComponent(SCR_WristwatchComponent) );
20
21
m_vPrefabPos
=
"0 0 0"
;
22
m_vCameraPos
=
"0 0.14 0"
;
23
m_vCameraAngle
=
"0 -90 0"
;
24
}
25
26
//------------------------------------------------------------------------------------------------
28
protected
void
UpdatePreviewEntity
()
29
{
30
if
(
m_WristwatchComp
)
31
{
32
// activate, apply proc anims
33
if
(
m_WristwatchComp
.GetMode() != EGadgetMode.IN_HAND)
34
m_WristwatchComp
.SetMapMode();
35
36
// tick the frame
37
m_WristwatchComp
.UpdateTime();
38
}
39
40
// update
41
BaseWorld
previewWorld =
m_RTWorld
.GetRef();
42
previewWorld.UpdateEntities();
43
}
44
45
//------------------------------------------------------------------------------------------------
46
protected
void
OnInputQuickBind
(
float
value,
EActionTrigger
reason
)
47
{
48
if
(!
GetGame
().
GetInputManager
().IsUsingMouseAndKeyboard() && IsToolMenuFocused())
49
return
;
50
SetVisible
(!
m_bIsVisible
);
51
}
52
53
//------------------------------------------------------------------------------------------------
54
protected
override
string
GetPrefabResource
()
55
{
56
return
m_sPrefabResource
;
57
}
58
59
//------------------------------------------------------------------------------------------------
62
override
void
SetVisible
(
bool
visible)
63
{
64
if
(visible)
65
{
66
IEntity
wristwatch =
FindRelatedGadget
();
67
if
(!wristwatch)
68
{
69
super.SetVisible(
false
);
70
return
;
71
}
72
73
SCR_WristwatchComponent watchComp = SCR_WristwatchComponent.Cast(wristwatch.
FindComponent
(SCR_WristwatchComponent));
74
if
(!watchComp)
75
return
;
76
77
m_sPrefabResource
= watchComp.GetMapPrefabResource();
78
79
super.SetVisible(visible);
80
if
(!
m_RTWorld
|| !
m_RTEntity
)
81
return
;
82
83
// Start anim
84
ScriptCallQueue
queue =
GetGame
().GetCallqueue();
85
if
(queue)
86
queue.CallLater(
UpdatePreviewEntity
, 0,
true
);
87
}
88
else
89
{
90
ScriptCallQueue
queue =
GetGame
().GetCallqueue();
91
if
(queue)
92
queue.Remove(
UpdatePreviewEntity
);
93
94
super.SetVisible(visible);
95
}
96
}
97
98
//------------------------------------------------------------------------------------------------
99
override
void
Init
()
100
{
101
SCR_MapToolMenuUI
toolMenu =
SCR_MapToolMenuUI
.Cast(
m_MapEntity
.GetMapUIComponent(
SCR_MapToolMenuUI
));
102
if
(toolMenu)
103
{
104
m_ToolMenuEntry
= toolMenu.RegisterToolMenuEntry(
SCR_MapToolMenuUI
.s_sToolMenuIcons,
ICON_NAME
, 12, m_bIsExclusive);
// add to menu
105
m_ToolMenuEntry
.m_OnClick.Insert(
ToggleVisible
);
106
107
GetGame
().GetInputManager().AddActionListener(
"MapToolWatch"
,
EActionTrigger
.DOWN,
OnInputQuickBind
);
108
}
109
}
110
111
//------------------------------------------------------------------------------------------------
112
override
void
Update
(
float
timeSlice)
113
{
114
// Drag watch
115
if
(
m_bIsVisible
&&
m_bIsDragged
)
116
{
117
// save position for map reopen
118
WorkspaceWidget
workspace =
g_Game
.GetWorkspace();
119
m_wFrame
.GetScreenPos(
m_fPosX
,
m_fPosY
);
120
m_fPosX
= workspace.DPIUnscale(
m_fPosX
);
121
m_fPosY
= workspace.DPIUnscale(
m_fPosY
);
122
}
123
}
124
125
//------------------------------------------------------------------------------------------------
126
// constructor
127
void
SCR_MapWatchUI
()
128
{
129
m_eGadgetType
= EGadgetType.WRISTWATCH;
130
}
131
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetInputManager
InputManager GetInputManager()
Definition
SCR_BaseManualCameraComponent.c:205
m_ToolMenuEntry
SCR_MapToolEntry m_ToolMenuEntry
Definition
SCR_MapDrawingUI.c:216
m_MapEntity
SCR_MapEntity m_MapEntity
Definition
SCR_MapGadgetComponent.c:38
RT_WIDGET_NAME
string RT_WIDGET_NAME
Definition
SCR_MapRTWBaseUI.c:22
FindRelatedGadget
IEntity FindRelatedGadget()
Definition
SCR_MapRTWBaseUI.c:74
m_vCameraAngle
vector m_vCameraAngle
Definition
SCR_MapRTWBaseUI.c:27
m_bIsVisible
bool m_bIsVisible
Definition
SCR_MapRTWBaseUI.c:29
m_vPrefabPos
vector m_vPrefabPos
Definition
SCR_MapRTWBaseUI.c:25
ToggleVisible
void ToggleVisible()
Visibility toggle.
Definition
SCR_MapRTWBaseUI.c:87
m_vCameraPos
vector m_vCameraPos
Definition
SCR_MapRTWBaseUI.c:26
WORLD_NAME
string WORLD_NAME
Definition
SCR_MapRTWBaseUI.c:24
m_RTEntity
GenericEntity m_RTEntity
Definition
SCR_MapRTWBaseUI.c:37
m_fPosY
float m_fPosY
Definition
SCR_MapRTWBaseUI.c:34
SCR_MapRTWBaseUI
void SCR_MapRTWBaseUI()
Definition
SCR_MapRTWBaseUI.c:300
m_fPosX
float m_fPosX
Definition
SCR_MapRTWBaseUI.c:34
WIDGET_NAME
string WIDGET_NAME
Definition
SCR_MapRTWBaseUI.c:21
m_bIsDragged
bool m_bIsDragged
Definition
SCR_MapRTWBaseUI.c:31
m_wFrame
Widget m_wFrame
Definition
SCR_MapRTWBaseUI.c:42
m_RTWorld
ref SharedItemRef m_RTWorld
Definition
SCR_MapRTWBaseUI.c:38
m_eGadgetType
EGadgetType m_eGadgetType
Definition
SCR_MapRTWBaseUI.c:36
SCR_MapToolMenuUI
void SCR_MapToolMenuUI()
Definition
SCR_MapToolMenuUI.c:484
reason
string reason
Definition
ServerBrowserMenuCallbacks.c:41
BaseWorld
Definition
BaseWorld.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_MapWatchUI::GetPrefabResource
override string GetPrefabResource()
Definition
SCR_MapWatchUI.c:54
SCR_MapWatchUI::InitPositionVectors
override void InitPositionVectors()
Definition
SCR_MapWatchUI.c:17
SCR_MapWatchUI::OnInputQuickBind
void OnInputQuickBind(float value, EActionTrigger reason)
Definition
SCR_MapWatchUI.c:46
SCR_MapWatchUI::SetVisible
override void SetVisible(bool visible)
Definition
SCR_MapWatchUI.c:62
SCR_MapWatchUI::m_WristwatchComp
SCR_WristwatchComponent m_WristwatchComp
Definition
SCR_MapWatchUI.c:5
SCR_MapWatchUI::ICON_NAME
static const string ICON_NAME
Definition
SCR_MapWatchUI.c:3
SCR_MapWatchUI::Update
override void Update(float timeSlice)
Definition
SCR_MapWatchUI.c:112
SCR_MapWatchUI::SCR_MapWatchUI
void SCR_MapWatchUI()
Definition
SCR_MapWatchUI.c:127
SCR_MapWatchUI::Init
override void Init()
Definition
SCR_MapWatchUI.c:99
SCR_MapWatchUI::SetWidgetNames
override void SetWidgetNames()
Definition
SCR_MapWatchUI.c:9
SCR_MapWatchUI::UpdatePreviewEntity
void UpdatePreviewEntity()
Update for the wristwatch entity within preview world.
Definition
SCR_MapWatchUI.c:28
SCR_MapWatchUI::m_sPrefabResource
string m_sPrefabResource
Definition
SCR_MapWatchUI.c:6
ScriptCallQueue
ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but l...
Definition
tools.c:53
WorkspaceWidget
Definition
WorkspaceWidget.c:16
g_Game
Game g_Game
Game singleton instance.
Definition
gameLib.c:13
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
scripts
Game
Map
ComponentsUI
SCR_MapWatchUI.c
Generated by
1.17.0