Ignore:
Timestamp:
May 19, 2022, 10:39:34 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Use first capital letter in identifiers.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/MessgEx.pas

    r442 r447  
    3939    IconKind: TMessageIconKind;
    4040    OpenSound: string;
    41     function ShowModal: integer; override;
     41    function ShowModal: Integer; override;
    4242    procedure CancelMovie;
    4343  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);
    4646    procedure PaintMyArmy;
    4747    procedure PaintEnemyArmy;
     
    5353
    5454procedure SoundMessageEx(SimpleText, SoundItem: string);
    55 procedure TribeMessage(p: integer; SimpleText, SoundItem: string);
     55procedure TribeMessage(P: Integer; SimpleText, SoundItem: string);
    5656function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    57   : integer;
     57  : Integer;
    5858procedure ContextMessage(SimpleText, SoundItem: string;
    59   ContextKind, ContextNo: integer);
     59  ContextKind, ContextNo: Integer);
    6060
    6161
     
    8181procedure TMessgExDlg.FormShow(Sender: TObject);
    8282var
    83   i: integer;
     83  I: Integer;
    8484begin
    8585  if IconKind = mikEnemyArmy then
     
    150150  end;
    151151
    152   SplitText(true);
     152  SplitText(True);
    153153  ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
    154154  if GameMode = cMovie then
     
    181181      end;
    182182  end;
    183   for i := 0 to ControlCount - 1 do
    184     Controls[i].Top := ClientHeight - (34 + Border);
     183  for I := 0 to ControlCount - 1 do
     184    Controls[I].Top := ClientHeight - (34 + Border);
    185185  if Kind = mkModel then
    186186    EInput.Top := ClientHeight - (76 + Border);
    187187end;
    188188
    189 function TMessgExDlg.ShowModal: integer;
     189function TMessgExDlg.ShowModal: Integer;
    190190var
    191191  Ticks0: TDateTime;
     
    197197    if not((GameMode = cMovie) and (MovieSpeed = 4)) then
    198198    begin
    199       MovieCancelled := false;
     199      MovieCancelled := False;
    200200      Show;
    201201      Ticks0 := NowPrecise;
     
    207207      Hide;
    208208    end;
    209     result := mrOk;
     209    Result := mrOk;
    210210  end
    211211  else
    212     result := inherited;
     212    Result := inherited;
    213213  Gtk2Fix;
    214214end;
     
    216216procedure TMessgExDlg.CancelMovie;
    217217begin
    218   MovieCancelled := true;
    219 end;
    220 
    221 procedure TMessgExDlg.PaintBook(ca: TCanvas; x, y, clPage, clCover: integer);
     218  MovieCancelled := True;
     219end;
     220
     221procedure TMessgExDlg.PaintBook(ca: TCanvas; X, Y, clPage, clCover: Integer);
    222222const
    223223  xScrewed = 77;
     
    228228  TScrewed = array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of Single;
    229229var
    230   ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: integer;
     230  ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: Integer;
    231231  BookRect: TRect;
    232   x1, xR, yR, share: single;
     232  x1, xR, yR, share: Single;
    233233  Screwed: TScrewed;
    234234  SrcPtr: TPixelPointer;
     
    284284    BookRect := SmallBook.BoundsRect;
    285285  end;
    286   x := x - BookRect.Width div 2;
     286  X := X - BookRect.Width div 2;
    287287
    288288  // paint
    289289  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);
    291291
    292292  if IconIndex >= 0 then
     
    301301  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), BookRect, clCover, clPage);
    302302
    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);
    304304end;
    305305
     
    310310procedure TMessgExDlg.PaintEnemyArmy;
    311311var
    312   emix, ix, iy, x, y, count, UnitsInLine: integer;
     312  emix, ix, iy, X, Y, count, UnitsInLine: Integer;
    313313begin
    314314  ix := 0;
     
    321321    for count := 0 to LostArmy[emix] - 1 do
    322322    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;
    325325      with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do
    326326      begin
    327         BitBltCanvas(Canvas, x, y, 64, 48, HGr.Mask.Canvas,
     327        BitBltCanvas(Canvas, X, Y, 64, 48, HGr.Mask.Canvas,
    328328          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,
    330330          pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT);
    331331      end;
    332332
    333333      // next position
    334       inc(ix);
     334      Inc(ix);
    335335      if ix = LostUnitsPerLine then
    336336      begin // next line
    337337        ix := 0;
    338         inc(iy);
     338        Inc(iy);
    339339        if iy = 6 then
    340           exit;
     340          Exit;
    341341        UnitsInLine := nLostArmy - LostUnitsPerLine * iy;
    342342        if UnitsInLine > LostUnitsPerLine then
     
    348348procedure TMessgExDlg.FormPaint(Sender: TObject);
    349349var
    350   p1, clSaveTextLight, clSaveTextShade: integer;
     350  p1, clSaveTextLight, clSaveTextShade: Integer;
    351351begin
    352352  if (IconKind = mikImp) and (IconIndex = 27) then
     
    394394      end;
    395395    mikModel:
    396       with Tribe[me].ModelPicture[IconIndex] do
     396      with Tribe[Me].ModelPicture[IconIndex] do
    397397      begin
    398398        FrameImage(Canvas, BigImp, ClientWidth div 2 - 28, 24, xSizeBig,
     
    498498end;
    499499
    500 procedure TribeMessage(p: integer; SimpleText, SoundItem: string);
     500procedure TribeMessage(P: Integer; SimpleText, SoundItem: string);
    501501begin
    502502  with MessgExDlg do
     
    506506    Kind := mkOk;
    507507    IconKind := mikTribe;
    508     IconIndex := p;
     508    IconIndex := P;
    509509    ShowModal;
    510510  end;
     
    512512
    513513function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    514   : integer;
     514  : Integer;
    515515begin
    516516  with MessgExDlg do
     
    520520    Kind := QueryKind;
    521521    ShowModal;
    522     result := ModalResult;
     522    Result := ModalResult;
    523523  end;
    524524end;
    525525
    526526procedure ContextMessage(SimpleText, SoundItem: string;
    527   ContextKind, ContextNo: integer);
     527  ContextKind, ContextNo: Integer);
    528528begin
    529529  with MessgExDlg do
Note: See TracChangeset for help on using the changeset viewer.