3 [
Attribute(
"{6FFF0601A48C7FEE}UI/layouts/Menus/MainMenu/CommunityNotificationButton.layout", UIWidgets.ResourceNamePicker,
"",
"layout")]
4 protected ResourceName m_sNotificationsLayout;
7 protected string m_sSendButtonName;
9 protected string m_sFeedbackEditboxName;
11 protected string m_sMailEditboxName;
13 protected string m_sNotificationName;
15 protected string m_sTypeComboBoxName;
17 protected string m_sCategoryComboBoxName;
27 override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout,
int index)
29 super.OnTabCreate(menuRoot, buttonsLayout,
index);
36 m_Send.m_OnClicked.Insert(OnSendFeedback);
37 m_Send.SetEnabled(
false,
false);
42 m_TermsOfService = m_DynamicFooter.FindButton(
"ToS");
45 m_TermsOfService.SetVisible(
true);
46 m_TermsOfService.m_OnActivated.Insert(OnTos);
53 override void OnMenuUpdate(
float tDelta)
55 super.OnMenuUpdate(tDelta);
58 m_Send.SetEnabled(m_Feedback.GetValue() !=
string.Empty &&
FeedbackDialogUI.CanSendFeedback());
62 override void OnTabHide()
69 m_TermsOfService.SetVisible(
false);
73 override void OnTabRemove()
82 protected void SetupCategories()
86 if (!m_FeedbackCategory || !m_FeedbackType)
89 m_FeedbackCategory.ClearAll();
90 m_FeedbackType.ClearAll();
95 m_FeedbackCategory.AddItem(s);
100 m_FeedbackType.AddItem(s);
103 m_FeedbackType.SetCurrentItem(0);
104 m_FeedbackCategory.SetCurrentItem(0);
108 protected void SetupNotifications()
110 Widget notifications =
m_wRoot.FindAnyWidget(m_sNotificationName);
114 array<ref SCR_NewsEntry> entries = {};
118 Widget w =
GetGame().GetWorkspace().CreateWidgets(m_sNotificationsLayout, notifications);
126 tile.ShowTile(entry);
132 protected void OnSendFeedback()
134 if (!m_Feedback || !m_FeedbackType || !m_FeedbackCategory)
137 string content = m_Feedback.GetValue();
140 m_Feedback.SetValue(
string.Empty);
143 FeedbackDialogUI.SendFeedback(content, m_FeedbackType.GetCurrentIndex(), m_FeedbackCategory.GetCurrentIndex());
147 protected void OnTos()
149 GetGame().GetPlatformService().OpenBrowser(
GetGame().GetBackendApi().GetLinkItem(
"Link_PrivacyPolicy"));