Ignore:
Timestamp:
Nov 28, 2023, 3:16:24 PM (12 months ago)
Author:
chronos
Message:
  • Modified: Do not initialize all local player windows at the start of the game but later when they are really opened. This also fixes window initialization under Qt5 widgetset.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r447 r460  
    4646    Lines: Integer;
    4747    TopSpace: Integer;
    48     procedure SplitText(preview: boolean);
     48    procedure SplitText(Preview: Boolean);
    4949    procedure CorrectHeight;
    5050  end;
     
    206206procedure TDrawDlg.InitButtons;
    207207var
    208   cix: integer;
     208  cix: Integer;
    209209  // ButtonDownSound, ButtonUpSound: string;
    210210begin
     
    228228procedure TDrawDlg.SmartInvalidate;
    229229var
    230   i: integer;
     230  i: Integer;
    231231  r0, r1: HRgn;
    232232begin
     
    240240      DeleteObject(r1);
    241241    end;
    242   InvalidateRgn(Handle, r0, false);
     242  InvalidateRgn(Handle, r0, False);
    243243  DeleteObject(r0);
    244244end;
     
    260260procedure TBaseMessgDlg.FormPaint(Sender: TObject);
    261261var
    262   i, cix: integer;
     262  i, cix: Integer;
    263263begin
    264264  if csDesigning in ComponentState then Exit;
    265   PaintBackground(self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
     265  PaintBackground(Self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
    266266    ClientHeight - (6 + 2 * Border));
    267267  for i := 0 to Border do
     
    274274    ClientHeight - (3 + Border), MainTexture.ColorBevelLight,
    275275    MainTexture.ColorBevelShade);
    276   SplitText(false);
     276  SplitText(False);
    277277
    278278  for cix := 0 to ControlCount - 1 do
     
    281281end;
    282282
    283 procedure TBaseMessgDlg.SplitText(preview: boolean);
    284 var
    285   Start, Stop, OrdinaryStop, LinesCount: integer;
     283procedure TBaseMessgDlg.SplitText(Preview: Boolean);
     284var
     285  Start, Stop, OrdinaryStop, LinesCount: Integer;
    286286  s: string;
    287287begin
     
    294294      (BiColorTextWidth(Canvas, Copy(MessgText, Start, Stop - Start + 1)) <
    295295      ClientWidth - 56) do
    296       inc(Stop);
     296      Inc(Stop);
    297297    if Stop <> Length(MessgText) then
    298298    begin
     
    303303        (MessgText[OrdinaryStop + 1] = '\');
    304304      if (OrdinaryStop + 1 - Start) * 2 >= Stop - Start then
    305         Stop := OrdinaryStop
    306     end;
    307     if not preview then
     305        Stop := OrdinaryStop;
     306    end;
     307    if not Preview then
    308308    begin
    309309      s := Copy(MessgText, Start, Stop - Start + 1);
     
    313313    end;
    314314    Start := Stop + 2;
    315     inc(LinesCount)
    316   end;
    317   if preview then
     315    inc(LinesCount);
     316  end;
     317  if Preview then
    318318    Lines := LinesCount;
    319319end;
     
    321321procedure TBaseMessgDlg.CorrectHeight;
    322322var
    323   i: integer;
     323  i: Integer;
    324324begin
    325325  ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
Note: See TracChangeset for help on using the changeset viewer.