207 |
207 |
208 procedure DrawChat; |
208 procedure DrawChat; |
209 var i, t, left, top, cnt: Longword; |
209 var i, t, left, top, cnt: Longword; |
210 begin |
210 begin |
211 ChatReady:= true; // maybe move to somewhere else? |
211 ChatReady:= true; // maybe move to somewhere else? |
212 if MissedCount <> 0 then // there are chat strings we missed, so print them now |
|
213 begin |
|
214 for i:= 0 to MissedCount - 1 do |
|
215 AddChatString(MStrs[i]); |
|
216 MissedCount:= 0; |
|
217 end; |
|
218 i:= lastStr; |
|
219 |
212 |
220 left:= 4 - cScreenWidth div 2; |
213 left:= 4 - cScreenWidth div 2; |
221 top := 10; |
214 top := 10; |
222 |
215 |
223 if (GameState = gsChat) and (InputStr.Tex <> nil) then |
216 if (GameState = gsChat) and (InputStr.Tex <> nil) then |
224 begin |
217 begin |
225 // draw under all other lines |
218 // draw under all other lines |
226 DrawTexture(left, top + visibleCount * ClHeight, InputStr.Tex); |
219 DrawTexture(left, top + visibleCount * ClHeight, InputStr.Tex); |
227 end; |
220 end; |
228 |
221 |
229 |
222 if UIDisplay <> uiNone then |
230 cnt:= 0; // count of lines displayed |
223 begin |
231 t := 1; // # of current line processed |
224 if MissedCount <> 0 then // there are chat strings we missed, so print them now |
232 |
225 begin |
233 // draw lines in reverse order |
226 for i:= 0 to MissedCount - 1 do |
234 while (((t < 7) and (Strs[i].Time > RealTicks)) or ((t < MaxStrIndex) and showAll)) |
227 AddChatString(MStrs[i]); |
235 and (Strs[i].Tex <> nil) do |
228 MissedCount:= 0; |
236 begin |
229 end; |
237 // draw lines 4px away from left screen border and 2px away from top |
230 i:= lastStr; |
238 DrawTexture(left, top + (visibleCount - t) * ClHeight, Strs[i].Tex); |
231 |
239 |
232 cnt:= 0; // count of lines displayed |
240 if i = 0 then |
233 t := 1; // # of current line processed |
241 i:= MaxStrIndex |
234 |
242 else |
235 // draw lines in reverse order |
243 dec(i); |
236 while (((t < 7) and (Strs[i].Time > RealTicks)) or ((t < MaxStrIndex) and showAll)) |
244 |
237 and (Strs[i].Tex <> nil) do |
245 inc(cnt); |
238 begin |
246 inc(t) |
239 // draw lines 4px away from left screen border and 2px away from top |
247 end; |
240 DrawTexture(left, top + (visibleCount - t) * ClHeight, Strs[i].Tex); |
248 |
241 |
249 visibleCount:= cnt; |
242 if i = 0 then |
|
243 i:= MaxStrIndex |
|
244 else |
|
245 dec(i); |
|
246 |
|
247 inc(cnt); |
|
248 inc(t) |
|
249 end; |
|
250 |
|
251 visibleCount:= cnt; |
|
252 end; |
250 end; |
253 end; |
251 |
254 |
252 procedure SendHogSpeech(s: shortstring); |
255 procedure SendHogSpeech(s: shortstring); |
253 begin |
256 begin |
254 SendIPC('h' + s); |
257 SendIPC('h' + s); |