44 const string altsep =
"-----------------------------\n";
52 res +=
string.Format(
"<enfusion://WorldEditor/%1;%2,%3,%4;%5,%6,%7|Enfusion Link>\n",
63 res +=
string.Format(
"Build Time: %1\n",
GetBuildTime());
64 res +=
string.Format(
"World File: %1\n",
GetWorldFile());
71 res +=
"FEEDBACK USER DATA:\n";
137 int year, month, day, hour, minute, sec;
138 System.GetYearMonthDay(year, month, day);
139 System.GetHourMinuteSecond(hour, minute, sec);
140 string smonth, sday, shour, sminute, ssec;
142 smonth =
string.Format(
"0%1", month);
144 smonth =
string.Format(
"%1", month);
147 sday =
string.Format(
"0%1", day);
149 sday =
string.Format(
"%1", day);
152 shour =
string.Format(
"0%1", hour);
154 shour =
string.Format(
"%1", hour);
157 sminute =
string.Format(
"0%1", minute);
159 sminute =
string.Format(
"%1", minute);
162 ssec =
string.Format(
"0%1", sec);
164 ssec =
string.Format(
"%1", sec);
166 return string.Format(
"%1-%2-%3 %4:%5:%6", year, smonth, sday, shour, sminute, ssec);
178 int cameraId = world.GetCurrentCameraId();
181 world.GetCamera(cameraId, mat);
201 void FeedbackData(
string typeTag,
string typeName,
string catTag,
string catName,
bool bPrivate,
string content)
206 RegV(
"m_sCategoryName");
211 RegV(
"m_sBuildTime");
212 RegV(
"m_sBuildVersion");
214 RegV(
"m_sWorldFile");
215 RegV(
"m_sSubmitTime");
217 RegV(
"m_vWorldPosition");
218 RegV(
"m_vWorldRotation");
262 "#AR-MainMenu_Feedback_Name",
267 static const int CATEGORY_NAMES_COUNT = 8;
268 static const string CATEGORY_TAGS[CATEGORY_NAMES_COUNT] =
282 "#AR-Feedback_General",
284 "#AR-MainMenu_Editor_Name",
285 "#AR-Feedback_Character",
286 "#AR-Feedback_Vehicles",
287 "#AR-Feedback_Weapons",
288 "#AR-MainMenu_Multiplayer_Name",
289 "#AR-MainMenu_Conflict_Name"
299 protected const string TOS_LINK =
"Link_PrivacyPolicy";
301 protected static const string FEEDBACK_DIALOG_NAME =
"feedback_dialog";
303 protected static ref FeedbackData m_LastFeedback;
304 protected static float m_fLastFeedbackTime = -
float.MAX;
305 protected static const float FEEDBACK_SEND_TIMEOUT = 5000;
318 int type =
m_Widgets.m_FeedbackTypeComponent0.GetCurrentIndex();
328 string console_sentence = predefinedAnswers[
m_Widgets.m_ConsoleFeedbackTopicComponent0.GetCurrentIndex()];
336 if (
m_Widgets.m_AttachLogsButtonComponent)
337 attachLogs =
m_Widgets.m_AttachLogsButtonComponent.IsToggled();
351 GetGame().GetWorkspace().SetFocusedWidget(
m_Widgets.m_FeedbackTypeComponent0.GetRootWidget());
355 static bool CanSendFeedback()
357 BaseWorld world =
GetGame().GetWorld();
361 float timeSinceLast = world.GetWorldTime() - m_fLastFeedbackTime;
362 return timeSinceLast > FEEDBACK_SEND_TIMEOUT;
369 m_LastFeedback = null;
371 string summary = m_LastFeedback.FormatMessage();
373 GetGame().GetBackendApi().FeedbackMessage(null, m_LastFeedback, summary);
374 m_fLastFeedbackTime =
GetGame().GetWorld().GetWorldTime();
378 static void ClearFeedback()
380 m_LastFeedback = null;
390 private void OnTOSButton()
397 override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
399 super.OnMenuOpen(preset);
404 m_Widgets =
new SCR_FeedbackDialogContentWidgets();
411 m_Widgets.m_FeedbackTypeComponent0.AddItem(TYPE_NAMES[i]);
413 m_Widgets.m_FeedbackTypeComponent0.SetCurrentItem(0);
416 if (
m_Widgets.m_ConsoleFeedbackTopicComponent0 && System.GetPlatform() ==
EPlatform.WINDOWS)
417 m_Widgets.m_ConsoleFeedbackTopicComponent0.SetVisible(
false);
418 else if (
m_Widgets.m_ConsoleFeedbackTopicComponent0)
419 m_Widgets.m_ConsoleFeedbackTopicComponent0.SetCurrentItem(0);
421 if (
m_Widgets.m_FeedbackCategoryComponent0)
423 for (
int i = 0; i < CATEGORY_NAMES_COUNT; i++)
425 m_Widgets.m_FeedbackCategoryComponent0.AddItem(CATEGORY_NAMES[i]);
428 m_Widgets.m_FeedbackCategoryComponent0.SetCurrentItem(0);
440 if (
m_Widgets.m_FeedbackEditBoxComponent)
446 if (
m_Widgets.m_AttachFileButtonComponent)
450 if (
m_Widgets.m_AttachLogsButtonComponent && System.GetPlatform() !=
EPlatform.WINDOWS)
452 m_Widgets.m_wAttachFileVertialLayout.SetVisible(
false);
453 m_Widgets.m_AttachLogsButtonComponent.SetVisible(
false);
454 m_Widgets.m_AttachLogsButtonComponent.SetEnabled(
false);
455 m_Widgets.m_AttachFileButtonComponent.SetVisible(
false);
456 m_Widgets.m_AttachFileButtonComponent.SetEnabled(
false);
469 if (
m_Widgets.m_FeedbackEditBoxComponent)
479 if (!
m_Widgets.m_ConsoleFeedbackTopicComponent0 || !
m_Widgets.m_ConsoleFeedbackTopicComponent0.IsVisible())
482 m_Widgets.m_ConsoleFeedbackTopicComponent0.ClearAll();
488 m_Widgets.m_ConsoleFeedbackTopicComponent0.AddItem(sentence);
491 m_Widgets.m_ConsoleFeedbackTopicComponent0.SetCurrentItem(0);
495 static SCR_FeedbackDialogUI OpenFeedbackDialog()
497 SCR_FeedbackDialogUI dialog =
new SCR_FeedbackDialogUI();
498 SCR_ConfigurableDialogUi.CreateFromPreset(SCR_CommonDialogs.DIALOGS_CONFIG, FEEDBACK_DIALOG_NAME, dialog);
class RestAPIHelper< JsonApiStruct T > content
ArmaReforgerScripted GetGame()
void OnTextChange(string text)
If number was inserted into current EditBox, add that number to the string and go to next EditBox....
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
ref SCR_FeedbackDialogPredefinedSentences m_FeedbackSentences
SCR_InputButtonComponent m_TOSButton
class FeedbackData extends JsonApiStruct TYPE_NAMES_COUNT
Available types of feedback.
bool m_bShouldEnableConfirmButton
void OnCategoryChanged(SCR_ComboBoxComponent comp=null, int index=0)
void OnWriteModeLeaveInternal(string text)
SCR_MotionControlCalibrationPromptDialog m_ConfirmButton
base classes for filtering in server browser
string GetFeedbackContent()
string m_sTypeTag
Type of feedback: issue, feedback..
string m_sUserName
User data.
string GetCurrentTimestamp()
string GetFeedbackSubmitTime()
string m_sContent
User provided content.
string m_sCategoryTag
Category of feedback: character, vehicle, UI..
void FeedbackData(string typeTag, string typeName, string catTag, string catName, bool bPrivate, string content)
Creates feedback data container.
string GetFeedbackCategory()
bool m_bPrivate
Visibility of feedback.
string m_sMessage
Message string for Slack (not part of JSON).
string m_sBuildVersion
Game build version.
vector m_vWorldRotation
Current camera orientation taken from camera if any.
vector m_vWorldPosition
Current world position taken from camera if any.
Widget GetContentLayoutRoot()
Returns the root of the content layout.
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
proto native vector Vector(float x, float y, float z)