DayZ 1.24
Loading...
Searching...
No Matches
CreditsDepartmentElement.c
Go to the documentation of this file.
1class CreditsDepartmentElement extends CreditsElement
2{
6
8 {
9 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/credits/department_element/department_element.layout", parent);
10 m_DepartmentTitle = TextWidget.Cast(m_Root.FindAnyWidget("department_title"));
11 m_DepartmentSections = GridSpacerWidget.Cast(m_Root.FindAnyWidget("department_sections"));
12
13 if (department_data.DepartmentName != "")
14 m_DepartmentTitle.SetText(department_data.DepartmentName);
15 else
16 {
17 m_DepartmentTitle.Show(false);
18 m_Root.FindAnyWidget("SeparatorPanel").Show(false);
19 }
20
21 m_Root.SetSort(index);
23 }
24
26 {
27 for (int i = 1; i <= department_data.Count(); i++)
28 {
29 ref CreditsDepartmentSection e = new CreditsDepartmentSection(i, m_DepartmentSections, department_data.Get(i - 1));
30 m_DepartmentSectionEntries.Insert(e);
31 }
32
33 m_DepartmentSections.Update();
34 }
35}
36
38{
42
44 {
45 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/credits/department_element/department_section.layout", parent);
46 m_SectionTitle = TextWidget.Cast(m_Root.FindAnyWidget("section_title"));
47 m_SectionSections = WrapSpacerWidget.Cast(m_Root.FindAnyWidget("section_elements"));
48
49 if (section_data.SectionName != "")
50 m_SectionTitle.SetText(section_data.SectionName);
51 else
52 {
53 m_SectionTitle.Show(false);
54 m_Root.FindAnyWidget("SeparatorPanel").Show(false);
55 }
56
57 LoadDataAsync(section_data.SectionLines);
58 m_Root.SetSort(index);
59 }
60
62 {
63 for (int i = 1; i <= section_data.Count(); i++)
64 {
65 TextWidget w = TextWidget.Cast(GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/credits/department_element/department_section_element.layout", m_SectionSections));
66 w.SetText(section_data.Get(i - 1) + " \n");
67 w.Update();
68 m_Root.SetSort(i);
69 m_SectionEntries.Insert(w);
70 }
71
72 m_SectionSections.Update();
73 }
74}
ref array< Widget > m_SectionEntries
void CreditsDepartmentSection(int index, Widget parent, JsonDataCreditsSection section_data)
WrapSpacerWidget m_SectionSections
class CreditsDepartmentElement extends CreditsElement m_SectionTitle
Widget m_Root
Definition SizeToChild.c:85
void LoadDataAsync(array< ref JsonDataCreditsSection > department_data)
GridSpacerWidget m_DepartmentSections
void CreditsDepartmentElement(int index, Widget parent, JsonDataCreditsDepartment department_data)
proto native CGame GetGame()