Changeset 94


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

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r87 r94  
    4040  object Translator1: TTranslator
    4141    POFilesFolder = 'Languages'
     42    OnTranslate = Translator1Translate
    4243    Left = 496
    4344    Top = 358
  • trunk/Forms/UFormMain.pas

    r93 r94  
    3838    procedure PaintBox1Resize(Sender: TObject);
    3939    procedure Timer1Timer(Sender: TObject);
     40    procedure Translator1Translate(Sender: TObject);
    4041  private
    4142    Initialized: Boolean;
     
    6263  UFormImages, UPixelPointer;
    6364
     65resourcestring
     66  SMondayShort = 'MON';
     67  STuesdayShort = 'TUE';
     68  SWednesdayShort = 'WED';
     69  SThrusdayShort = 'THU';
     70  SFridayShort = 'FRI';
     71  SSaturdayShort = 'SAT';
     72  SSundayShort = 'SUN';
     73
    6474{ TFormMain }
    6575
     
    177187  if Engine.RedrawPending then
    178188    PaintBox1.Repaint;
     189end;
     190
     191procedure TFormMain.Translator1Translate(Sender: TObject);
     192begin
     193  FormatSettings.ShortDayNames[1] := SSundayShort;
     194  FormatSettings.ShortDayNames[2] := SMondayShort;
     195  FormatSettings.ShortDayNames[3] := STuesdayShort;
     196  FormatSettings.ShortDayNames[4] := SWednesdayShort;
     197  FormatSettings.ShortDayNames[5] := SThrusdayShort;
     198  FormatSettings.ShortDayNames[6] := SFridayShort;
     199  FormatSettings.ShortDayNames[7] := SSaturdayShort;
    179200end;
    180201
  • trunk/Languages/BigMetro.cs.po

    r93 r94  
    8383msgstr "Tokyo"
    8484
     85#: uformmain.sfridayshort
     86msgid "FRI"
     87msgstr "Pá"
     88
     89#: uformmain.smondayshort
     90msgid "MON"
     91msgstr "Po"
     92
     93#: uformmain.ssaturdayshort
     94msgid "SAT"
     95msgstr "So"
     96
     97#: uformmain.ssundayshort
     98msgid "SUN"
     99msgstr "Ne"
     100
     101#: uformmain.sthrusdayshort
     102msgid "THU"
     103msgstr "Čt"
     104
     105#: uformmain.stuesdayshort
     106msgid "TUE"
     107msgstr "Út"
     108
     109#: uformmain.swednesdayshort
     110msgid "WED"
     111msgstr "St"
     112
    85113#: umenu.sautomatic
    86114msgid "Automatic"
  • trunk/Languages/BigMetro.de.po

    r93 r94  
    8383msgstr ""
    8484
     85#: uformmain.sfridayshort
     86msgid "FRI"
     87msgstr ""
     88
     89#: uformmain.smondayshort
     90msgid "MON"
     91msgstr ""
     92
     93#: uformmain.ssaturdayshort
     94msgid "SAT"
     95msgstr ""
     96
     97#: uformmain.ssundayshort
     98msgid "SUN"
     99msgstr ""
     100
     101#: uformmain.sthrusdayshort
     102msgid "THU"
     103msgstr ""
     104
     105#: uformmain.stuesdayshort
     106msgid "TUE"
     107msgstr ""
     108
     109#: uformmain.swednesdayshort
     110msgid "WED"
     111msgstr ""
     112
    85113#: umenu.sautomatic
    86114msgid "Automatic"
  • trunk/Languages/BigMetro.fr.po

    r93 r94  
    8383msgstr ""
    8484
     85#: uformmain.sfridayshort
     86msgid "FRI"
     87msgstr ""
     88
     89#: uformmain.smondayshort
     90msgid "MON"
     91msgstr ""
     92
     93#: uformmain.ssaturdayshort
     94msgid "SAT"
     95msgstr ""
     96
     97#: uformmain.ssundayshort
     98msgid "SUN"
     99msgstr ""
     100
     101#: uformmain.sthrusdayshort
     102msgid "THU"
     103msgstr ""
     104
     105#: uformmain.stuesdayshort
     106msgid "TUE"
     107msgstr ""
     108
     109#: uformmain.swednesdayshort
     110msgid "WED"
     111msgstr ""
     112
    85113#: umenu.sautomatic
    86114msgid "Automatic"
  • trunk/Languages/BigMetro.pot

    r93 r94  
    7171#: uengine.stokyo
    7272msgid "Tokyo"
     73msgstr ""
     74
     75#: uformmain.sfridayshort
     76msgid "FRI"
     77msgstr ""
     78
     79#: uformmain.smondayshort
     80msgid "MON"
     81msgstr ""
     82
     83#: uformmain.ssaturdayshort
     84msgid "SAT"
     85msgstr ""
     86
     87#: uformmain.ssundayshort
     88msgid "SUN"
     89msgstr ""
     90
     91#: uformmain.sthrusdayshort
     92msgid "THU"
     93msgstr ""
     94
     95#: uformmain.stuesdayshort
     96msgid "TUE"
     97msgstr ""
     98
     99#: uformmain.swednesdayshort
     100msgid "WED"
    73101msgstr ""
    74102
  • trunk/Packages/Common/UPixelPointer.pas

    r86 r94  
    310310end;
    311311
    312 
    313312end.
    314313
  • 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.