Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс Chat

Защищенные члены

void Chat ()
 
void ~Chat ()
 
void Init (Widget root_widget)
 
void Destroy ()
 
void Clear ()
 
void Add (ChatMessageEventParams params)
 
void AddInternal (ChatMessageEventParams params)
 

Защищенные данные

Widget m_RootWidget
 
int m_LineHeight
 
int m_LastLine
 
ref array< ref ChatLinem_Lines
 

Закрытые данные

const int LINE_COUNT = 12
 

Подробное описание

channel type, possible values CCSystem(1) CCAdmin(2) CCDirect(4) CCMegaphone(8) CCTransmitter(16) CCPublicAddressSystem(32) CCBattlEye(64)

Конструктор(ы)

◆ Chat()

void Chat ( )
inlineprotected
24 {
26 }
ref array< ref ChatLine > m_Lines
Definition Chat.c:21
Definition EntityAI.c:95

Перекрестные ссылки m_Lines.

◆ ~Chat()

void ~Chat ( )
inlineprotected
29 {
30 Destroy();
31 }
void Destroy()
Definition Chat.c:55

Перекрестные ссылки Destroy().

Методы

◆ Add()

void Add ( ChatMessageEventParams params)
inlineprotected
69 {
71 int name_lenght = params.param2.Length();
72 int text_lenght = params.param3.Length();
74 int channel = params.param1;
75
76 if( channel & CCSystem || channel & CCBattlEye) //TODO separate battleye bellow
77 {
78 if( g_Game.GetProfileOption( EDayZProfilesOptions.GAME_MESSAGES ) )
79 return;
80
81 max_lenght = ChatMaxSystemLength; // system messages can be longer
82 }
83 //TODO add battleye filter to options
84 /*else if( channel & CCBattlEye )
85 {
86 if( g_Game.GetProfileOption( EDayZProfilesOptions.BATTLEYE_MESSAGES ) )
87 return;
88 }*/
89 else if( channel & CCAdmin )
90 {
91 if( g_Game.GetProfileOption( EDayZProfilesOptions.ADMIN_MESSAGES ) )
92 return;
93 }
95 {
96 if( g_Game.GetProfileOption( EDayZProfilesOptions.PLAYER_MESSAGES ) )
97 return;
98 }
99 else if( channel != 0 ) // 0 should be local messages to self
100 {
101 Print("Chat: Unknown channel " + channel);
102 return;
103 }
104
106 {
107 int pos = 0;
109 ref ChatMessageEventParams tmp = new ChatMessageEventParams(params.param1, params.param2, "", params.param4);
110
111 while (pos < text_lenght)
112 {
113 tmp.param3 = params.param3.Substring(pos, lenght);
115
116 tmp.param2 = "";
117 pos += lenght;
118 lenght = Math.Clamp(text_lenght - pos, 0, max_lenght);
119 }
120 }
121 else
122 {
124 }
125 }
DayZGame g_Game
Definition DayZGame.c:3746
EDayZProfilesOptions
Definition EDayZProfilesOptions.c:2
void AddInternal(ChatMessageEventParams params)
Definition Chat.c:127
Definition EnMath.c:7
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Definition gameplay.c:406
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'.

Перекрестные ссылки AddInternal(), Math::Clamp(), g_Game и Print().

◆ AddInternal()

void AddInternal ( ChatMessageEventParams params)
inlineprotected
128 {
129 m_LastLine = (m_LastLine + 1) % m_Lines.Count();
130
132 line.Set(params);
133
134 for (int i = 0; i < m_Lines.Count(); i++)
135 {
136 line = m_Lines.Get((m_LastLine + 1 + i) % LINE_COUNT);
137 line.m_RootWidget.SetPos(0, i * m_LineHeight);
138
139 float x = 0;
140 float y = 0;
141
142 line.m_RootWidget.GetPos(x, y);
143 }
144 }
Icon x
Icon y
const int LINE_COUNT
Definition Chat.c:16
int m_LineHeight
Definition Chat.c:19
int m_LastLine
Definition Chat.c:20
Definition ChatLine.c:2

Перекрестные ссылки LINE_COUNT, m_LastLine, m_LineHeight, m_Lines, x и y.

Используется в Add().

◆ Clear()

void Clear ( )
inlineprotected
61 {
62 for (int i = 0; i < LINE_COUNT; i++)
63 {
64 m_Lines.Get(i).Clear();
65 }
66 }

Перекрестные ссылки LINE_COUNT и m_Lines.

◆ Destroy()

void Destroy ( )
inlineprotected
56 {
57 m_Lines.Clear();
58 }

Перекрестные ссылки m_Lines.

Используется в Init() и ~Chat().

◆ Init()

void Init ( Widget root_widget)
inlineprotected
34 {
35 Destroy();
36
38
39 if (m_RootWidget)
40 {
41 float w;
42 float h;
43 m_RootWidget.GetSize(w,h);
45 m_LastLine = 0;
46
47 for (int i = 0; i < LINE_COUNT; i++)
48 {
50 m_Lines.Insert(line);
51 }
52 }
53 }
Widget m_RootWidget
Definition Chat.c:18

Перекрестные ссылки Destroy(), LINE_COUNT, m_LastLine, m_LineHeight, m_Lines и m_RootWidget.

Поля

◆ LINE_COUNT

const int LINE_COUNT = 12
private

Используется в AddInternal(), Clear() и Init().

◆ m_LastLine

int m_LastLine
protected

Используется в AddInternal() и Init().

◆ m_LineHeight

int m_LineHeight
protected

Используется в AddInternal() и Init().

◆ m_Lines

ref array<ref ChatLine> m_Lines
protected

Используется в AddInternal(), Chat(), Clear(), Destroy() и Init().

◆ m_RootWidget

Widget m_RootWidget
protected

Используется в Init().


Объявления и описания членов класса находятся в файле: