5 protected ResourceName CHAT_IMAGESET =
"{1872FFA1133724A2}UI/Textures/Chat/chat.imageset";
7 protected Widget m_wRoot;
10 override void HandlerAttached(Widget w)
30 Color channelColor = style.m_Color;
31 string chatTypeImageName = style.m_sIconName;
37 m_Widgets.m_MessageText.SetColor(Color.FromInt(Color.WHITE));
40 Color badgeColor = Color.FromInt(Color.WHITE);
41 if (style.m_bColoredBadge)
42 badgeColor = channelColor;
47 Color imageColor = Color.FromInt(Color.WHITE);
48 if (style.m_bColoredIcon)
49 imageColor = channelColor;
51 m_Widgets.m_TypeImage.SetColor(imageColor);
54 float bgAlphaOld =
m_Widgets.m_BackgroundImage.GetColor().A();
55 Color bgColorNew = Color.FromInt(Color.BLACK);
56 if (style.m_bColoredBackground)
57 bgColorNew = Color.FromInt(style.m_Color.PackToInt());
59 bgColorNew.SetA(bgAlphaOld);
60 m_Widgets.m_BackgroundImage.SetColor(bgColorNew);
61 m_Widgets.m_BackgroundImage.SetVisible(
true);
67 string senderNameText;
69 senderNameText = messagePrivate.m_sSenderName +
": ";
70 else if (messageGeneral)
71 senderNameText = messageGeneral.m_sSenderName +
": ";
73 Color textColor = Color.FromInt(Color.WHITE);
76 if (!senderNameText.IsEmpty() && style.m_bColoredPlayerName)
77 textColor = style.m_Color;
79 m_Widgets.m_TypeImage.LoadImageFromSet(0, CHAT_IMAGESET, chatTypeImageName);
81 m_Widgets.m_MessageText.SetColor(textColor);
82 m_Widgets.m_MessageText.SetText(senderNameText + msg.m_sMessage);
86 void SetEmptyMessage()
90 m_Widgets.m_BackgroundImage.SetVisible(
false);
97 void SetVisible(
bool visible)
104 Widget GetRootWidget()