Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CommunitySubMenu.c
Go to the documentation of this file.
2{
3 [Attribute("{6FFF0601A48C7FEE}UI/layouts/Menus/MainMenu/CommunityNotificationButton.layout", UIWidgets.ResourceNamePicker, "", "layout")]
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
23
25
26 //------------------------------------------------------------------------------------------------
27 override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
28 {
29 super.OnTabCreate(menuRoot, buttonsLayout, index);
30
32
34 if (m_Send)
35 {
36 m_Send.m_OnClicked.Insert(OnSendFeedback);
37 m_Send.SetEnabled(false, false);
38 }
39
41
42 m_TermsOfService = m_DynamicFooter.FindButton("ToS");
44 {
45 m_TermsOfService.SetVisible(true);
46 m_TermsOfService.m_OnActivated.Insert(OnTos);
47 }
48
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
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 {
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
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 {
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}
class RestAPIHelper< JsonApiStruct T > content
ChimeraMenuPreset
Menu presets.
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Base class for any button, regardless its own content.
static SCR_ButtonBaseComponent GetButtonBase(string name, Widget parent, bool searchAllChildren=true)
override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
override void OnMenuUpdate(float tDelta)
SCR_EditBoxComponent m_Feedback
SCR_ComboBoxComponent m_FeedbackType
SCR_ComboBoxComponent m_FeedbackCategory
SCR_ButtonBaseComponent m_Send
ResourceName m_sNotificationsLayout
SCR_InputButtonComponent m_TermsOfService
static SCR_EditBoxComponent GetEditBoxComponent(string name, Widget parent, bool searchAllChildren=true)
void ShowTile(SCR_NewsEntry entry)
SCR_DynamicFooterComponent m_DynamicFooter
SCR_FieldOfViewSettings Attribute