Changeset 447 for trunk/LocalPlayer/MessgEx.pas
- Timestamp:
- May 19, 2022, 10:39:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/MessgEx.pas
r442 r447 39 39 IconKind: TMessageIconKind; 40 40 OpenSound: string; 41 function ShowModal: integer; override;41 function ShowModal: Integer; override; 42 42 procedure CancelMovie; 43 43 private 44 MovieCancelled: boolean;45 procedure PaintBook(ca: TCanvas; x, y, clPage, clCover: integer);44 MovieCancelled: Boolean; 45 procedure PaintBook(ca: TCanvas; X, Y, clPage, clCover: Integer); 46 46 procedure PaintMyArmy; 47 47 procedure PaintEnemyArmy; … … 53 53 54 54 procedure SoundMessageEx(SimpleText, SoundItem: string); 55 procedure TribeMessage( p: integer; SimpleText, SoundItem: string);55 procedure TribeMessage(P: Integer; SimpleText, SoundItem: string); 56 56 function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string) 57 : integer;57 : Integer; 58 58 procedure ContextMessage(SimpleText, SoundItem: string; 59 ContextKind, ContextNo: integer);59 ContextKind, ContextNo: Integer); 60 60 61 61 … … 81 81 procedure TMessgExDlg.FormShow(Sender: TObject); 82 82 var 83 i: integer;83 I: Integer; 84 84 begin 85 85 if IconKind = mikEnemyArmy then … … 150 150 end; 151 151 152 SplitText( true);152 SplitText(True); 153 153 ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing; 154 154 if GameMode = cMovie then … … 181 181 end; 182 182 end; 183 for i:= 0 to ControlCount - 1 do184 Controls[ i].Top := ClientHeight - (34 + Border);183 for I := 0 to ControlCount - 1 do 184 Controls[I].Top := ClientHeight - (34 + Border); 185 185 if Kind = mkModel then 186 186 EInput.Top := ClientHeight - (76 + Border); 187 187 end; 188 188 189 function TMessgExDlg.ShowModal: integer;189 function TMessgExDlg.ShowModal: Integer; 190 190 var 191 191 Ticks0: TDateTime; … … 197 197 if not((GameMode = cMovie) and (MovieSpeed = 4)) then 198 198 begin 199 MovieCancelled := false;199 MovieCancelled := False; 200 200 Show; 201 201 Ticks0 := NowPrecise; … … 207 207 Hide; 208 208 end; 209 result := mrOk;209 Result := mrOk; 210 210 end 211 211 else 212 result := inherited;212 Result := inherited; 213 213 Gtk2Fix; 214 214 end; … … 216 216 procedure TMessgExDlg.CancelMovie; 217 217 begin 218 MovieCancelled := true;219 end; 220 221 procedure TMessgExDlg.PaintBook(ca: TCanvas; x, y, clPage, clCover: integer);218 MovieCancelled := True; 219 end; 220 221 procedure TMessgExDlg.PaintBook(ca: TCanvas; X, Y, clPage, clCover: Integer); 222 222 const 223 223 xScrewed = 77; … … 228 228 TScrewed = array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of Single; 229 229 var 230 ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: integer;230 ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: Integer; 231 231 BookRect: TRect; 232 x1, xR, yR, share: single;232 x1, xR, yR, share: Single; 233 233 Screwed: TScrewed; 234 234 SrcPtr: TPixelPointer; … … 284 284 BookRect := SmallBook.BoundsRect; 285 285 end; 286 x := x- BookRect.Width div 2;286 X := X - BookRect.Width div 2; 287 287 288 288 // paint 289 289 UnshareBitmap(LogoBuffer); 290 BitBltCanvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, x, y);290 BitBltCanvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, X, Y); 291 291 292 292 if IconIndex >= 0 then … … 301 301 ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), BookRect, clCover, clPage); 302 302 303 BitBltCanvas(ca, x, y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0);303 BitBltCanvas(ca, X, Y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0); 304 304 end; 305 305 … … 310 310 procedure TMessgExDlg.PaintEnemyArmy; 311 311 var 312 emix, ix, iy, x, y, count, UnitsInLine: integer;312 emix, ix, iy, X, Y, count, UnitsInLine: Integer; 313 313 begin 314 314 ix := 0; … … 321 321 for count := 0 to LostArmy[emix] - 1 do 322 322 begin 323 x:= ClientWidth div 2 + ix * 64 - UnitsInLine * 32;324 y:= 26 + Border + TopSpace + Lines * MessageLineSpacing + iy * 48;323 X := ClientWidth div 2 + ix * 64 - UnitsInLine * 32; 324 Y := 26 + Border + TopSpace + Lines * MessageLineSpacing + iy * 48; 325 325 with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do 326 326 begin 327 BitBltCanvas(Canvas, x, y, 64, 48, HGr.Mask.Canvas,327 BitBltCanvas(Canvas, X, Y, 64, 48, HGr.Mask.Canvas, 328 328 pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCAND); 329 BitBltCanvas(Canvas, x, y, 64, 48, HGr.Data.Canvas,329 BitBltCanvas(Canvas, X, Y, 64, 48, HGr.Data.Canvas, 330 330 pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT); 331 331 end; 332 332 333 333 // next position 334 inc(ix);334 Inc(ix); 335 335 if ix = LostUnitsPerLine then 336 336 begin // next line 337 337 ix := 0; 338 inc(iy);338 Inc(iy); 339 339 if iy = 6 then 340 exit;340 Exit; 341 341 UnitsInLine := nLostArmy - LostUnitsPerLine * iy; 342 342 if UnitsInLine > LostUnitsPerLine then … … 348 348 procedure TMessgExDlg.FormPaint(Sender: TObject); 349 349 var 350 p1, clSaveTextLight, clSaveTextShade: integer;350 p1, clSaveTextLight, clSaveTextShade: Integer; 351 351 begin 352 352 if (IconKind = mikImp) and (IconIndex = 27) then … … 394 394 end; 395 395 mikModel: 396 with Tribe[ me].ModelPicture[IconIndex] do396 with Tribe[Me].ModelPicture[IconIndex] do 397 397 begin 398 398 FrameImage(Canvas, BigImp, ClientWidth div 2 - 28, 24, xSizeBig, … … 498 498 end; 499 499 500 procedure TribeMessage( p: integer; SimpleText, SoundItem: string);500 procedure TribeMessage(P: Integer; SimpleText, SoundItem: string); 501 501 begin 502 502 with MessgExDlg do … … 506 506 Kind := mkOk; 507 507 IconKind := mikTribe; 508 IconIndex := p;508 IconIndex := P; 509 509 ShowModal; 510 510 end; … … 512 512 513 513 function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string) 514 : integer;514 : Integer; 515 515 begin 516 516 with MessgExDlg do … … 520 520 Kind := QueryKind; 521 521 ShowModal; 522 result := ModalResult;522 Result := ModalResult; 523 523 end; 524 524 end; 525 525 526 526 procedure ContextMessage(SimpleText, SoundItem: string; 527 ContextKind, ContextNo: integer);527 ContextKind, ContextNo: Integer); 528 528 begin 529 529 with MessgExDlg do
Note:
See TracChangeset
for help on using the changeset viewer.