56 ChatReady: boolean; |
56 ChatReady: boolean; |
57 showAll: boolean; |
57 showAll: boolean; |
58 |
58 |
59 const |
59 const |
60 colors: array[#0..#6] of TSDL_Color = ( |
60 colors: array[#0..#6] of TSDL_Color = ( |
61 (r:$FF; g:$FF; b:$FF; unused:$FF), // unused, feel free to take it for anything |
61 (r:$FF; g:$FF; b:$FF; a:$FF), // unused, feel free to take it for anything |
62 (r:$FF; g:$FF; b:$FF; unused:$FF), // chat message [White] |
62 (r:$FF; g:$FF; b:$FF; a:$FF), // chat message [White] |
63 (r:$FF; g:$00; b:$FF; unused:$FF), // action message [Purple] |
63 (r:$FF; g:$00; b:$FF; a:$FF), // action message [Purple] |
64 (r:$90; g:$FF; b:$90; unused:$FF), // join/leave message [Lime] |
64 (r:$90; g:$FF; b:$90; a:$FF), // join/leave message [Lime] |
65 (r:$FF; g:$FF; b:$A0; unused:$FF), // team message [Light Yellow] |
65 (r:$FF; g:$FF; b:$A0; a:$FF), // team message [Light Yellow] |
66 (r:$FF; g:$00; b:$00; unused:$FF), // error messages [Red] |
66 (r:$FF; g:$00; b:$00; a:$FF), // error messages [Red] |
67 (r:$00; g:$FF; b:$FF; unused:$FF) // input line [Light Blue] |
67 (r:$00; g:$FF; b:$FF; a:$FF) // input line [Light Blue] |
68 ); |
68 ); |
69 ChatCommandz: array [TChatCmd] of record |
69 ChatCommandz: array [TChatCmd] of record |
70 ChatCmd: string[31]; |
70 ChatCmd: string[31]; |
71 ProcedureCallChatCmd: string[31]; |
71 ProcedureCallChatCmd: string[31]; |
72 end = ( |
72 end = ( |
323 begin |
325 begin |
324 if Length(InputStr.s) > 0 then |
326 if Length(InputStr.s) > 0 then |
325 SetLine(InputStr, '', true) |
327 SetLine(InputStr, '', true) |
326 else CleanupInput |
328 else CleanupInput |
327 end; |
329 end; |
328 SDLK_RETURN: |
330 SDLK_RETURN, SDLK_KP_ENTER: |
329 begin |
331 begin |
330 if Length(InputStr.s) > 0 then |
332 if Length(InputStr.s) > 0 then |
331 begin |
333 begin |
332 AcceptChatString(InputStr.s); |
334 AcceptChatString(InputStr.s); |
333 SetLine(InputStr, '', false) |
335 SetLine(InputStr, '', false) |
419 |
421 |
420 procedure chChat(var s: shortstring); |
422 procedure chChat(var s: shortstring); |
421 begin |
423 begin |
422 s:= s; // avoid compiler hint |
424 s:= s; // avoid compiler hint |
423 GameState:= gsChat; |
425 GameState:= gsChat; |
|
426 {$IFNDEF SDL2} |
424 SDL_EnableKeyRepeat(200,45); |
427 SDL_EnableKeyRepeat(200,45); |
|
428 {$ENDIF} |
425 if length(s) = 0 then |
429 if length(s) = 0 then |
426 SetLine(InputStr, '', true) |
430 SetLine(InputStr, '', true) |
427 else |
431 else |
428 SetLine(InputStr, '/team ', true) |
432 SetLine(InputStr, '/team ', true) |
429 end; |
433 end; |