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_AdvancedActionRowComponent.c
Go to the documentation of this file.
1
class
SCR_AdvancedActionRowComponent
:
SCR_ScriptedWidgetComponent
2
{
3
[
Attribute
(
UIColors
.GetColorAttribute(
UIColors
.NEUTRAL_ACTIVE_STANDBY))]
4
protected
ref
Color
m_ActionColor
;
5
6
[
Attribute
(
"1"
)]
7
protected
bool
m_bShowConflictsList
;
8
9
[
Attribute
(
UIConstants
.ACTION_DISPLAY_ICON_SCALE_BIG)]
10
protected
float
m_fActionIconScale
;
11
12
[
Attribute
(
"0"
,
UIWidgets
.ComboBox,
"Determines the colors of the rich text action icons"
,
""
, ParamEnumArray.FromEnum(SCR_EActionDisplayState))]
13
protected
SCR_EActionDisplayState
m_eActionIconState
;
14
15
protected
int
m_iKeybindIndex
;
16
17
protected
RichTextWidget
m_wActionBindRichText
;
18
protected
RichTextWidget
m_wIndexRichText
;
19
protected
RichTextWidget
m_wWarningRichText
;
20
protected
RichTextWidget
m_wActionsRichText
;
21
22
protected
SCR_HorizontalScrollAnimationComponent
m_HorizontalScrollComponent
;
23
24
protected
const
string
ROOT_NAME
=
"AdvancedKeybindActionDisplay"
;
25
26
//------------------------------------------------------------------------------------------------
27
override
void
HandlerAttached
(
Widget
w)
28
{
29
super.HandlerAttached(w);
30
31
m_wActionBindRichText
=
RichTextWidget
.Cast(
m_wRoot
.FindAnyWidget(
"ActionRichText"
));
32
m_wIndexRichText
=
RichTextWidget
.Cast(
m_wRoot
.FindAnyWidget(
"IndexRichText"
));
33
m_wWarningRichText
=
RichTextWidget
.Cast(
m_wRoot
.FindAnyWidget(
"WarningText"
));
34
m_wActionsRichText
=
RichTextWidget
.Cast(
m_wRoot
.FindAnyWidget(
"WarningActions"
));
35
36
Widget
frame =
m_wRoot
.FindAnyWidget(
"HorizontalScrollFrame"
);
37
if
(frame)
38
m_HorizontalScrollComponent
= SCR_HorizontalScrollAnimationComponent.FindComponent(frame);
39
40
if
(
m_HorizontalScrollComponent
)
41
StopScrolling
();
42
}
43
44
//------------------------------------------------------------------------------------------------
45
// Displays the action's specified bind for the chosen device and conflicting occurrances
46
void
Init
(
string
actionName,
string
actionPreset,
int
index
,
SCR_SettingsManagerKeybindModule
settingsKeybindModule, EInputDeviceType device)
47
{
48
m_iKeybindIndex
=
index
;
49
50
string
deviceString =
UIConstants
.DEVICE_KEYBOARD;
51
if
(device == EInputDeviceType.GAMEPAD)
52
deviceString =
UIConstants
.DEVICE_GAMEPAD;
53
54
if
(
m_wActionBindRichText
)
55
m_wActionBindRichText
.SetText(
string
.Format(
56
"<action name='%1' preset='%2' index='%3' device='%4' scale='%5' state ='%6'/>"
,
57
actionName,
58
actionPreset,
59
index
,
60
deviceString,
61
m_fActionIconScale
.ToString(),
62
UIConstants
.GetActionDisplayStateAttribute(
m_eActionIconState
)
63
));
64
65
if
(!
m_wIndexRichText
)
66
return
;
67
68
//offset index by 1 so it's comfortable for humans
69
int
order =
m_iKeybindIndex
+ 1;
70
71
//todo: check how localization deals with the dot: Updated with Wlib - removing "."
72
if
(
m_wIndexRichText
)
73
m_wIndexRichText
.SetText(order.ToString() +
"."
);
74
75
//check for conflicts and deal with them if they exist
76
array<SCR_KeyBindingEntry> conflictedActions = {};
77
bool
conflicted =
m_bShowConflictsList
&& settingsKeybindModule.
IsActionConflicted
(actionName, conflictedActions,
m_iKeybindIndex
, actionPreset);
78
79
if
(
m_wWarningRichText
)
80
m_wWarningRichText
.SetVisible(conflicted);
81
82
if
(
m_wActionsRichText
)
83
m_wActionsRichText
.SetVisible(conflicted);
84
85
if
(!conflicted || !
m_wActionsRichText
)
86
return
;
87
88
string
actionNames = conflictedActions.Get(0).m_sDisplayName;
89
90
for
(
int
i = 1, count = conflictedActions.Count(); i < count; i++)
91
{
92
actionNames = actionNames +
", "
+ conflictedActions.Get(i).m_sDisplayName;
93
}
94
95
m_wActionsRichText
.SetText(actionNames);
96
}
97
98
//------------------------------------------------------------------------------------------------
99
int
GetKeybindIndex
()
100
{
101
return
m_iKeybindIndex
;
102
}
103
104
//------------------------------------------------------------------------------------------------
105
void
StartScrolling
()
106
{
107
if
(!
m_HorizontalScrollComponent
)
108
return
;
109
110
m_HorizontalScrollComponent
.AnimationStart();
111
}
112
113
//------------------------------------------------------------------------------------------------
114
void
StopScrolling
()
115
{
116
if
(!
m_HorizontalScrollComponent
)
117
return
;
118
119
m_HorizontalScrollComponent
.AnimationStop();
120
m_HorizontalScrollComponent
.ResetPosition();
121
}
122
123
//------------------------------------------------------------------------------------------------
124
static
SCR_AdvancedActionRowComponent
FindComponent
(notnull
Widget
w)
125
{
126
return
SCR_AdvancedActionRowComponent
.Cast(w.FindHandler(
SCR_AdvancedActionRowComponent
));
127
}
128
129
//------------------------------------------------------------------------------------------------
130
static
SCR_AdvancedActionRowComponent
FindComponentInHierarchy
(notnull
Widget
w)
131
{
132
Widget
actionRoot = w.FindAnyWidget(
ROOT_NAME
);
133
if
(!actionRoot)
134
return
null;
135
136
return
SCR_AdvancedActionRowComponent
.
FindComponent
(actionRoot);
137
}
138
}
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
Color
Definition
Color.c:13
RichTextWidget
Definition
RichTextWidget.c:13
SCR_AdvancedActionRowComponent
Definition
SCR_AdvancedActionRowComponent.c:2
SCR_AdvancedActionRowComponent::m_wActionsRichText
RichTextWidget m_wActionsRichText
Definition
SCR_AdvancedActionRowComponent.c:20
SCR_AdvancedActionRowComponent::m_wIndexRichText
RichTextWidget m_wIndexRichText
Definition
SCR_AdvancedActionRowComponent.c:18
SCR_AdvancedActionRowComponent::ROOT_NAME
const string ROOT_NAME
Definition
SCR_AdvancedActionRowComponent.c:24
SCR_AdvancedActionRowComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_AdvancedActionRowComponent.c:27
SCR_AdvancedActionRowComponent::m_fActionIconScale
float m_fActionIconScale
Definition
SCR_AdvancedActionRowComponent.c:10
SCR_AdvancedActionRowComponent::FindComponentInHierarchy
static SCR_AdvancedActionRowComponent FindComponentInHierarchy(notnull Widget w)
Definition
SCR_AdvancedActionRowComponent.c:130
SCR_AdvancedActionRowComponent::GetKeybindIndex
int GetKeybindIndex()
Definition
SCR_AdvancedActionRowComponent.c:99
SCR_AdvancedActionRowComponent::m_ActionColor
ref Color m_ActionColor
Definition
SCR_AdvancedActionRowComponent.c:4
SCR_AdvancedActionRowComponent::m_iKeybindIndex
int m_iKeybindIndex
Definition
SCR_AdvancedActionRowComponent.c:15
SCR_AdvancedActionRowComponent::m_eActionIconState
SCR_EActionDisplayState m_eActionIconState
Definition
SCR_AdvancedActionRowComponent.c:13
SCR_AdvancedActionRowComponent::FindComponent
static SCR_AdvancedActionRowComponent FindComponent(notnull Widget w)
Definition
SCR_AdvancedActionRowComponent.c:124
SCR_AdvancedActionRowComponent::m_wWarningRichText
RichTextWidget m_wWarningRichText
Definition
SCR_AdvancedActionRowComponent.c:19
SCR_AdvancedActionRowComponent::StartScrolling
void StartScrolling()
Definition
SCR_AdvancedActionRowComponent.c:105
SCR_AdvancedActionRowComponent::m_bShowConflictsList
bool m_bShowConflictsList
Definition
SCR_AdvancedActionRowComponent.c:7
SCR_AdvancedActionRowComponent::m_HorizontalScrollComponent
SCR_HorizontalScrollAnimationComponent m_HorizontalScrollComponent
Definition
SCR_AdvancedActionRowComponent.c:22
SCR_AdvancedActionRowComponent::m_wActionBindRichText
RichTextWidget m_wActionBindRichText
Definition
SCR_AdvancedActionRowComponent.c:17
SCR_AdvancedActionRowComponent::Init
void Init(string actionName, string actionPreset, int index, SCR_SettingsManagerKeybindModule settingsKeybindModule, EInputDeviceType device)
Definition
SCR_AdvancedActionRowComponent.c:46
SCR_AdvancedActionRowComponent::StopScrolling
void StopScrolling()
Definition
SCR_AdvancedActionRowComponent.c:114
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_SettingsManagerKeybindModule
Definition
SCR_SettingsManagerKeybindModule.c:3
SCR_SettingsManagerKeybindModule::IsActionConflicted
bool IsActionConflicted(string actionName, notnull out array< SCR_KeyBindingEntry > confirmedConflicts, int bindIndex, string preset=string.Empty)
returns false if the action has no conflicts (no other action in keybind settings with same bind),...
Definition
SCR_SettingsManagerKeybindModule.c:155
UIColors
Definition
Constants.c:17
UIConstants
Definition
Constants.c:151
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Menu
SettingsMenu
SCR_AdvancedActionRowComponent.c
Generated by
1.17.0