8 protected Widget m_wDialogWindow;
12 protected bool m_bAcceptInput =
true;
16 protected bool m_bShouldEnableConfirmButton;
21 override void OnMenuOpen()
28 m_InputField.m_OnChanged.Insert(OnFieldChanged);
33 m_ReasonCombo.ClearAll();
36 while (!reportTypeStr.IsEmpty())
38 m_ReasonCombo.AddItem(reportTypeStr);
42 m_ReasonCombo.SetCurrentItem(0);
45 m_wDialogWindow = root.FindAnyWidget(
"DialogBase0");
48 m_Confirm.SetEnabled(
false);
52 m_InputField.m_OnWriteModeLeave.Insert(OnWriteModeLeave);
53 m_InputField.m_OnTextChange.Insert(OnTextChange);
58 tos.m_OnActivated.Insert(OnTos);
62 override void OnMenuShow()
66 GetGame().GetWorkspace().SetFocusedWidget(m_InputField.GetRootWidget());
70 override void OnMenuUpdate(
float tDelta)
72 super.OnMenuUpdate(tDelta);
74 GetGame().GetInputManager().ActivateContext(
"InteractableDialogContext");
78 override protected void OnConfirm()
94 category = m_ReasonCombo.GetCurrentIndex();
99 content = m_InputField.GetValue();
107 m_ReportAction.Reactivate();
114 m_ReportAction.m_OnCompleted.Insert(OnReportSuccess);
115 m_ReportAction.m_OnFailed.Insert(OnReportFailed);
117 m_ReportAction.Activate();
121 protected void OnReportSuccess()
123 if (m_OnReportSuccess)
124 m_OnReportSuccess.Invoke(
false);
152 protected void SetAcceptInput(
bool accept)
154 m_bAcceptInput = accept;
159 protected bool IsContentEmpty()
163 string txt = m_InputField.GetValue();
164 return txt.Length() <= 0;
171 protected void OnWriteModeLeave(
string text)
177 protected void OnTextChange(
string text)
179 if (!m_Confirm || !m_InputField)
182 m_Confirm.SetEnabled(!m_InputField.GetValue().IsEmpty());
190 m_Confirm.SetEnabled(text.Length() > 0);
194 protected void OnTos()
196 GetGame().GetPlatformService().OpenBrowser(
GetGame().GetBackendApi().GetLinkItem(
"Link_PrivacyPolicy"));
202 if (!m_OnReportSuccess)
205 return m_OnReportSuccess;