4 protected string m_sImageWidgetName;
7 protected string m_sTitleWidgetName;
10 protected string m_sDescriptionWidgetName;
13 protected string m_sLoadingName;
16 protected string m_sDefaultPreset;
21 protected ImageWidget m_wImage;
22 protected TextWidget m_wTitle;
23 protected TextWidget m_wDescription;
24 protected Widget m_wLoading;
26 protected Widget m_wRoot;
29 protected override void HandlerAttached(Widget w)
36 if (!m_sTitleWidgetName.IsEmpty())
37 m_wTitle = TextWidget.Cast(w.FindAnyWidget(m_sTitleWidgetName));
39 if (!m_sDescriptionWidgetName.IsEmpty())
40 m_wDescription = TextWidget.Cast(w.FindAnyWidget(m_sDescriptionWidgetName));
42 if (!m_sLoadingName.IsEmpty())
45 SetContentFromPreset(m_sDefaultPreset);
53 void SetContentFromPreset(
string presetTag)
55 if (!m_aContentPresets || presetTag.IsEmpty())
66 SetContentFromPreset(preset.m_UIInfo);
73 array<Widget> mainWidgets = {
m_wImage, m_wTitle, m_wDescription};
74 bool loading = uiInfo.GetDisplayLoading();
75 foreach (Widget w : mainWidgets)
78 w.SetVisible(!loading);
91 if (!uiInfo.GetName().IsEmpty())
92 loadingComp.SetText(uiInfo.GetName());
93 else if (!uiInfo.GetDescription().IsEmpty())
94 loadingComp.SetText(uiInfo.GetDescription());
102 if (uiInfo.HasIcon())
104 m_wImage.SetColor(uiInfo.GetImageColor());
116 if (!uiInfo.GetName().IsEmpty())
118 uiInfo.SetNameTo(m_wTitle);
119 m_wTitle.SetVisible(
true);
123 m_wTitle.SetVisible(
false);
129 if (!uiInfo.GetName().IsEmpty())
131 uiInfo.SetDescriptionTo(m_wDescription);
132 m_wDescription.SetVisible(
true);
136 m_wDescription.SetVisible(
false);
143 Widget GetRootWidget()
149 void SetVisible(
bool visible)
159 [
Attribute(
desc:
"The ID of the Preset used to set the correct visual information")]
170 ref array<ref SCR_SimpleMessagePreset> m_aPresets;
177 if (preset.m_sTag == tag)
181 Print(
string.Format(
"SCR_SimpleMessagePresets: preset not found: %1", tag), LogLevel.ERROR);