5 protected ref Color m_Color;
7 [
Attribute(
"1.0 1.0 1.0 1.0",
desc:
"Main color of background")]
8 protected ref Color m_BackgroundColor;
11 protected ref Color m_OutlineColor;
13 [
Attribute(
"1.0 1.0 1.0 1.0",
desc:
"Regeneration color of background")]
14 protected ref Color m_BackgroundColorRegen;
16 [
Attribute(
"1.0 1.0 1.0 1.0",
desc:
"Regeneration color of outline")]
17 protected ref Color m_OutlineColorRegen;
19 [
Attribute(
"{B9199157B90D6216}UI/Textures/InventoryIcons/Medical/Medical-icons.imageset",
params:
"edds, imageset", uiwidget: UIWidgets.ResourcePickerThumbnail)]
20 protected ResourceName m_sOutlineImage;
22 [
Attribute(
"Hitzone-outline_UI",
desc:
"Quad name of the outline image (if using an imageset")]
23 protected string m_sOutlineQuadName;
25 [
Attribute(
"{B9199157B90D6216}UI/Textures/InventoryIcons/Medical/Medical-icons.imageset",
params:
"edds, imageset", uiwidget: UIWidgets.ResourcePickerThumbnail)]
26 protected ResourceName m_sBackgroundImage;
28 [
Attribute(
"Hitzone-BG_UI",
desc:
"Quad name of the background image (if using an imageset")]
29 protected string m_sBackgroundQuadName;
31 [
Attribute(
"",
desc:
"Used for access of multiple icons from a single imageset")]
32 protected ref array<string> m_aIconNames;
39 return Color.FromInt(
m_Color.PackToInt());
45 Color GetBackgroundColor()
47 return Color.FromInt(m_BackgroundColor.PackToInt());
53 Color GetOutlineColor()
55 return Color.FromInt(m_OutlineColor.PackToInt());
61 Color GetBackgroundColorRegen()
63 return Color.FromInt(m_BackgroundColorRegen.PackToInt());
69 Color GetOutlineColorRegen()
71 return Color.FromInt(m_OutlineColorRegen.PackToInt());
77 ResourceName GetOutlineImage()
79 return m_sOutlineImage;
85 ResourceName GetBackgroundImage()
87 return m_sBackgroundImage;
93 string GetOutlineQuadName()
95 return m_sOutlineQuadName;
101 string GetBackgroundQuadName()
103 return m_sBackgroundQuadName;
111 bool SetImageTo(ImageWidget imageWidget, ResourceName imageRes,
string quadName =
string.Empty)
117 FilePath.StripExtension(imageRes, ext);
118 if (ext ==
"imageset")
119 return imageWidget.LoadImageFromSet(0, imageRes, quadName);
121 return imageWidget.LoadImageTexture(0, imageRes);
131 bool SetIconTo(ImageWidget imageWidget,
int iconIndex)
133 if (!imageWidget || Icon.IsEmpty())
137 FilePath.StripExtension(Icon, ext);
138 if (ext ==
"imageset")
139 imageWidget.LoadImageFromSet(0, Icon, GetIconSetName(iconIndex));
141 imageWidget.LoadImageTexture(0, GetIconPath());
150 string GetIconSetName(
int iconIndex)
152 if (!m_aIconNames || !m_aIconNames.IsIndexValid(iconIndex))
153 return GetIconSetName();
155 return m_aIconNames[iconIndex];