Changeset 66
- Timestamp:
- Nov 26, 2020, 11:00:03 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r64 r66 189 189 end else Translator1.Language := Translator1.Languages.SearchByCode(''); 190 190 Engine.DarkMode := ReadBoolWithDefault('DarkMode', False); 191 Engine.HighestServedPassengerCount := ReadIntegerWithDefault('HighestPassengers', 0); 192 Engine.HighestServedDaysCount := ReadIntegerWithDefault('HighestDays', 0); 191 193 finally 192 194 Free; … … 204 206 else DeleteValue('LanguageCode'); 205 207 WriteBool('DarkMode', Engine.DarkMode); 208 WriteInteger('HighestPassengers', Engine.HighestServedPassengerCount); 209 WriteInteger('HighestDays', Engine.HighestServedDaysCount); 206 210 finally 207 211 Free; -
trunk/Languages/BigMetro.cs.po
r64 r66 25 25 msgstr "Pokus o rozpojení již připojeného bodu trasy" 26 26 27 #: uengine.sday 28 msgid "Day" 29 msgstr "Den" 30 27 31 #: uengine.sgameover 28 32 msgid "Game Over" … … 36 40 msgid "%d passengers travelled on your metro over %d days." 37 41 msgstr "%d cestujících cestovalo ve vašem metru během %d dnů." 42 43 #: uengine.snewhighscore 44 msgid "New high score!" 45 msgstr "Nové vysoké skóre!" 46 47 #: uengine.soldhighscore 48 msgid "Old high score was %d passengers in %d days." 49 msgstr "Dřívější vysoké skóre bylo %d cestujících v %d dnech." 38 50 39 51 #: uengine.szerozoomnotalowed -
trunk/Languages/BigMetro.po
r64 r66 15 15 msgstr "" 16 16 17 #: uengine.sday 18 msgid "Day" 19 msgstr "" 20 17 21 #: uengine.sgameover 18 22 msgid "Game Over" … … 25 29 #: uengine.sgameoverstatistic 26 30 msgid "%d passengers travelled on your metro over %d days." 31 msgstr "" 32 33 #: uengine.snewhighscore 34 msgid "New high score!" 35 msgstr "" 36 37 #: uengine.soldhighscore 38 msgid "Old high score was %d passengers in %d days." 27 39 msgstr "" 28 40 -
trunk/UEngine.pas
r65 r66 2 2 3 3 {$mode delphi} 4 {$IFDEF DARWIN}{$modeswitch Objectivec1}{$ENDIF} 4 5 5 6 interface 6 7 7 8 uses 9 {$IFDEF Darwin}MacOSAll, CocoaAll, CocoaUtils,{$ENDIF} 8 10 Classes, SysUtils, Graphics, Controls, ExtCtrls, Math, DateUtils, 9 11 UMetaCanvas, fgl, UMenu; … … 28 30 Background: TColor; 29 31 Text: TColor; 32 ShapeBackground: TColor; 30 33 MenuItemText: TColor; 31 34 MenuItemBackground: TColor; … … 290 293 MenuGame: TMenu; 291 294 ButtonBack: TMenuItemButton; 295 function GetServedDaysCount: Integer; 292 296 procedure ResizeView; 293 297 function GetExistStationShapes: TStationShapeSet; … … 338 342 ImagePassenger: TImage; 339 343 ImageLocomotive: TImage; 344 HighestServedPassengerCount: Integer; 345 HighestServedDaysCount: Integer; 340 346 procedure InitMenus; 341 347 procedure MouseMove(Position: TPoint); … … 353 359 property Time: TDateTime read FTime; 354 360 property DarkMode: Boolean read FDarkMode write SetDarkMode; 361 property ServedDaysCount: Integer read GetServedDaysCount; 355 362 end; 356 363 … … 400 407 SGameOverReason = 'Overcrowding at this station has forced you to resign as metro manager.'; 401 408 SGameOverStatistic = '%d passengers travelled on your metro over %d days.'; 409 SDay = 'Day'; 410 SNewHighScore = 'New high score!'; 411 SOldHighScore = 'Old high score was %d passengers in %d days.'; 402 412 403 413 { TTrackLinks } … … 1356 1366 View.SourceRect := Bounds(NewPoint.X, NewPoint.Y, Trunc((View.DestRect.Right - View.DestRect.Left) / View.Zoom), 1357 1367 Trunc((View.DestRect.Bottom - View.DestRect.Top) / View.Zoom)); 1368 end; 1369 1370 function TEngine.GetServedDaysCount: Integer; 1371 begin 1372 Result := Trunc(Time); 1358 1373 end; 1359 1374 … … 1655 1670 Background := $2f3020; 1656 1671 Text := clWhite; 1672 ShapeBackground := clBlack; 1657 1673 MenuItemText := $cccccc; 1658 1674 MenuItemBackground := $b75C01; … … 1661 1677 Background := $eff0e0; 1662 1678 Text := clBlack; 1679 ShapeBackground := clWhite; 1663 1680 MenuItemText := clWhite; 1664 1681 MenuItemBackground := $e78C31; … … 2067 2084 Angle: Double; 2068 2085 Text: string; 2086 Text2: string; 2069 2087 I: Integer; 2070 2088 const … … 2079 2097 Canvas.Line(ClockCenter, Point(ClockCenter.X + Round(Cos(Angle) * ClockSize * 0.8), 2080 2098 ClockCenter.Y + Round(Sin(Angle) * ClockSize * 0.8))); 2081 Text := FormatDateTime('ddd', Time);2082 Canvas.TextOut(ClockCenter.X - ClockSize - Canvas.TextWidth(Text) - 5, ClockCenter.Y -2083 Canvas.TextWidth(Text) div 2, Text);2084 2099 for I := 0 to 12 do begin 2085 2100 Angle := I / 12 * 2 * Pi; … … 2089 2104 ClockCenter.Y + Round(Sin(Angle) * ClockSize * 0.9)); 2090 2105 end; 2106 2107 Canvas.Font.Color := Colors.Text; 2108 Text := FormatDateTime('ddd', Time + 2); 2109 Canvas.TextOut(ClockCenter.X - ClockSize - Canvas.TextWidth(Text) - 10, ClockCenter.Y - 2110 Canvas.TextHeight(Text) div 2, Text); 2111 2112 Text2 := SDay + ' ' + IntToStr(Trunc(Time)); 2113 Canvas.TextOut(ClockCenter.X - ClockSize - Canvas.TextWidth(Text) - 10, ClockCenter.Y - 2114 Canvas.TextHeight(Text2) div 2 + Trunc(Canvas.TextHeight(Text) * 1.1), Text2); 2091 2115 end; 2092 2116 … … 2140 2164 Font.Size := 40; 2141 2165 TextOut((Width - TextWidth(SGameOver)) div 2, Y, SGameOver); 2142 2143 2166 Y := Y + Round(TextHeight(SGameOver) * 1.1); 2167 2144 2168 Font.Size := 14; 2145 2169 TextOut((Width - TextWidth(SGameOverReason)) div 2, Y, SGameOverReason); 2146 2147 2170 Y := Y + Round(TextHeight(SGameOverReason) * 1.1); 2148 Text := Format(SGameOverStatistic, [ServedPassengerCount, Trunc(Time)]); 2171 2172 Text := Format(SGameOverStatistic, [ServedPassengerCount, ServedDaysCount]); 2149 2173 TextOut((Width - TextWidth(Text)) div 2, Y, Text); 2174 Y := Y + Round(TextHeight(SGameOverStatistic) * 1.1); 2175 2176 Y := Y + 16; 2177 2178 // Calculate new highest score 2179 Text := ''; 2180 if (ServedPassengerCount > HighestServedPassengerCount) or 2181 (ServedDaysCount > HighestServedDaysCount) then begin 2182 Text := SNewHighScore + ' '; 2183 end; 2184 Text := Text + Format(SOldHighScore, [HighestServedPassengerCount, 2185 HighestServedDaysCount]); 2186 Canvas.TextOut((Canvas.Width - Canvas.TextWidth(Text)) div 2, Y, Text); 2187 Y := Y + Round(TextHeight(Text) * 1.1); 2188 if (ServedPassengerCount > HighestServedPassengerCount) then 2189 HighestServedPassengerCount := ServedPassengerCount; 2190 if (ServedDaysCount > HighestServedDaysCount) then 2191 HighestServedDaysCount := ServedDaysCount; 2150 2192 end; 2151 2193 end; … … 2429 2471 const 2430 2472 KeyEsc = 27; 2473 KeyF2 = 113; 2431 2474 begin 2432 2475 if Key = KeyEsc then begin … … 2438 2481 end; 2439 2482 end; 2483 {$IFDEF DEBUG} 2484 if Key = KeyF2 then begin 2485 State := gsGameOver; 2486 Redraw; 2487 end; 2488 {$ENDIF} 2440 2489 end; 2441 2490 … … 2669 2718 end; 2670 2719 2671 Canvas.Brush.Color := clWhite;2720 Canvas.Brush.Color := Colors.ShapeBackground; 2672 2721 Canvas.Brush.Style := bsSolid; 2673 Canvas.Pen.Color := clBlack;2722 Canvas.Pen.Color := Colors.Text; 2674 2723 DrawShape(Canvas, Position, Shape, StationSize, 0); 2675 2724 2676 2725 // Draw passengers 2677 2726 Canvas.Pen.Style := psClear; 2678 Canvas.Brush.Color := clBlack;2727 Canvas.Brush.Color := Colors.Text; 2679 2728 PassengerPos := Point(0, 0); 2680 2729 Direction := 1;
Note:
See TracChangeset
for help on using the changeset viewer.