Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
NewsDialog.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
3{
4 string m_sWidgetAuthor = "Author";
5 string m_sWidgetDate = "Date";
6 string m_sWidgetImage = "Image";
7 TextWidget m_wDate;
8 TextWidget m_wAuthor;
9 ImageWidget m_wImage;
10
11 //------------------------------------------------------------------------------------------------
12 override void HandlerAttached(Widget w)
13 {
14 super.HandlerAttached(w);
15
16 }
17
18 //------------------------------------------------------------------------------------------------
19 void SetAuthor(string text)
20 {
21 TextWidget w = TextWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetAuthor));
22 if (!w)
23 return;
24
25 w.SetText(text);
26 }
27
28 //------------------------------------------------------------------------------------------------
29 void SetDate(string text)
30 {
31 TextWidget w = TextWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetDate));
32 if (!w)
33 return;
34
35 w.SetText(text);
36 }
37
38 //------------------------------------------------------------------------------------------------
39 void SetImage(string texture)
40 {
41 ImageWidget w = ImageWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetImage));
42 if (!w)
43 return;
44
45 w.LoadImageTexture(0, texture);
46 }
47
48 //------------------------------------------------------------------------------------------------
49 string GetAuthor()
50 {
51 TextWidget w = TextWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetAuthor));
52 if (!w)
53 return string.Empty;
54
55 return w.GetText();
56 }
57
58 //------------------------------------------------------------------------------------------------
59 string GetDate()
60 {
61 TextWidget w = TextWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetDate));
62 if (!w)
63 return string.Empty;
64
65 return w.GetText();
66 }
67};
68
69
70
Widget GetRootWidget()