50 InputStr: TChatLine; |
51 InputStr: TChatLine; |
51 InputStrL: array[0..260] of char; // for full str + 4-byte utf-8 char |
52 InputStrL: array[0..260] of char; // for full str + 4-byte utf-8 char |
52 ChatReady: boolean; |
53 ChatReady: boolean; |
53 showAll: boolean; |
54 showAll: boolean; |
54 |
55 |
55 const colors: array[#0..#6] of TSDL_Color = ( |
56 const |
56 (r:$FF; g:$FF; b:$FF; unused:$FF), // unused, feel free to take it for anything |
57 colors: array[#0..#6] of TSDL_Color = ( |
57 (r:$FF; g:$FF; b:$FF; unused:$FF), // chat message [White] |
58 (r:$FF; g:$FF; b:$FF; unused:$FF), // unused, feel free to take it for anything |
58 (r:$FF; g:$00; b:$FF; unused:$FF), // action message [Purple] |
59 (r:$FF; g:$FF; b:$FF; unused:$FF), // chat message [White] |
59 (r:$90; g:$FF; b:$90; unused:$FF), // join/leave message [Lime] |
60 (r:$FF; g:$00; b:$FF; unused:$FF), // action message [Purple] |
60 (r:$FF; g:$FF; b:$A0; unused:$FF), // team message [Light Yellow] |
61 (r:$90; g:$FF; b:$90; unused:$FF), // join/leave message [Lime] |
61 (r:$FF; g:$00; b:$00; unused:$FF), // error messages [Red] |
62 (r:$FF; g:$FF; b:$A0; unused:$FF), // team message [Light Yellow] |
62 (r:$00; g:$FF; b:$FF; unused:$FF) // input line [Light Blue] |
63 (r:$FF; g:$00; b:$00; unused:$FF), // error messages [Red] |
63 ); |
64 (r:$00; g:$FF; b:$FF; unused:$FF) // input line [Light Blue] |
|
65 ); |
|
66 ChatCommandz: array [TChatCmd] of record |
|
67 ChatCmd: string[31]; |
|
68 ProcedureCallChatCmd: string[31]; |
|
69 end = ( |
|
70 (ChatCmd: '/quit'; ProcedureCallChatCmd: 'halt'), |
|
71 (ChatCmd: '/pause'; ProcedureCallChatCmd: 'pause'), |
|
72 (ChatCmd: '/finish'; ProcedureCallChatCmd: 'finish'), |
|
73 (ChatCmd: '/fullscreen'; ProcedureCallChatCmd: 'fullscr') |
|
74 ); |
64 |
75 |
65 procedure SetLine(var cl: TChatLine; str: shortstring; isInput: boolean); |
76 procedure SetLine(var cl: TChatLine; str: shortstring; isInput: boolean); |
66 var strSurface, resSurface: PSDL_Surface; |
77 var strSurface, resSurface: PSDL_Surface; |
67 w, h: LongInt; |
78 w, h: LongInt; |
68 color: TSDL_Color; |
79 color: TSDL_Color; |
263 |
275 |
264 for i:= Low(TWave) to High(TWave) do |
276 for i:= Low(TWave) to High(TWave) do |
265 if (s = Wavez[i].cmd) then |
277 if (s = Wavez[i].cmd) then |
266 begin |
278 begin |
267 ParseCommand('/taunt ' + char(i), true); |
279 ParseCommand('/taunt ' + char(i), true); |
|
280 exit |
|
281 end; |
|
282 |
|
283 for j:= Low(TChatCmd) to High(TChatCmd) do |
|
284 if (s = ChatCommandz[j].ChatCmd) then |
|
285 begin |
|
286 ParseCommand(ChatCommandz[j].ProcedureCallChatCmd, true); |
268 exit |
287 exit |
269 end; |
288 end; |
270 end |
289 end |
271 else |
290 else |
272 ParseCommand('/say ' + s, true); |
291 ParseCommand('/say ' + s, true); |