Changeset 94 for trunk/UEngine.pas


Ignore:
Timestamp:
Sep 27, 2022, 12:04:27 AM (20 months ago)
Author:
chronos
Message:
  • Fixed: Night and day state in clock.
  • Fixed: Translation of short days of weeks names.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UEngine.pas

    r93 r94  
    187187    procedure DrawTrains(Canvas: TCanvas);
    188188    procedure DrawGameOver(Canvas: TCanvas; CanvasSize: TPoint);
     189    procedure DrawNewTrain(Canvas: TCanvas; CanvasSize: TPoint);
    189190    procedure DrawStationPassengerOverload(Canvas: TCanvas);
    190191    procedure DrawLines(Canvas: TCanvas);
     
    18341835  ClockSize = 20;
    18351836begin
     1837  if (Time / OneHour > 6) and (Time / OneHour < 18) then begin
     1838    Canvas.Brush.Style := bsSolid;
     1839    Canvas.Brush.Color := Colors.Background;
     1840  end else begin
     1841    Canvas.Brush.Style := bsSolid;
     1842    Canvas.Brush.Color := Colors.Text;
     1843  end;
    18361844  Canvas.Pen.Style := psSolid;
    18371845  Canvas.Pen.Color := Colors.Text;
     
    18401848  Angle := Time / (12 * OneHour) * 2 * Pi - Pi / 2;
    18411849  Canvas.EllipseC(ClockCenter.X, ClockCenter.Y, ClockSize, ClockSize);
     1850  Canvas.Brush.Style := bsClear;
     1851
     1852  if (Time / OneHour > 6) and (Time / OneHour < 18) then begin
     1853    Canvas.Pen.Color := Colors.Text;
     1854  end else begin
     1855    Canvas.Pen.Color := Colors.Background;
     1856  end;
    18421857  Canvas.Line(ClockCenter, Point(ClockCenter.X + Round(Cos(Angle) * ClockSize * 0.8),
    18431858    ClockCenter.Y + Round(Sin(Angle) * ClockSize * 0.8)));
    18441859  for I := 0 to 12 do begin
    18451860    Angle := I / 12 * 2 * Pi;
    1846     Canvas.Line(ClockCenter.X + Round(Cos(Angle) * ClockSize * 0.8),
    1847       ClockCenter.Y + Round(Sin(Angle) * ClockSize * 0.8),
     1861    Canvas.Line(ClockCenter.X + Round(Cos(Angle) * ClockSize * 0.7),
     1862      ClockCenter.Y + Round(Sin(Angle) * ClockSize * 0.7),
    18481863      ClockCenter.X + Round(Cos(Angle) * ClockSize * 0.9),
    18491864      ClockCenter.Y + Round(Sin(Angle) * ClockSize * 0.9));
    18501865  end;
    1851   Y := ClockCenter.Y + ScaleY(5, 96);
    1852 
     1866  Y := ClockCenter.Y;
     1867
     1868  Canvas.Pen.Color := Colors.Text;
    18531869  Canvas.Font.Color := Colors.Text;
    18541870  Text := FormatDateTime('ddd', Time + 2);
    1855   Canvas.TextOut(ClockCenter.X - ClockSize - Canvas.TextWidth(Text) - 10,
     1871  Canvas.TextOut(ClockCenter.X - ClockSize - Canvas.TextWidth(Text) - ScaleX(10, 96),
    18561872    Y - Canvas.TextHeight(Text) div 2, Text);
    1857   Y := Y + Canvas.TextHeight(Text)  + ScaleY(5, 96);
     1873  Y := Y + Canvas.TextHeight(Text) + ScaleY(5, 96);
    18581874
    18591875  Text := SDay + ' ' + IntToStr(Trunc(Time));
    1860   Canvas.TextOut(ClockCenter.X - ClockSize - Canvas.TextWidth(Text) - 10,
     1876  Canvas.TextOut(ClockCenter.X - ClockSize - Canvas.TextWidth(Text) - ScaleX(10, 96),
    18611877    Y - Canvas.TextHeight(Text) div 2, Text);
    1862   Y := Y + Canvas.TextHeight(Text)  + ScaleY(5, 96);
     1878  Y := Y + Canvas.TextHeight(Text) + ScaleY(5, 96);
    18631879
    18641880  ImagePause.Canvas := Canvas;
    1865   ImagePause.Bounds := Bounds(CanvasSize.X - ScaleX(20 + 10, 96), Y, ScaleX(20, 96), ScaleY(20, 96));
     1881  ImagePause.Bounds := Bounds(CanvasSize.X - ScaleX(20 + 10, 96), Y,
     1882    ScaleX(20, 96), ScaleY(20, 96));
    18661883  ImagePause.Paint;
    18671884  Y := Y + ImagePause.Bounds.Height + ScaleY(5, 96);
    18681885
    18691886  ImagePlay.Canvas := Canvas;
    1870   ImagePlay.Bounds := Bounds(CanvasSize.X - ScaleX(20 + 10, 96) , Y, ScaleX(20, 96), ScaleY(20, 96));
     1887  ImagePlay.Bounds := Bounds(CanvasSize.X - ScaleX(20 + 10, 96) , Y,
     1888    ScaleX(20, 96), ScaleY(20, 96));
    18711889  ImagePlay.Paint;
    18721890  Y := Y + ImagePlay.Bounds.Height + ScaleY(5, 96);
    18731891
    18741892  ImageFastForward.Canvas := Canvas;
    1875   ImageFastForward.Bounds := Bounds(CanvasSize.X - ScaleX(20 + 10, 96) , Y, ScaleX(20, 96), ScaleY(20, 96));
     1893  ImageFastForward.Bounds := Bounds(CanvasSize.X - ScaleX(20 + 10, 96) , Y,
     1894    ScaleX(20, 96), ScaleY(20, 96));
    18761895  ImageFastForward.Paint;
    18771896  Y := Y + ImageFastForward.Bounds.Height + ScaleY(5, 96);
     
    19892008      HighestServedDaysCount := ServedDaysCount;
    19902009  end;
     2010end;
     2011
     2012procedure TEngine.DrawNewTrain(Canvas: TCanvas; CanvasSize: TPoint);
     2013begin
     2014
    19912015end;
    19922016
Note: See TracChangeset for help on using the changeset viewer.