Changeset 134


Ignore:
Timestamp:
May 2, 2023, 11:48:43 AM (20 months ago)
Author:
chronos
Message:
  • Fixed: Translation of week days.
  • Fixed: Highest score changed after click at game over screen.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r133 r134  
    3535    procedure PaintBox1Resize(Sender: TObject);
    3636    procedure Timer1Timer(Sender: TObject);
    37     procedure Translator1Translate(Sender: TObject);
    3837  private
    3938    Initialized: Boolean;
     
    6059uses
    6160  UFormImages, UPixelPointer, UCore, UFormTest, UTestCases;
    62 
    63 resourcestring
    64   SMondayShort = 'MON';
    65   STuesdayShort = 'TUE';
    66   SWednesdayShort = 'WED';
    67   SThrusdayShort = 'THU';
    68   SFridayShort = 'FRI';
    69   SSaturdayShort = 'SAT';
    70   SSundayShort = 'SUN';
    7161
    7262{ TFormMain }
     
    205195  if Engine.RedrawPending then
    206196    PaintBox1.Repaint;
    207 end;
    208 
    209 procedure TFormMain.Translator1Translate(Sender: TObject);
    210 begin
    211   FormatSettings.ShortDayNames[1] := SSundayShort;
    212   FormatSettings.ShortDayNames[2] := SMondayShort;
    213   FormatSettings.ShortDayNames[3] := STuesdayShort;
    214   FormatSettings.ShortDayNames[4] := SWednesdayShort;
    215   FormatSettings.ShortDayNames[5] := SThrusdayShort;
    216   FormatSettings.ShortDayNames[6] := SFridayShort;
    217   FormatSettings.ShortDayNames[7] := SSaturdayShort;
    218197end;
    219198
  • trunk/Languages/TransLines.cs.po

    r133 r134  
    5959msgstr "Testový případ"
    6060
     61#: ucore.sfridayshort
     62msgctxt "ucore.sfridayshort"
     63msgid "FRI"
     64msgstr "Pá"
     65
     66#: ucore.smondayshort
     67msgctxt "ucore.smondayshort"
     68msgid "MON"
     69msgstr "Po"
     70
     71#: ucore.ssaturdayshort
     72msgctxt "ucore.ssaturdayshort"
     73msgid "SAT"
     74msgstr "So"
     75
     76#: ucore.ssundayshort
     77msgctxt "ucore.ssundayshort"
     78msgid "SUN"
     79msgstr "Ne"
     80
     81#: ucore.sthrusdayshort
     82msgctxt "ucore.sthrusdayshort"
     83msgid "THU"
     84msgstr "Čt"
     85
     86#: ucore.stuesdayshort
     87msgctxt "ucore.stuesdayshort"
     88msgid "TUE"
     89msgstr "Út"
     90
     91#: ucore.swednesdayshort
     92msgctxt "ucore.swednesdayshort"
     93msgid "WED"
     94msgstr "St"
     95
    6196#: uengine.salpha
    6297msgid "Alpha"
     
    70105#: uengine.sautosave
    71106msgid "Auto save"
    72 msgstr "Automaticky uložené"
     107msgstr "Samo uložené"
    73108
    74109#: uengine.sback
     
    300335
    301336#: uformmain.sfridayshort
     337msgctxt "uformmain.sfridayshort"
    302338msgid "FRI"
    303339msgstr "Pá"
    304340
    305341#: uformmain.smondayshort
     342msgctxt "uformmain.smondayshort"
    306343msgid "MON"
    307344msgstr "Po"
    308345
    309346#: uformmain.ssaturdayshort
     347msgctxt "uformmain.ssaturdayshort"
    310348msgid "SAT"
    311349msgstr "So"
    312350
    313351#: uformmain.ssundayshort
     352msgctxt "uformmain.ssundayshort"
    314353msgid "SUN"
    315354msgstr "Ne"
    316355
    317356#: uformmain.sthrusdayshort
     357msgctxt "uformmain.sthrusdayshort"
    318358msgid "THU"
    319359msgstr "Čt"
    320360
    321361#: uformmain.stuesdayshort
     362msgctxt "uformmain.stuesdayshort"
    322363msgid "TUE"
    323364msgstr "Út"
    324365
    325366#: uformmain.swednesdayshort
     367msgctxt "uformmain.swednesdayshort"
    326368msgid "WED"
    327369msgstr "St"
  • trunk/Languages/TransLines.de.po

    r133 r134  
    6161msgstr ""
    6262
     63#: ucore.sfridayshort
     64msgctxt "ucore.sfridayshort"
     65msgid "FRI"
     66msgstr ""
     67
     68#: ucore.smondayshort
     69msgctxt "ucore.smondayshort"
     70msgid "MON"
     71msgstr ""
     72
     73#: ucore.ssaturdayshort
     74msgctxt "ucore.ssaturdayshort"
     75msgid "SAT"
     76msgstr ""
     77
     78#: ucore.ssundayshort
     79msgctxt "ucore.ssundayshort"
     80msgid "SUN"
     81msgstr ""
     82
     83#: ucore.sthrusdayshort
     84msgctxt "ucore.sthrusdayshort"
     85msgid "THU"
     86msgstr ""
     87
     88#: ucore.stuesdayshort
     89msgctxt "ucore.stuesdayshort"
     90msgid "TUE"
     91msgstr ""
     92
     93#: ucore.swednesdayshort
     94msgctxt "ucore.swednesdayshort"
     95msgid "WED"
     96msgstr ""
     97
    6398#: uengine.salpha
    6499msgid "Alpha"
     
    304339
    305340#: uformmain.sfridayshort
     341msgctxt "uformmain.sfridayshort"
    306342msgid "FRI"
    307343msgstr ""
    308344
    309345#: uformmain.smondayshort
     346msgctxt "uformmain.smondayshort"
    310347msgid "MON"
    311348msgstr ""
    312349
    313350#: uformmain.ssaturdayshort
     351msgctxt "uformmain.ssaturdayshort"
    314352msgid "SAT"
    315353msgstr ""
    316354
    317355#: uformmain.ssundayshort
     356msgctxt "uformmain.ssundayshort"
    318357msgid "SUN"
    319358msgstr ""
    320359
    321360#: uformmain.sthrusdayshort
     361msgctxt "uformmain.sthrusdayshort"
    322362msgid "THU"
    323363msgstr ""
    324364
    325365#: uformmain.stuesdayshort
     366msgctxt "uformmain.stuesdayshort"
    326367msgid "TUE"
    327368msgstr ""
    328369
    329370#: uformmain.swednesdayshort
     371msgctxt "uformmain.swednesdayshort"
    330372msgid "WED"
    331373msgstr ""
  • trunk/Languages/TransLines.fr.po

    r133 r134  
    6262msgstr "Cas de test"
    6363
     64#: ucore.sfridayshort
     65#, fuzzy
     66msgctxt "ucore.sfridayshort"
     67msgid "FRI"
     68msgstr "VEN"
     69
     70#: ucore.smondayshort
     71#, fuzzy
     72msgctxt "ucore.smondayshort"
     73msgid "MON"
     74msgstr "LUN"
     75
     76#: ucore.ssaturdayshort
     77#, fuzzy
     78msgctxt "ucore.ssaturdayshort"
     79msgid "SAT"
     80msgstr "SAM"
     81
     82#: ucore.ssundayshort
     83#, fuzzy
     84msgctxt "ucore.ssundayshort"
     85msgid "SUN"
     86msgstr "DIM"
     87
     88#: ucore.sthrusdayshort
     89#, fuzzy
     90msgctxt "ucore.sthrusdayshort"
     91msgid "THU"
     92msgstr "JEU"
     93
     94#: ucore.stuesdayshort
     95#, fuzzy
     96msgctxt "ucore.stuesdayshort"
     97msgid "TUE"
     98msgstr "MAR"
     99
     100#: ucore.swednesdayshort
     101#, fuzzy
     102msgctxt "ucore.swednesdayshort"
     103msgid "WED"
     104msgstr "MER"
     105
    64106#: uengine.salpha
    65107msgid "Alpha"
     
    305347
    306348#: uformmain.sfridayshort
     349msgctxt "uformmain.sfridayshort"
    307350msgid "FRI"
    308351msgstr "VEN"
    309352
    310353#: uformmain.smondayshort
     354msgctxt "uformmain.smondayshort"
    311355msgid "MON"
    312356msgstr "LUN"
    313357
    314358#: uformmain.ssaturdayshort
     359msgctxt "uformmain.ssaturdayshort"
    315360msgid "SAT"
    316361msgstr "SAM"
    317362
    318363#: uformmain.ssundayshort
     364msgctxt "uformmain.ssundayshort"
    319365msgid "SUN"
    320366msgstr "DIM"
    321367
    322368#: uformmain.sthrusdayshort
     369msgctxt "uformmain.sthrusdayshort"
    323370msgid "THU"
    324371msgstr "JEU"
    325372
    326373#: uformmain.stuesdayshort
     374msgctxt "uformmain.stuesdayshort"
    327375msgid "TUE"
    328376msgstr "MAR"
    329377
    330378#: uformmain.swednesdayshort
     379msgctxt "uformmain.swednesdayshort"
    331380msgid "WED"
    332381msgstr "MER"
  • trunk/Languages/TransLines.pot

    r133 r134  
    4949msgstr ""
    5050
     51#: ucore.sfridayshort
     52msgctxt "ucore.sfridayshort"
     53msgid "FRI"
     54msgstr ""
     55
     56#: ucore.smondayshort
     57msgctxt "ucore.smondayshort"
     58msgid "MON"
     59msgstr ""
     60
     61#: ucore.ssaturdayshort
     62msgctxt "ucore.ssaturdayshort"
     63msgid "SAT"
     64msgstr ""
     65
     66#: ucore.ssundayshort
     67msgctxt "ucore.ssundayshort"
     68msgid "SUN"
     69msgstr ""
     70
     71#: ucore.sthrusdayshort
     72msgctxt "ucore.sthrusdayshort"
     73msgid "THU"
     74msgstr ""
     75
     76#: ucore.stuesdayshort
     77msgctxt "ucore.stuesdayshort"
     78msgid "TUE"
     79msgstr ""
     80
     81#: ucore.swednesdayshort
     82msgctxt "ucore.swednesdayshort"
     83msgid "WED"
     84msgstr ""
     85
    5186#: uengine.salpha
    5287msgid "Alpha"
     
    290325
    291326#: uformmain.sfridayshort
     327msgctxt "uformmain.sfridayshort"
    292328msgid "FRI"
    293329msgstr ""
    294330
    295331#: uformmain.smondayshort
     332msgctxt "uformmain.smondayshort"
    296333msgid "MON"
    297334msgstr ""
    298335
    299336#: uformmain.ssaturdayshort
     337msgctxt "uformmain.ssaturdayshort"
    300338msgid "SAT"
    301339msgstr ""
    302340
    303341#: uformmain.ssundayshort
     342msgctxt "uformmain.ssundayshort"
    304343msgid "SUN"
    305344msgstr ""
    306345
    307346#: uformmain.sthrusdayshort
     347msgctxt "uformmain.sthrusdayshort"
    308348msgid "THU"
    309349msgstr ""
    310350
    311351#: uformmain.stuesdayshort
     352msgctxt "uformmain.stuesdayshort"
    312353msgid "TUE"
    313354msgstr ""
    314355
    315356#: uformmain.swednesdayshort
     357msgctxt "uformmain.swednesdayshort"
    316358msgid "WED"
    317359msgstr ""
  • trunk/UCore.lfm

    r118 r134  
    11object Core: TCore
    22  OldCreateOrder = False
    3   Height = 486
    4   HorizontalOffset = 579
    5   VerticalOffset = 460
    6   Width = 619
     3  Height = 729
     4  HorizontalOffset = 869
     5  VerticalOffset = 653
     6  Width = 929
     7  PPI = 144
    78  object PersistentForm1: TPersistentForm
    89    MinVisiblePart = 50
    910    EntireVisible = False
    10     Left = 232
    11     Top = 136
     11    Left = 348
     12    Top = 204
    1213  end
    1314  object Translator1: TTranslator
    1415    POFilesFolder = 'Languages'
    15     Left = 232
    16     Top = 216
     16    OnTranslate = Translator1Translate
     17    Left = 348
     18    Top = 324
    1719  end
    1820  object ThemeManager1: TThemeManager
    19     Left = 232
    20     Top = 296
     21    Left = 348
     22    Top = 444
    2123  end
    2224end
  • trunk/UCore.pas

    r118 r134  
    1414    ThemeManager1: TThemeManager;
    1515    Translator1: TTranslator;
     16    procedure Translator1Translate(Sender: TObject);
    1617  end;
    1718
     
    2425{$R *.lfm}
    2526
     27resourcestring
     28  SMondayShort = 'MON';
     29  STuesdayShort = 'TUE';
     30  SWednesdayShort = 'WED';
     31  SThrusdayShort = 'THU';
     32  SFridayShort = 'FRI';
     33  SSaturdayShort = 'SAT';
     34  SSundayShort = 'SUN';
     35
     36{ TCore }
     37
     38procedure TCore.Translator1Translate(Sender: TObject);
     39begin
     40  FormatSettings.ShortDayNames[1] := SSundayShort;
     41  FormatSettings.ShortDayNames[2] := SMondayShort;
     42  FormatSettings.ShortDayNames[3] := STuesdayShort;
     43  FormatSettings.ShortDayNames[4] := SWednesdayShort;
     44  FormatSettings.ShortDayNames[5] := SThrusdayShort;
     45  FormatSettings.ShortDayNames[6] := SFridayShort;
     46  FormatSettings.ShortDayNames[7] := SSaturdayShort;
     47end;
     48
    2649end.
    2750
  • trunk/UEngine.pas

    r133 r134  
    312312    function GetGameSlotFileName(Index: Integer): string;
    313313    procedure AutoSave;
     314    procedure CheckScore;
    314315  public
    315316    // Test
     
    357358    HighestServedPassengerCount: Integer;
    358359    HighestServedDaysCount: Integer;
     360    OldHighestServedPassengerCount: Integer;
     361    OldHighestServedDaysCount: Integer;
    359362    RegistryContext: TRegistryContext;
    360363    procedure InitMenus;
     
    25212524end;
    25222525
     2526procedure TEngine.CheckScore;
     2527begin
     2528  OldHighestServedDaysCount := HighestServedDaysCount;
     2529  OldHighestServedPassengerCount := HighestServedPassengerCount;
     2530
     2531  if (ServedPassengerCount > HighestServedPassengerCount) then begin
     2532    HighestServedPassengerCount := ServedPassengerCount;
     2533    HighestServedDaysCount := ServedDaysCount;
     2534  end;
     2535
     2536  if Assigned(City) then begin
     2537    if (ServedPassengerCount > City.HighestServedPassengerCount) then begin
     2538      City.HighestServedPassengerCount := ServedPassengerCount;
     2539      City.HighestServedDaysCount := ServedDaysCount;
     2540    end;
     2541  end;
     2542end;
     2543
    25232544function TEngine.DestinationIndexToText(DestinationIndex: TDestinationIndex): string;
    25242545begin
     
    28702891begin
    28712892  with Canvas do begin
    2872     // Calculate new highest score
    28732893    Text := '';
    2874     if (ServedPassengerCount > HighestServedPassengerCount) or
    2875       (ServedDaysCount > HighestServedDaysCount) then begin
     2894    if (ServedPassengerCount >= HighestServedPassengerCount) or
     2895      (ServedDaysCount >= HighestServedDaysCount) then begin
    28762896      Text := SNewHighScore + ' ';
    28772897    end;
    2878     Text := Text + Format(SOldHighScore, [HighestServedPassengerCount,
    2879       HighestServedDaysCount]);
     2898    Text := Text + Format(SOldHighScore, [OldHighestServedPassengerCount,
     2899      OldHighestServedDaysCount]);
    28802900    Canvas.TextOut((CanvasSize.X - TextWidth(Text)) div 2, Y, Text);
    28812901    Y := Y + Round(TextHeight(Text) * 1.1);
    2882     if (ServedPassengerCount > HighestServedPassengerCount) then
    2883       HighestServedPassengerCount := ServedPassengerCount;
    2884     if (ServedDaysCount > HighestServedDaysCount) then
    2885       HighestServedDaysCount := ServedDaysCount;
    2886 
    2887     if Assigned(City) then begin
    2888       if (ServedPassengerCount > City.HighestServedPassengerCount) then
    2889         City.HighestServedPassengerCount := ServedPassengerCount;
    2890       if (ServedDaysCount > City.HighestServedDaysCount) then
    2891         City.HighestServedDaysCount := ServedDaysCount;
    2892     end;
    28932902  end;
    28942903end;
     
    35583567      if OverloadDuration >= MaxPassengersOveloadTime then begin
    35593568        State := gsGameOver;
     3569        CheckScore;
    35603570        Redraw;
    35613571      end;
     
    35643574    if Assigned(City) and (ServedPassengerCount >= City.PassengersCountToUnlock) then begin
    35653575      State := gsSuccess;
     3576      CheckScore;
    35663577      Redraw;
    35673578    end;
     
    38603871  KeyF7 = 118;
    38613872  KeyF8 = 119;
     3873  KeyF9 = 120;
    38623874{$ENDIF}
    38633875  KeyT = 84;
     
    38983910    if Key = KeyF2 then begin
    38993911      State := gsGameOver;
     3912      CheckScore;
    39003913      Redraw;
    39013914    end;
     
    39193932    if Key = KeyF7 then begin
    39203933      State := gsSuccess;
     3934      CheckScore;
    39213935      Redraw;
    39223936    end else
    39233937    if Key = KeyF8 then begin
    39243938      Inc(AvailableTerminals);
     3939      Redraw;
     3940    end else
     3941    if Key = KeyF9 then begin
     3942      Inc(ServedPassengerCount, 100);
    39253943      Redraw;
    39263944    end;
     
    40594077  LastNewPassengerTime := ReadDateTime(Node, 'LastNewPassengerTime', LastNewPassengerTime);
    40604078  LastNewStationTime := ReadDateTime(Node, 'LastNewStationTime', LastNewStationTime);
     4079  TerminalCountVisible := ReadBoolean(Node, 'TerminalCountVisible', TerminalCountVisible);
     4080  CarriageCountVisible := ReadBoolean(Node, 'CarriageCountVisible', CarriageCountVisible);
    40614081
    40624082  NewNode := Node.FindNode(DOMString(TView.GetClassSysName));
     
    41324152  WriteDateTime(Node, 'LastNewPassengerTime', LastNewPassengerTime);
    41334153  WriteDateTime(Node, 'LastNewStationTime', LastNewStationTime);
     4154  WriteBoolean(Node, 'TerminalCountVisible', TerminalCountVisible);
     4155  WriteBoolean(Node, 'CarriageCountVisible', CarriageCountVisible);
    41344156
    41354157  NewNode := Node.OwnerDocument.CreateElement(DOMString(TView.GetClassSysName));
Note: See TracChangeset for help on using the changeset viewer.