Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CancelMyReportDialog.c
Go to the documentation of this file.
1
3{
6
7 protected ref SCR_WorkshopItem m_Item;
8 protected bool m_bAuthorReport;
11
12 //------------------------------------------------------------------------------------------------
13 void SCR_CancelMyReportDialog(SCR_WorkshopItem item, bool authorReport = false)
14 {
15 m_Item = item;
16 m_bAuthorReport = authorReport;
17 SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopDialogs.DIALOGS_CONFIG, "cancel_report", this);
18 }
19
20 //------------------------------------------------------------------------------------------------
22 {
23 // Get reports
24 string reportDescription;
25 EWorkshopReportType reportType;
26
27 if (!m_bAuthorReport)
28 m_Item.GetReport(reportType, reportDescription);
29
30 string reportTypeStr = SCR_WorkshopUiCommon.GetReportTypeString(reportType);
31
32 // Find widgets
33 m_wTxtTypeMsg = TextWidget.Cast(m_wRoot.FindAnyWidget("TxtTypeMsg"));
34 m_wTxtComment = TextWidget.Cast(m_wRoot.FindAnyWidget("TxtComment"));
35
36 // Display report details
37 if (!m_bAuthorReport)
38 SetMessage("#AR-Workshop_CancelReportDescription");
39
40 m_wTxtTypeMsg.SetText(reportTypeStr);
41 m_wTxtComment.SetText(reportDescription);
42 }
43
44 //------------------------------------------------------------------------------------------------
45 override void OnConfirm()
46 {
48
49 m_Action = m_Item.CancelReport();
50 m_Action.m_OnCompleted.Insert(Callback_OnSuccess);
51 m_Action.m_OnFailed.Insert(Callback_OnFailed);
52 m_Action.Activate();
53
54 m_OnConfirm.Invoke(this);
55 }
56
57 //------------------------------------------------------------------------------------------------
59 {
60 m_LoadingOverlayDlg.CloseAnimated();
61 Close();
62 }
63
64 //------------------------------------------------------------------------------------------------
66 {
67 m_LoadingOverlayDlg.CloseAnimated();
68 Close();
69 }
70
71 //------------------------------------------------------------------------------------------------
76}
void SCR_CancelMyReportDialog(SCR_WorkshopItem item, bool authorReport=false)
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
SCR_LoadingOverlayDialog m_LoadingOverlayDlg
ref SCR_WorkshopItemActionCancelReport m_Action
SCR_WorkshopItemActionCancelReport GetWorkshopItemAction()
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
static SCR_LoadingOverlayDialog Create(string text=string.Empty)
Action for canceling report of an item.
static string GetReportTypeString(EWorkshopReportType eReportType)
Converts report type enum to stringtable entry.
EWorkshopReportType