Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ErrorDialog.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
2 class SCR_ErrorDialog : ScriptedWidgetComponent
3 {
4  // Widget Names
5  const string WIDGET_TEXT_DETAIL = "TxtDetail";
6  const string WIDGET_IMG_LINE = "ImgLine";
7 
8  // Widgets
9  protected TextWidget m_wTxtDetail;
10  protected ImageWidget m_wImgLine;
11 
12  protected string m_sErrorMessage;
13 
14  //------------------------------------------------------------------------------------------------
15  // Dialog override functions
16  //------------------------------------------------------------------------------------------------
17 
18  //------------------------------------------------------------------------------------------------
19  override void HandlerAttached(Widget w)
20  {
21  super.HandlerAttached(w);
22 
23  // Get widgets
24  m_wTxtDetail = TextWidget.Cast(w.FindAnyWidget(WIDGET_TEXT_DETAIL));
25  m_wImgLine = ImageWidget.Cast(w.FindAnyWidget(WIDGET_IMG_LINE));
26 
27  if (m_wTxtDetail)
28  m_wTxtDetail.SetVisible(false);
29 
30  if (m_wImgLine)
31  m_wImgLine.SetVisible(false);
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  // Public API
36  //------------------------------------------------------------------------------------------------
37 
38  //------------------------------------------------------------------------------------------------
39  void SetErrorMessage(string message)
40  {
41  m_sErrorMessage = message;
42  }
43 
44  //------------------------------------------------------------------------------------------------
45  string GetErrorMessage()
46  {
47  return m_sErrorMessage;
48  }
49 
50  //------------------------------------------------------------------------------------------------
51  void SetErrorDetail(string strDetail)
52  {
53  // Setup text
54  if (m_wTxtDetail)
55  {
56  strDetail += "\n#AR-ServerBrowser_JoinErrorDetailLog";
57  m_wTxtDetail.SetText(strDetail);
58  m_wTxtDetail.SetVisible(true);
59  }
60 
61  // Show line
62  if (m_wImgLine)
63  m_wImgLine.SetVisible(true);
64  }
65 
66  //------------------------------------------------------------------------------------------------
67  static SCR_ErrorDialog FindErrorComponent(notnull Widget w)
68  {
69  return SCR_ErrorDialog.Cast(w.FindHandler(SCR_ErrorDialog));
70  }
71 };
72 
73 
74 
SCR_ErrorDialog
Definition: SCR_ErrorDialog.c:2