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_CommunitySubMenu.c
Go to the documentation of this file.
1
class
SCR_CommunitySubMenu
:
SCR_SubMenuBase
2
{
3
[
Attribute
(
"{6FFF0601A48C7FEE}UI/layouts/Menus/MainMenu/CommunityNotificationButton.layout"
,
UIWidgets
.ResourceNamePicker,
""
,
"layout"
)]
4
protected
ResourceName
m_sNotificationsLayout
;
5
6
[
Attribute
(
"Send"
)]
7
protected
string
m_sSendButtonName
;
8
[
Attribute
(
"Feedback"
)]
9
protected
string
m_sFeedbackEditboxName
;
10
[
Attribute
(
"Address"
)]
11
protected
string
m_sMailEditboxName
;
12
[
Attribute
(
"Notifications"
)]
13
protected
string
m_sNotificationName
;
14
[
Attribute
(
"Type"
)]
15
protected
string
m_sTypeComboBoxName
;
16
[
Attribute
(
"Category"
)]
17
protected
string
m_sCategoryComboBoxName
;
18
19
protected
SCR_ButtonBaseComponent
m_Send
;
20
protected
SCR_EditBoxComponent
m_Feedback
;
21
protected
SCR_ComboBoxComponent
m_FeedbackType
;
22
protected
SCR_ComboBoxComponent
m_FeedbackCategory
;
23
24
SCR_InputButtonComponent
m_TermsOfService
;
25
26
//------------------------------------------------------------------------------------------------
27
override
void
OnTabCreate
(
Widget
menuRoot,
ResourceName
buttonsLayout,
int
index
)
28
{
29
super.OnTabCreate(menuRoot, buttonsLayout,
index
);
30
31
SetupNotifications
();
32
33
m_Send
=
SCR_ButtonBaseComponent
.
GetButtonBase
(
m_sSendButtonName
,
m_wRoot
);
34
if
(
m_Send
)
35
{
36
m_Send
.m_OnClicked.Insert(
OnSendFeedback
);
37
m_Send
.SetEnabled(
false
,
false
);
38
}
39
40
m_Feedback
=
SCR_EditBoxComponent
.
GetEditBoxComponent
(
m_sFeedbackEditboxName
,
m_wRoot
);
41
42
m_TermsOfService
=
m_DynamicFooter
.FindButton(
"ToS"
);
43
if
(
m_TermsOfService
)
44
{
45
m_TermsOfService
.SetVisible(
true
);
46
m_TermsOfService
.m_OnActivated.Insert(
OnTos
);
47
}
48
49
SetupCategories
();
50
}
51
52
//------------------------------------------------------------------------------------------------
53
override
void
OnMenuUpdate
(
float
tDelta)
54
{
55
super.OnMenuUpdate(tDelta);
56
57
if
(
m_Send
)
58
m_Send
.SetEnabled(
m_Feedback
.GetValue() !=
string
.Empty && SCR_FeedbackDialogUI.CanSendFeedback());
59
}
60
61
//------------------------------------------------------------------------------------------------
62
override
void
OnTabHide
()
63
{
64
super.OnTabHide();
65
66
SCR_FeedbackDialogUI.ClearFeedback();
67
68
if
(
m_TermsOfService
)
69
m_TermsOfService
.SetVisible(
false
);
70
}
71
72
//------------------------------------------------------------------------------------------------
73
override
void
OnTabRemove
()
74
{
75
super.OnTabRemove();
76
77
SCR_FeedbackDialogUI.ClearFeedback();
78
}
79
80
// Setup type and category combos according to SCR_FeedbackDialogUI constants
81
//------------------------------------------------------------------------------------------------
82
protected
void
SetupCategories
()
83
{
84
m_FeedbackCategory
=
SCR_ComboBoxComponent
.GetComboBoxComponent(
m_sCategoryComboBoxName
,
m_wRoot
);
85
m_FeedbackType
=
SCR_ComboBoxComponent
.GetComboBoxComponent(
m_sTypeComboBoxName
,
m_wRoot
);
86
if
(!
m_FeedbackCategory
|| !
m_FeedbackType
)
87
return
;
88
89
m_FeedbackCategory
.ClearAll();
90
m_FeedbackType
.ClearAll();
91
92
93
foreach
(
string
s : SCR_FeedbackDialogUI.CATEGORY_NAMES)
94
{
95
m_FeedbackCategory
.AddItem(s);
96
}
97
98
foreach
(
string
s : SCR_FeedbackDialogUI.TYPE_NAMES)
99
{
100
m_FeedbackType
.AddItem(s);
101
}
102
103
m_FeedbackType
.SetCurrentItem(0);
104
m_FeedbackCategory
.SetCurrentItem(0);
105
}
106
107
//------------------------------------------------------------------------------------------------
108
protected
void
SetupNotifications
()
109
{
110
Widget
notifications =
m_wRoot
.FindAnyWidget(
m_sNotificationName
);
111
if
(!notifications)
112
return
;
113
114
array<ref SCR_NewsEntry> entries = {};
115
MainMenuUI.GetNotificationEntries(entries);
116
foreach
(
SCR_NewsEntry
entry : entries)
117
{
118
Widget
w =
GetGame
().GetWorkspace().CreateWidgets(
m_sNotificationsLayout
, notifications);
119
if
(!w)
120
continue
;
121
122
SCR_NewsTileComponent
tile =
SCR_NewsTileComponent
.Cast(w.FindHandler(
SCR_NewsTileComponent
));
123
if
(!tile)
124
continue
;
125
126
tile.
ShowTile
(entry);
127
}
128
}
129
130
// Copy code from feedback dialog
131
//------------------------------------------------------------------------------------------------
132
protected
void
OnSendFeedback
()
133
{
134
if
(!
m_Feedback
|| !
m_FeedbackType
|| !
m_FeedbackCategory
)
135
return
;
136
137
string
content
=
m_Feedback
.GetValue();
138
139
// Clear feedback window
140
m_Feedback
.SetValue(
string
.Empty);
141
142
// Send feedback
143
SCR_FeedbackDialogUI.SendFeedback(
content
,
m_FeedbackType
.GetCurrentIndex(),
m_FeedbackCategory
.GetCurrentIndex(),
false
);
144
}
145
146
//------------------------------------------------------------------------------------------------
147
protected
void
OnTos
()
148
{
149
MenuBase
base
=
GetGame
().GetMenuManager().OpenMenu(
ChimeraMenuPreset
.PrivacyPolicyMenu);
150
if
(!
base
)
151
return
;
152
153
GetGame
().GetWorkspace().SetFocusedWidget(
base
.GetRootWidget());
154
}
155
}
content
class RestAPIHelper< JsonApiStruct T > content
ChimeraMenuPreset
ChimeraMenuPreset
Menu presets.
Definition
ChimeraMenuBase.c:4
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
base
around base
Definition
SCR_HoldCampaignMilitaryBaseTaskEntity.c:9
MenuBase
Definition
MenuBase.c:32
ResourceName
Definition
ResourceName.c:13
SCR_ButtonBaseComponent
Base class for any button, regardless its own content.
Definition
SCR_ButtonBaseComponent.c:7
SCR_ButtonBaseComponent::GetButtonBase
static SCR_ButtonBaseComponent GetButtonBase(string name, Widget parent, bool searchAllChildren=true)
Definition
SCR_ButtonBaseComponent.c:330
SCR_ComboBoxComponent
Definition
SCR_ComboBoxComponent.c:2
SCR_CommunitySubMenu
Definition
SCR_CommunitySubMenu.c:2
SCR_CommunitySubMenu::m_sSendButtonName
string m_sSendButtonName
Definition
SCR_CommunitySubMenu.c:7
SCR_CommunitySubMenu::OnTabCreate
override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
Definition
SCR_CommunitySubMenu.c:27
SCR_CommunitySubMenu::OnMenuUpdate
override void OnMenuUpdate(float tDelta)
Definition
SCR_CommunitySubMenu.c:53
SCR_CommunitySubMenu::m_Feedback
SCR_EditBoxComponent m_Feedback
Definition
SCR_CommunitySubMenu.c:20
SCR_CommunitySubMenu::SetupNotifications
void SetupNotifications()
Definition
SCR_CommunitySubMenu.c:108
SCR_CommunitySubMenu::OnSendFeedback
void OnSendFeedback()
Definition
SCR_CommunitySubMenu.c:132
SCR_CommunitySubMenu::OnTabHide
override void OnTabHide()
Definition
SCR_CommunitySubMenu.c:62
SCR_CommunitySubMenu::m_sNotificationName
string m_sNotificationName
Definition
SCR_CommunitySubMenu.c:13
SCR_CommunitySubMenu::m_FeedbackType
SCR_ComboBoxComponent m_FeedbackType
Definition
SCR_CommunitySubMenu.c:21
SCR_CommunitySubMenu::m_FeedbackCategory
SCR_ComboBoxComponent m_FeedbackCategory
Definition
SCR_CommunitySubMenu.c:22
SCR_CommunitySubMenu::m_Send
SCR_ButtonBaseComponent m_Send
Definition
SCR_CommunitySubMenu.c:19
SCR_CommunitySubMenu::m_sTypeComboBoxName
string m_sTypeComboBoxName
Definition
SCR_CommunitySubMenu.c:15
SCR_CommunitySubMenu::SetupCategories
void SetupCategories()
Definition
SCR_CommunitySubMenu.c:82
SCR_CommunitySubMenu::m_sNotificationsLayout
ResourceName m_sNotificationsLayout
Definition
SCR_CommunitySubMenu.c:4
SCR_CommunitySubMenu::m_sMailEditboxName
string m_sMailEditboxName
Definition
SCR_CommunitySubMenu.c:11
SCR_CommunitySubMenu::m_sFeedbackEditboxName
string m_sFeedbackEditboxName
Definition
SCR_CommunitySubMenu.c:9
SCR_CommunitySubMenu::OnTabRemove
override void OnTabRemove()
Definition
SCR_CommunitySubMenu.c:73
SCR_CommunitySubMenu::m_TermsOfService
SCR_InputButtonComponent m_TermsOfService
Definition
SCR_CommunitySubMenu.c:24
SCR_CommunitySubMenu::m_sCategoryComboBoxName
string m_sCategoryComboBoxName
Definition
SCR_CommunitySubMenu.c:17
SCR_CommunitySubMenu::OnTos
void OnTos()
Definition
SCR_CommunitySubMenu.c:147
SCR_EditBoxComponent
Definition
SCR_EditBoxComponent.c:9
SCR_EditBoxComponent::GetEditBoxComponent
static SCR_EditBoxComponent GetEditBoxComponent(string name, Widget parent, bool searchAllChildren=true)
Definition
SCR_EditBoxComponent.c:382
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_NewsEntry
Definition
SCR_NewsSubMenu.c:3
SCR_NewsTileComponent
Definition
SCR_NewsTileComponent.c:2
SCR_NewsTileComponent::ShowTile
void ShowTile(SCR_NewsEntry entry)
Definition
SCR_NewsTileComponent.c:130
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_SubMenuBase
Definition
SCR_SubMenuBase.c:7
SCR_SubMenuBase::m_DynamicFooter
SCR_DynamicFooterComponent m_DynamicFooter
Definition
SCR_SubMenuBase.c:10
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Components
MainMenu
SCR_CommunitySubMenu.c
Generated by
1.17.0