6 [
Attribute(
"0.898 0.541 0.184 1", UIWidgets.ColorPicker)]
7 protected ref Color m_BackgroundColor;
9 [
Attribute(
"0 0 0 1", UIWidgets.ColorPicker)]
10 protected ref Color m_IconColor;
12 [
Attribute(
"0 0 0 1", UIWidgets.ColorPicker)]
13 protected ref Color m_OutlineColor;
15 [
Attribute(
"0 0 0 1", UIWidgets.ColorPicker)]
16 protected ref Color m_HoverColor;
19 protected bool m_BackgroundShown;
22 protected bool m_IconShown;
25 protected bool m_OutlineShown;
28 protected bool m_HoverShown;
30 protected const string TASK_ICON_IMAGESET =
"{10C0A9A305E8B3A4}UI/Imagesets/Tasks/Task_Icons.imageset";
32 protected Widget m_wRoot;
34 override void HandlerAttached(Widget w)
37 SetBackgroundColor(m_BackgroundColor);
38 SetIconColor(m_IconColor);
39 SetOutlineColor(m_OutlineColor);
40 SetHoverColor(m_HoverColor);
41 BackgroundShown(m_BackgroundShown);
42 IconShown(m_IconShown);
43 OutlineShown(m_OutlineShown);
44 HoverShown(m_HoverShown);
45 SetIconType(m_TaskIconType);
49 void SetBackgroundColor(Color color)
51 ImageWidget background = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Background"));
54 background.SetColor(color);
58 void SetIconColor(Color color)
60 ImageWidget icon = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Icon"));
67 void SetOutlineColor(Color color)
69 ImageWidget outline = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Outline"));
72 outline.SetColor(color);
76 void SetHoverColor(Color color)
78 ImageWidget hover = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Hover"));
81 hover.SetColor(color);
85 void BackgroundShown(
bool shown)
87 ImageWidget background = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Background"));
91 background.SetOpacity(1);
93 background.SetOpacity(0);
97 void IconShown(
bool shown)
99 ImageWidget icon = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Icon"));
109 void OutlineShown(
bool shown)
111 ImageWidget outline = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Outline"));
115 outline.SetOpacity(1);
117 outline.SetOpacity(0);
121 void HoverShown(
bool shown)
123 ImageWidget hover = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Hover"));
135 ImageWidget icon = ImageWidget.Cast(
m_wRoot.FindAnyWidget(
"Icon"));
144 iconName =
"Icon_Task_Custom";
147 iconName =
"Icon_Task_Evacuate";
150 iconName =
"Icon_Task_Guard";
153 iconName =
"Icon_Task_Move";
156 iconName =
"Icon_Task_Seize_Relay";
159 iconName =
"Icon_Task_Refuel";
162 iconName =
"Icon_Task_Seize";
165 iconName =
"Icon_Task_Transport";
167 icon.LoadImageFromSet(0, TASK_ICON_IMAGESET, iconName);
168 icon.GetImageSize(0, x, y);