70 int max_lenght = ChatMaxUserLength;
71 int name_lenght = params.param2.Length();
72 int text_lenght = params.param3.Length();
73 int total_lenght = text_lenght + name_lenght;
74 int channel = params.param1;
76 if( channel & CCSystem || channel & CCBattlEye)
81 max_lenght = ChatMaxSystemLength;
89 else if( channel & CCAdmin )
94 else if( channel & CCDirect || channel & CCMegaphone || channel & CCTransmitter || channel & CCPublicAddressSystem )
99 else if( channel != 0 )
101 Print(
"Chat: Unknown channel " + channel);
105 if (total_lenght > max_lenght)
108 int lenght =
Math.
Clamp(max_lenght - name_lenght, 0, text_lenght);
111 while (pos < text_lenght)
113 tmp.param3 = params.param3.Substring(pos, lenght);
118 lenght =
Math.
Clamp(text_lenght - pos, 0, max_lenght);
134 for (
int i = 0; i <
m_Lines.Count(); i++)
protected ref array< ref ChatLine > m_Lines
protected int m_LineHeight
void AddInternal(ChatMessageEventParams params)
void Init(Widget root_widget)
void Add(ChatMessageEventParams params)
protected Widget m_RootWidget
void Set(ChatMessageEventParams params)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
proto void Print(void var)
Prints content of variable to console/log.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.