5 protected Widget m_wRootWidget;
7 protected ImageWidget m_WarCrimesHeaderImage;
8 protected RichTextWidget m_WarCrimesHeaderTitle;
9 protected RichTextWidget m_WarCrimesHeaderSubTitle;
11 [
Attribute(defvalue:
"0.302 0.302 0.302 1",
desc:
"War crimes header background color")]
12 protected ref Color m_iWarCrimesHeaderBackgroundColor;
14 [
Attribute(
"{FDD5423E69D007F8}UI/Textures/Icons/icons_wrapperUI-128.imageset", UIWidgets.ResourcePickerThumbnail)]
15 protected ResourceName m_TextureHeaderImageNoWarCrimes;
17 [
Attribute(defvalue:
"1 1 1 1",
desc:
"No war crimes header image color")]
18 protected ref Color m_iNoWarCrimesHeaderColor;
21 protected string m_StringHeaderImageNoWarCrimes;
24 protected string m_sNoWarCrimesTitleString;
27 protected string m_sNoWarCrimesSubtitleString;
29 [
Attribute(
"{FDD5423E69D007F8}UI/Textures/Icons/icons_wrapperUI-128.imageset", UIWidgets.ResourcePickerThumbnail)]
30 protected ResourceName m_TextureHeaderImageWarCrimes;
32 [
Attribute(defvalue:
"1 0 0 1",
desc:
"War crimes header image color")]
33 protected ref Color m_iWarCrimesHeaderColor;
36 protected string m_StringHeaderImageWarCrimes;
39 protected string m_sWarCrimesTitleString;
42 protected string m_sWarCrimesSubtitleString;
45 protected ResourceName m_WarCrimesEntryLayout;
47 [
Attribute(
"{FDD5423E69D007F8}UI/Textures/Icons/icons_wrapperUI-128.imageset", UIWidgets.ResourcePickerThumbnail)]
48 protected ResourceName m_TextureEntryImageWarCrimes;
50 [
Attribute(defvalue:
"1 0 0 1",
desc:
"War crimes entry image color")]
51 protected ref Color m_iWarCrimesEntryColor;
53 [
Attribute(defvalue:
"0.19608 0.06667 0.06667 1",
desc:
"War crimes entry image color")]
54 protected ref Color m_iWarCrimesEntryBackgroundColor;
57 protected string m_StringEntryImageWarCrimes;
60 protected string m_sHarmingFriendliesString;
62 [
Attribute(defvalue:
"0.761 0.392 0.078 1",
desc:
"No War Crimes subtitle color")]
63 protected ref Color m_iNoWarCrimesSubtitleColor;
65 [
Attribute(defvalue:
"0.502 0 0 1",
desc:
"War Crimes subtitle color")]
66 protected ref Color m_iWarCrimesSubtitleColor;
68 protected bool m_bActiveWarCrimes =
false;
71 protected override void HandlerAttached(Widget w)
74 m_WarCrimesHeaderImage = ImageWidget.Cast(m_wRootWidget.FindAnyWidget(
"WarCrimesHeaderImage"));
75 m_WarCrimesHeaderTitle = RichTextWidget.Cast(m_wRootWidget.FindAnyWidget(
"WarCrimesTitle"));
76 m_WarCrimesHeaderSubTitle = RichTextWidget.Cast(m_wRootWidget.FindAnyWidget(
"WarCrimesSubtitle"));
77 WarCrimesActive(
false);
79 ImageWidget backgroundHeader = ImageWidget.Cast(m_wRootWidget.FindAnyWidget(
"Background1"));
81 backgroundHeader.SetColor(m_iWarCrimesHeaderBackgroundColor);
87 WorkspaceWidget workspace =
GetGame().GetWorkspace();
91 Widget container = Widget.Cast(m_wRootWidget.FindAnyWidget(
"WarCrimeEntriesContainer"));
98 Widget entry = Widget.Cast(workspace.CreateWidgets(m_WarCrimesEntryLayout, container));
102 RichTextWidget entryText = RichTextWidget.Cast(entry.FindAnyWidget(
"WarCrimeEntryText"));
103 ImageWidget entryImage = ImageWidget.Cast(entry.FindAnyWidget(
"WarCrimeEntryImage"));
104 if (!entryText || !entryImage)
107 entryText.SetText(m_sHarmingFriendliesString);
108 SCR_WLibComponentBase.SetTexture(entryImage, m_TextureEntryImageWarCrimes, m_StringEntryImageWarCrimes);
109 entryImage.SetColor(m_iWarCrimesEntryColor);
114 if (!m_bActiveWarCrimes)
115 WarCrimesActive(
true);
119 protected void WarCrimesActive(
bool warCriminal)
121 if (!m_WarCrimesHeaderImage || !m_WarCrimesHeaderTitle || !m_WarCrimesHeaderSubTitle)
124 Widget ListOfWarCrimes = Widget.Cast(m_wRootWidget.FindAnyWidget(
"ListOfWarCrimes"));
125 if (!ListOfWarCrimes)
130 ListOfWarCrimes.SetVisible(
true);
131 m_bActiveWarCrimes =
true;
132 SCR_WLibComponentBase.SetTexture(m_WarCrimesHeaderImage, m_TextureHeaderImageWarCrimes, m_StringHeaderImageWarCrimes);
133 m_WarCrimesHeaderImage.SetColor(m_iWarCrimesHeaderColor);
134 m_WarCrimesHeaderTitle.SetText(m_sWarCrimesTitleString);
135 m_WarCrimesHeaderSubTitle.SetText(m_sWarCrimesSubtitleString);
136 m_WarCrimesHeaderSubTitle.SetColor(m_iWarCrimesSubtitleColor);
140 ListOfWarCrimes.SetVisible(
false);
141 m_bActiveWarCrimes =
false;
142 SCR_WLibComponentBase.SetTexture(m_WarCrimesHeaderImage, m_TextureHeaderImageNoWarCrimes, m_StringHeaderImageNoWarCrimes);
143 m_WarCrimesHeaderImage.SetColor(m_iNoWarCrimesHeaderColor);
144 m_WarCrimesHeaderTitle.SetText(m_sNoWarCrimesTitleString);
145 m_WarCrimesHeaderSubTitle.SetText(m_sNoWarCrimesSubtitleString);
146 m_WarCrimesHeaderSubTitle.SetColor(m_iNoWarCrimesSubtitleColor);