Changeset 95
- Timestamp:
- Sep 28, 2022, 12:23:17 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r94 r95 244 244 CopyImage(Engine.ImageLocomotive.Bitmap, FormImages.ImageLocomotive.Picture.Bitmap); 245 245 CopyImage(Engine.ImageLocomotive.BitmapDisabled, FormImages.ImageLocomotive.Picture.Bitmap, True); 246 CopyImage(Engine.ImageNewTrain.Bitmap, FormImages.ImageLocomotive.Picture.Bitmap); 247 CopyImage(Engine.ImageNewTrain.BitmapDisabled, FormImages.ImageLocomotive.Picture.Bitmap, True); 246 248 CopyImage(Engine.ImageCarriage.Bitmap, FormImages.ImageCarriage.Picture.Bitmap); 247 249 CopyImage(Engine.ImageCarriage.BitmapDisabled, FormImages.ImageCarriage.Picture.Bitmap, True); … … 259 261 BitmapInvert(Engine.ImageLocomotive.Bitmap); 260 262 BitmapInvert(Engine.ImageLocomotive.BitmapDisabled); 263 BitmapInvert(Engine.ImageNewTrain.Bitmap); 264 BitmapInvert(Engine.ImageNewTrain.BitmapDisabled); 261 265 BitmapInvert(Engine.ImageCarriage.Bitmap); 262 266 BitmapInvert(Engine.ImageCarriage.BitmapDisabled); -
trunk/Languages/BigMetro.cs.po
r94 r95 25 25 msgstr "Big Metro" 26 26 27 #: uengine.sautomatic 28 msgctxt "uengine.sautomatic" 29 msgid "Automatic" 30 msgstr "Automaticky" 31 32 #: uengine.sback 33 msgctxt "uengine.sback" 34 msgid "Back" 35 msgstr "Zpět" 36 37 #: uengine.sbigmetro 38 msgctxt "uengine.sbigmetro" 39 msgid "Big Metro" 40 msgstr "Big Metro" 41 42 #: uengine.scontinue 43 msgctxt "uengine.scontinue" 44 msgid "Continue" 45 msgstr "Pokračovat" 46 47 #: uengine.sczech 48 msgctxt "uengine.sczech" 49 msgid "Czech" 50 msgstr "Čeština" 51 52 #: uengine.sdarkmode 53 msgctxt "uengine.sdarkmode" 54 msgid "Dark mode" 55 msgstr "Temný režim" 56 27 57 #: uengine.sday 28 58 msgid "Day" 29 59 msgstr "Den" 60 61 #: uengine.senglish 62 msgctxt "uengine.senglish" 63 msgid "English" 64 msgstr "Angličtina" 65 66 #: uengine.sexit 67 msgctxt "uengine.sexit" 68 msgid "Exit" 69 msgstr "Odejít" 70 71 #: uengine.sfullscreen 72 msgctxt "uengine.sfullscreen" 73 msgid "Full screen" 74 msgstr "Celá obrazovka" 30 75 31 76 #: uengine.sgameover … … 42 87 msgstr "%d cestujících cestovalo ve vašem metru během %d dnů." 43 88 89 #: uengine.slanguage 90 msgctxt "uengine.slanguage" 91 msgid "Language" 92 msgstr "Jazyk" 93 44 94 #: uengine.slondon 45 95 msgid "London" … … 49 99 msgid "New high score!" 50 100 msgstr "Nové vysoké skóre!" 101 102 #: uengine.snewtrain 103 msgid "You get a new train for your metro" 104 msgstr "Získáváš nový vlak pro tvé metro" 51 105 52 106 #: uengine.snewyork … … 63 117 msgstr "Dřívější vysoké skóre bylo %d cestujících v %d dnech." 64 118 119 #: uengine.soptions 120 msgctxt "uengine.soptions" 121 msgid "Options" 122 msgstr "Volby" 123 65 124 #: uengine.sparis 66 125 msgid "Paris" 67 126 msgstr "Paříž" 68 127 128 #: uengine.splay 129 msgctxt "uengine.splay" 130 msgid "Play" 131 msgstr "Hrát" 132 69 133 #: uengine.sprague 70 134 msgid "Prague" 71 135 msgstr "Praha" 72 136 137 #: uengine.srestart 138 msgctxt "uengine.srestart" 139 msgid "Try again" 140 msgstr "Zkusit znovu" 141 73 142 #: uengine.sstationnotdefined 74 143 msgid "Station have to be defined" … … 83 152 msgstr "Tokyo" 84 153 154 #: uengine.strain 155 msgid "Train" 156 msgstr "Vlak" 157 158 #: uengine.sweek 159 msgid "week" 160 msgstr "týden" 161 85 162 #: uformmain.sfridayshort 86 163 msgid "FRI" … … 112 189 113 190 #: umenu.sautomatic 191 msgctxt "umenu.sautomatic" 114 192 msgid "Automatic" 115 193 msgstr "Automaticky" 116 194 117 195 #: umenu.sback 196 msgctxt "umenu.sback" 118 197 msgid "Back" 119 198 msgstr "Zpět" … … 125 204 126 205 #: umenu.scontinue 206 msgctxt "umenu.scontinue" 127 207 msgid "Continue" 128 208 msgstr "Pokračovat" 129 209 130 210 #: umenu.sczech 211 msgctxt "umenu.sczech" 131 212 msgid "Czech" 132 213 msgstr "Čeština" 133 214 134 215 #: umenu.sdarkmode 216 msgctxt "umenu.sdarkmode" 135 217 msgid "Dark mode" 136 218 msgstr "Temný režim" 137 219 138 220 #: umenu.senglish 221 msgctxt "umenu.senglish" 139 222 msgid "English" 140 223 msgstr "Angličtina" … … 146 229 147 230 #: umenu.sfullscreen 231 msgctxt "umenu.sfullscreen" 148 232 msgid "Full screen" 149 233 msgstr "Celá obrazovka" 150 234 151 235 #: umenu.slanguage 236 msgctxt "umenu.slanguage" 152 237 msgid "Language" 153 238 msgstr "Jazyk" … … 164 249 165 250 #: umenu.srestart 251 msgctxt "umenu.srestart" 166 252 msgid "Try again" 167 253 msgstr "Zkusit znovu" -
trunk/Languages/BigMetro.de.po
r94 r95 25 25 msgstr "Big Metro" 26 26 27 #: uengine.sautomatic 28 #, fuzzy 29 msgctxt "uengine.sautomatic" 30 msgid "Automatic" 31 msgstr "Automatisch" 32 33 #: uengine.sback 34 #, fuzzy 35 msgctxt "uengine.sback" 36 msgid "Back" 37 msgstr "Zurück" 38 39 #: uengine.sbigmetro 40 #, fuzzy 41 msgctxt "uengine.sbigmetro" 42 msgid "Big Metro" 43 msgstr "Big Metro" 44 45 #: uengine.scontinue 46 #, fuzzy 47 msgctxt "uengine.scontinue" 48 msgid "Continue" 49 msgstr "Fortsetzen" 50 51 #: uengine.sczech 52 #, fuzzy 53 msgctxt "uengine.sczech" 54 msgid "Czech" 55 msgstr "Tschechisch" 56 57 #: uengine.sdarkmode 58 #, fuzzy 59 msgctxt "uengine.sdarkmode" 60 msgid "Dark mode" 61 msgstr "Darm mode" 62 27 63 #: uengine.sday 28 64 msgid "Day" 29 65 msgstr "Tag" 66 67 #: uengine.senglish 68 #, fuzzy 69 msgctxt "uengine.senglish" 70 msgid "English" 71 msgstr "Englisch" 72 73 #: uengine.sexit 74 #, fuzzy 75 msgctxt "uengine.sexit" 76 msgid "Exit" 77 msgstr "Beenden" 78 79 #: uengine.sfullscreen 80 #, fuzzy 81 msgctxt "uengine.sfullscreen" 82 msgid "Full screen" 83 msgstr "Vollbild" 30 84 31 85 #: uengine.sgameover … … 42 96 msgstr "%d Passagiere fuhren mit deiner Metro über %d Tage." 43 97 98 #: uengine.slanguage 99 #, fuzzy 100 msgctxt "uengine.slanguage" 101 msgid "Language" 102 msgstr "Sprache" 103 44 104 #: uengine.slondon 45 105 msgid "London" … … 49 109 msgid "New high score!" 50 110 msgstr "Neuer Highscore!" 111 112 #: uengine.snewtrain 113 msgid "You get a new train for your metro" 114 msgstr "" 51 115 52 116 #: uengine.snewyork … … 63 127 msgstr "Der alte Highscore war %d passager in %d Tagen." 64 128 129 #: uengine.soptions 130 #, fuzzy 131 msgctxt "uengine.soptions" 132 msgid "Options" 133 msgstr "Optionen" 134 65 135 #: uengine.sparis 66 136 msgid "Paris" 67 137 msgstr "" 68 138 139 #: uengine.splay 140 #, fuzzy 141 msgctxt "uengine.splay" 142 msgid "Play" 143 msgstr "Play" 144 69 145 #: uengine.sprague 70 146 msgid "Prague" 71 147 msgstr "" 72 148 149 #: uengine.srestart 150 #, fuzzy 151 msgctxt "uengine.srestart" 152 msgid "Try again" 153 msgstr "Neustart" 154 73 155 #: uengine.sstationnotdefined 74 156 msgid "Station have to be defined" … … 83 165 msgstr "" 84 166 167 #: uengine.strain 168 msgid "Train" 169 msgstr "" 170 171 #: uengine.sweek 172 msgid "week" 173 msgstr "" 174 85 175 #: uformmain.sfridayshort 86 176 msgid "FRI" … … 112 202 113 203 #: umenu.sautomatic 204 msgctxt "umenu.sautomatic" 114 205 msgid "Automatic" 115 206 msgstr "Automatisch" 116 207 117 208 #: umenu.sback 209 msgctxt "umenu.sback" 118 210 msgid "Back" 119 211 msgstr "Zurück" … … 125 217 126 218 #: umenu.scontinue 219 msgctxt "umenu.scontinue" 127 220 msgid "Continue" 128 221 msgstr "Fortsetzen" 129 222 130 223 #: umenu.sczech 224 msgctxt "umenu.sczech" 131 225 msgid "Czech" 132 226 msgstr "Tschechisch" 133 227 134 228 #: umenu.sdarkmode 229 msgctxt "umenu.sdarkmode" 135 230 msgid "Dark mode" 136 231 msgstr "Darm mode" 137 232 138 233 #: umenu.senglish 234 msgctxt "umenu.senglish" 139 235 msgid "English" 140 236 msgstr "Englisch" … … 146 242 147 243 #: umenu.sfullscreen 244 msgctxt "umenu.sfullscreen" 148 245 msgid "Full screen" 149 246 msgstr "Vollbild" 150 247 151 248 #: umenu.slanguage 249 msgctxt "umenu.slanguage" 152 250 msgid "Language" 153 251 msgstr "Sprache" … … 164 262 165 263 #: umenu.srestart 264 msgctxt "umenu.srestart" 166 265 msgid "Try again" 167 266 msgstr "Neustart" -
trunk/Languages/BigMetro.fr.po
r94 r95 25 25 msgstr "Big Metro" 26 26 27 #: uengine.sautomatic 28 #, fuzzy 29 msgctxt "uengine.sautomatic" 30 msgid "Automatic" 31 msgstr "Automatique" 32 33 #: uengine.sback 34 #, fuzzy 35 msgctxt "uengine.sback" 36 msgid "Back" 37 msgstr "Retour" 38 39 #: uengine.sbigmetro 40 #, fuzzy 41 msgctxt "uengine.sbigmetro" 42 msgid "Big Metro" 43 msgstr "Big Metro" 44 45 #: uengine.scontinue 46 #, fuzzy 47 msgctxt "uengine.scontinue" 48 msgid "Continue" 49 msgstr "Continuer" 50 51 #: uengine.sczech 52 #, fuzzy 53 msgctxt "uengine.sczech" 54 msgid "Czech" 55 msgstr "Tchèque" 56 57 #: uengine.sdarkmode 58 #, fuzzy 59 msgctxt "uengine.sdarkmode" 60 msgid "Dark mode" 61 msgstr "Mode sombre" 62 27 63 #: uengine.sday 28 64 msgid "Day" 29 65 msgstr "Jour" 66 67 #: uengine.senglish 68 #, fuzzy 69 msgctxt "uengine.senglish" 70 msgid "English" 71 msgstr "Anglais" 72 73 #: uengine.sexit 74 #, fuzzy 75 msgctxt "uengine.sexit" 76 msgid "Exit" 77 msgstr "Sortie" 78 79 #: uengine.sfullscreen 80 #, fuzzy 81 msgctxt "uengine.sfullscreen" 82 msgid "Full screen" 83 msgstr "Plein écran" 30 84 31 85 #: uengine.sgameover … … 42 96 msgstr "%d passagers ont pris votre métro pendant %d jours." 43 97 98 #: uengine.slanguage 99 #, fuzzy 100 msgctxt "uengine.slanguage" 101 msgid "Language" 102 msgstr "Langue" 103 44 104 #: uengine.slondon 45 105 msgid "London" … … 49 109 msgid "New high score!" 50 110 msgstr "Nouveau highscore!" 111 112 #: uengine.snewtrain 113 msgid "You get a new train for your metro" 114 msgstr "" 51 115 52 116 #: uengine.snewyork … … 63 127 msgstr "Le vieux highscore était %d passagers pendant %d jours." 64 128 129 #: uengine.soptions 130 #, fuzzy 131 msgctxt "uengine.soptions" 132 msgid "Options" 133 msgstr "Options" 134 65 135 #: uengine.sparis 66 136 msgid "Paris" 67 137 msgstr "" 68 138 139 #: uengine.splay 140 #, fuzzy 141 msgctxt "uengine.splay" 142 msgid "Play" 143 msgstr "Jouer" 144 69 145 #: uengine.sprague 70 146 msgid "Prague" 71 147 msgstr "" 72 148 149 #: uengine.srestart 150 #, fuzzy 151 msgctxt "uengine.srestart" 152 msgid "Try again" 153 msgstr "Redémarrer" 154 73 155 #: uengine.sstationnotdefined 74 156 msgid "Station have to be defined" … … 83 165 msgstr "" 84 166 167 #: uengine.strain 168 msgid "Train" 169 msgstr "" 170 171 #: uengine.sweek 172 msgid "week" 173 msgstr "" 174 85 175 #: uformmain.sfridayshort 86 176 msgid "FRI" … … 112 202 113 203 #: umenu.sautomatic 204 msgctxt "umenu.sautomatic" 114 205 msgid "Automatic" 115 206 msgstr "Automatique" 116 207 117 208 #: umenu.sback 209 msgctxt "umenu.sback" 118 210 msgid "Back" 119 211 msgstr "Retour" … … 125 217 126 218 #: umenu.scontinue 219 msgctxt "umenu.scontinue" 127 220 msgid "Continue" 128 221 msgstr "Continuer" 129 222 130 223 #: umenu.sczech 224 msgctxt "umenu.sczech" 131 225 msgid "Czech" 132 226 msgstr "Tchèque" 133 227 134 228 #: umenu.sdarkmode 229 msgctxt "umenu.sdarkmode" 135 230 msgid "Dark mode" 136 231 msgstr "Mode sombre" 137 232 138 233 #: umenu.senglish 234 msgctxt "umenu.senglish" 139 235 msgid "English" 140 236 msgstr "Anglais" … … 146 242 147 243 #: umenu.sfullscreen 244 msgctxt "umenu.sfullscreen" 148 245 msgid "Full screen" 149 246 msgstr "Plein écran" 150 247 151 248 #: umenu.slanguage 249 msgctxt "umenu.slanguage" 152 250 msgid "Language" 153 251 msgstr "Langue" … … 164 262 165 263 #: umenu.srestart 264 msgctxt "umenu.srestart" 166 265 msgid "Try again" 167 266 msgstr "Redémarrer" -
trunk/Languages/BigMetro.pot
r94 r95 15 15 msgstr "" 16 16 17 #: uengine.sautomatic 18 msgctxt "uengine.sautomatic" 19 msgid "Automatic" 20 msgstr "" 21 22 #: uengine.sback 23 msgctxt "uengine.sback" 24 msgid "Back" 25 msgstr "" 26 27 #: uengine.sbigmetro 28 msgctxt "uengine.sbigmetro" 29 msgid "Big Metro" 30 msgstr "" 31 32 #: uengine.scontinue 33 msgctxt "uengine.scontinue" 34 msgid "Continue" 35 msgstr "" 36 37 #: uengine.sczech 38 msgctxt "uengine.sczech" 39 msgid "Czech" 40 msgstr "" 41 42 #: uengine.sdarkmode 43 msgctxt "uengine.sdarkmode" 44 msgid "Dark mode" 45 msgstr "" 46 17 47 #: uengine.sday 18 48 msgid "Day" 49 msgstr "" 50 51 #: uengine.senglish 52 msgctxt "uengine.senglish" 53 msgid "English" 54 msgstr "" 55 56 #: uengine.sexit 57 msgctxt "uengine.sexit" 58 msgid "Exit" 59 msgstr "" 60 61 #: uengine.sfullscreen 62 msgctxt "uengine.sfullscreen" 63 msgid "Full screen" 19 64 msgstr "" 20 65 … … 32 77 msgstr "" 33 78 79 #: uengine.slanguage 80 msgctxt "uengine.slanguage" 81 msgid "Language" 82 msgstr "" 83 34 84 #: uengine.slondon 35 85 msgid "London" … … 38 88 #: uengine.snewhighscore 39 89 msgid "New high score!" 90 msgstr "" 91 92 #: uengine.snewtrain 93 msgid "You get a new train for your metro" 40 94 msgstr "" 41 95 … … 53 107 msgstr "" 54 108 109 #: uengine.soptions 110 msgctxt "uengine.soptions" 111 msgid "Options" 112 msgstr "" 113 55 114 #: uengine.sparis 56 115 msgid "Paris" 57 116 msgstr "" 58 117 118 #: uengine.splay 119 msgctxt "uengine.splay" 120 msgid "Play" 121 msgstr "" 122 59 123 #: uengine.sprague 60 124 msgid "Prague" 61 125 msgstr "" 62 126 127 #: uengine.srestart 128 msgctxt "uengine.srestart" 129 msgid "Try again" 130 msgstr "" 131 63 132 #: uengine.sstationnotdefined 64 133 msgid "Station have to be defined" … … 73 142 msgstr "" 74 143 144 #: uengine.strain 145 msgid "Train" 146 msgstr "" 147 148 #: uengine.sweek 149 msgid "week" 150 msgstr "" 151 75 152 #: uformmain.sfridayshort 76 153 msgid "FRI" … … 102 179 103 180 #: umenu.sautomatic 181 msgctxt "umenu.sautomatic" 104 182 msgid "Automatic" 105 183 msgstr "" 106 184 107 185 #: umenu.sback 186 msgctxt "umenu.sback" 108 187 msgid "Back" 109 188 msgstr "" … … 115 194 116 195 #: umenu.scontinue 196 msgctxt "umenu.scontinue" 117 197 msgid "Continue" 118 198 msgstr "" 119 199 120 200 #: umenu.sczech 201 msgctxt "umenu.sczech" 121 202 msgid "Czech" 122 203 msgstr "" 123 204 124 205 #: umenu.sdarkmode 206 msgctxt "umenu.sdarkmode" 125 207 msgid "Dark mode" 126 208 msgstr "" 127 209 128 210 #: umenu.senglish 211 msgctxt "umenu.senglish" 129 212 msgid "English" 130 213 msgstr "" 131 214 132 215 #: umenu.sexit 216 msgctxt "umenu.sexit" 133 217 msgid "Exit" 134 218 msgstr "" 135 219 136 220 #: umenu.sfullscreen 221 msgctxt "umenu.sfullscreen" 137 222 msgid "Full screen" 138 223 msgstr "" 139 224 140 225 #: umenu.slanguage 226 msgctxt "umenu.slanguage" 141 227 msgid "Language" 142 228 msgstr "" 143 229 144 230 #: umenu.soptions 231 msgctxt "umenu.soptions" 145 232 msgid "Options" 146 233 msgstr "" 147 234 148 235 #: umenu.splay 236 msgctxt "umenu.splay" 149 237 msgid "Play" 150 238 msgstr "" 151 239 152 240 #: umenu.srestart 241 msgctxt "umenu.srestart" 153 242 msgid "Try again" 154 243 msgstr "" -
trunk/UColors.pas
r90 r95 12 12 TColors = record 13 13 Background: TColor; 14 Background2: TColor; 14 15 Text: TColor; 15 16 ShapeBackground: TColor; … … 29 30 if DarkMode then begin 30 31 Background := $2f3020; 32 Background2 := $4f5040; 31 33 Text := clWhite; 32 34 ShapeBackground := clBlack; … … 36 38 end else begin 37 39 Background := $eff0e0; 40 Background2 := $cfd0c0; 38 41 Text := clBlack; 39 42 ShapeBackground := clWhite; -
trunk/UControls.pas
r86 r95 18 18 Bounds: TRect; 19 19 Canvas: TCanvas; 20 procedure MouseUp(Position: TPoint); 20 21 constructor Create; virtual; 21 22 procedure Paint; virtual; 22 23 property Enabled: Boolean read FEnabled write SetEnabled; 23 24 property OnClick: TNotifyEvent read FOnClick write FOnClick; 25 end; 26 27 { TLabel } 28 29 TLabel = class(TControl) 30 Text: string; 31 procedure Paint; override; 24 32 end; 25 33 … … 44 52 implementation 45 53 54 { TLabel } 55 56 procedure TLabel.Paint; 57 begin 58 if Assigned(Canvas) then 59 with Canvas do begin 60 TextOut(Bounds.Left, Bounds.Top, Text); 61 end; 62 end; 63 46 64 { TButton } 47 65 … … 58 76 FEnabled := AValue; 59 77 if Assigned(Canvas) then Paint; 78 end; 79 80 procedure TControl.MouseUp(Position: TPoint); 81 begin 82 if Bounds.Contains(Position) then 83 if Assigned(FOnClick) then FOnClick(Self); 60 84 end; 61 85 -
trunk/UEngine.pas
r94 r95 7 7 uses 8 8 {$IFDEF DARWIN}MacOSAll, CocoaAll, CocoaUtils,{$ENDIF} 9 Classes, SysUtils, Graphics, Controls, ExtCtrls, Math, DateUtils, URegistry,10 U MetaCanvas, Generics.Collections, Generics.Defaults, UMenu, UControls,11 U MetroPassenger, UColors, UView, URiver, UTrack, UCity, UGeometric;9 Classes, SysUtils, Graphics, Controls, ExtCtrls, Math, DateUtils, Types, 10 URegistry, UMetaCanvas, Generics.Collections, Generics.Defaults, UMenu, 11 UControls, UMetroPassenger, UColors, UView, URiver, UTrack, UCity, UGeometric; 12 12 13 13 type … … 148 148 end; 149 149 150 TGameState = (gsNotStarted, gsRunning, gsPaused, gsGameOver, gsMenu );150 TGameState = (gsNotStarted, gsRunning, gsPaused, gsGameOver, gsMenu, gsNewWeek); 151 151 152 152 { TEngine } … … 187 187 procedure DrawTrains(Canvas: TCanvas); 188 188 procedure DrawGameOver(Canvas: TCanvas; CanvasSize: TPoint); 189 procedure DrawNew Train(Canvas: TCanvas; CanvasSize: TPoint);189 procedure DrawNewWeek(Canvas: TCanvas; CanvasSize: TPoint); 190 190 procedure DrawStationPassengerOverload(Canvas: TCanvas); 191 191 procedure DrawLines(Canvas: TCanvas); … … 210 210 procedure ButtonPause(Sender: TObject); 211 211 procedure ButtonFastForward(Sender: TObject); 212 procedure ButtonNewTrain(Sender: TObject); 212 213 procedure ButtonBackClick(Sender: TObject); 213 214 procedure DarkModeChanged(Sender: TObject); … … 217 218 procedure InitCities; 218 219 public 220 Week: Integer; 219 221 Colors: TColors; 220 222 Passengers: TMetroPassengers; … … 241 243 ImageFastForward: TImage; 242 244 ImageCarriage: TImage; 245 ImageNewTrain: TImage; 243 246 HighestServedPassengerCount: Integer; 244 247 HighestServedDaysCount: Integer; … … 320 323 SNoOldStationToConnectNew = 'No old line station to connect new station'; 321 324 SStationWithoutMapStation = 'Station have to have MapStation'; 325 SNewTrain = 'You get a new train for your metro'; 326 SWeek = 'week'; 327 STrain = 'Train'; 328 SPlay = 'Play'; 329 SOptions = 'Options'; 330 SExit = 'Exit'; 331 SBigMetro = 'Big Metro'; 332 SDarkMode = 'Dark mode'; 333 SLanguage = 'Language'; 334 SCzech = 'Czech'; 335 SEnglish = 'English'; 336 SBack = 'Back'; 337 SAutomatic = 'Automatic'; 338 SFullScreen = 'Full screen'; 339 SContinue = 'Continue'; 340 SRestart = 'Try again'; 322 341 323 342 // Cities … … 1666 1685 end; 1667 1686 1687 procedure TEngine.ButtonNewTrain(Sender: TObject); 1688 begin 1689 Trains.AddNew; 1690 if Random < 0.2 then Carriages.AddNew; 1691 State := gsRunning; 1692 Redraw; 1693 end; 1694 1668 1695 procedure TEngine.MenuItemGameContinue(Sender: TObject); 1669 1696 begin … … 1832 1859 I: Integer; 1833 1860 Y: Integer; 1861 IsDay: Boolean; 1834 1862 const 1835 1863 ClockSize = 20; 1836 1864 begin 1837 if (Time / OneHour > 6) and (Time / OneHour < 18) then begin 1865 IsDay := (((Time / OneHour) mod 24) > 6) and (((Time / OneHour) mod 24) < 18); 1866 if IsDay then begin 1838 1867 Canvas.Brush.Style := bsSolid; 1839 1868 Canvas.Brush.Color := Colors.Background; … … 1850 1879 Canvas.Brush.Style := bsClear; 1851 1880 1852 if (Time / OneHour > 6) and (Time / OneHour < 18)then begin1881 if IsDay then begin 1853 1882 Canvas.Pen.Color := Colors.Text; 1854 1883 end else begin … … 1899 1928 procedure TEngine.DrawTrains(Canvas: TCanvas); 1900 1929 var 1901 I: Integer;1902 1930 P: Integer; 1903 1931 Pos: TPoint; … … 1978 2006 Brush.Color := Self.Colors.Background; 1979 2007 1980 Y := 100;2008 Y := ScaleY(100, 96); 1981 2009 Font.Size := 40; 1982 2010 TextOut((CanvasSize.X - TextWidth(SGameOver)) div 2, Y, SGameOver); … … 1991 2019 Y := Y + Round(TextHeight(SGameOverStatistic) * 1.1); 1992 2020 1993 Y := Y + 16;2021 Y := Y + ScaleY(16, 96); 1994 2022 1995 2023 // Calculate new highest score … … 2010 2038 end; 2011 2039 2012 procedure TEngine.DrawNewTrain(Canvas: TCanvas; CanvasSize: TPoint); 2013 begin 2014 2040 procedure TEngine.DrawNewWeek(Canvas: TCanvas; CanvasSize: TPoint); 2041 var 2042 Text: string; 2043 TextSize: TSize; 2044 Y: Integer; 2045 X: Integer; 2046 const 2047 ImageZoom = 4; 2048 begin 2049 with Canvas do begin 2050 Pen.Color := Self.Colors.Text; 2051 Pen.Style := psSolid; 2052 Pen.Width := ScaleX(2, 96); 2053 Brush.Color := Self.Colors.Background2; 2054 Brush.Style := bsSolid; 2055 Rectangle(Bounds(CanvasSize.X div 4, CanvasSize.Y div 4, CanvasSize.X div 2, CanvasSize.Y div 2)); 2056 Pen.Style := psClear; 2057 X := CanvasSize.X div 4 + ScaleX(10, 96); 2058 Y := CanvasSize.Y div 4 + ScaleX(10, 96); 2059 2060 Text := IntToStr(Week) + '. ' + SWeek; 2061 Font.Size := 30; 2062 Font.Color := Self.Colors.Text; 2063 TextSize := TextExtent(Text); 2064 TextOut(X, Y, Text); 2065 Y := Y + Round(1.1 * TextSize.Height); 2066 2067 Text := SNewTrain; 2068 Font.Size := 14; 2069 Font.Color := Self.Colors.Text; 2070 TextSize := TextExtent(Text); 2071 TextOut(X, Y, Text); 2072 Y := Y + Round(1.1 * TextSize.Height); 2073 2074 ImageNewTrain.Canvas := Canvas; 2075 ImageNewTrain.Bounds := Bounds((CanvasSize.X - ImageLocomotive.Bitmap.Width * ImageZoom) div 2, 2076 (CanvasSize.Y - ImageLocomotive.Bitmap.Height * ImageZoom) div 2, 2077 ImageLocomotive.Bitmap.Width * ImageZoom, 2078 ImageLocomotive.Bitmap.Height * ImageZoom); 2079 ImageNewTrain.Paint; 2080 2081 Y := (CanvasSize.Y - ImageLocomotive.Bitmap.Height * ImageZoom) div 2 + 2082 Round(ImageLocomotive.Bitmap.Height * ImageZoom * 1.1); 2083 2084 Text := STrain; 2085 Font.Size := 20; 2086 Font.Color := Self.Colors.Text; 2087 TextSize := TextExtent(Text); 2088 TextOut((CanvasSize.X - TextSize.Width) div 2, Y, Text); 2089 end; 2015 2090 end; 2016 2091 … … 2280 2355 Redraw; // Redraw on every tick because engine time is changed so clock should be redrawn 2281 2356 2282 // Add new trains 2283 if (Time - LastNewWeekTime) > NewTrainPeriod then begin 2284 LastNewWeekTime := Time; 2285 Trains.AddNew; 2286 if Random < 0.2 then Carriages.AddNew; 2287 // TODO: Show notification screen with confirmation 2288 Redraw; 2289 end; 2290 2291 // Add new shape 2292 if (Time - LastNewShapeTime) > NewShapePeriod then begin 2293 LastNewShapeTime := Time; 2294 if ShapeCount <= Integer(High(TStationShape)) then Inc(ShapeCount); 2295 Redraw; 2296 end; 2297 2298 // Add new stations 2299 if (Time - LastNewStationTime) > NewStationPeriod then begin 2300 LastNewStationTime := Time; 2301 Stations.AddNew; 2302 ResizeView; 2303 Redraw; 2304 end; 2305 2306 // Add new passengers 2307 if (Time - LastNewPassengerTime) > NewPassengerPeriod then begin 2308 LastNewPassengerTime := Time; 2357 // Add new trains 2358 if (Time - LastNewWeekTime) > NewTrainPeriod then begin 2359 LastNewWeekTime := Time; 2360 Inc(Week); 2361 State := gsNewWeek; 2362 Redraw; 2363 end; 2364 2365 // Add new shape 2366 if (Time - LastNewShapeTime) > NewShapePeriod then begin 2367 LastNewShapeTime := Time; 2368 if ShapeCount <= Integer(High(TStationShape)) then Inc(ShapeCount); 2369 Redraw; 2370 end; 2371 2372 // Add new stations 2373 if (Time - LastNewStationTime) > NewStationPeriod then begin 2374 LastNewStationTime := Time; 2375 Stations.AddNew; 2376 ResizeView; 2377 Redraw; 2378 end; 2379 2380 // Add new passengers 2381 if (Time - LastNewPassengerTime) > NewPassengerPeriod then begin 2382 LastNewPassengerTime := Time; 2383 for MapStation in Stations do 2384 with MapStation do 2385 if Random < NewPassengerProbability then begin 2386 Passenger := Self.Passengers.AddNew; 2387 Passenger.Shape := TStationShape(Random(Integer(ShapeCount))); 2388 Passengers.Add(Passenger); 2389 2390 // Passenger is not allowed to have same shape 2391 while (Passenger.Shape = Shape) or 2392 not (Passenger.Shape in GetExistStationShapes) do 2393 Passenger.Shape := TStationShape((Integer(Passenger.Shape) + 1) mod Integer(ShapeCount)); 2394 Redraw; 2395 end; 2396 end; 2397 2398 // Check station passenger overload state 2309 2399 for MapStation in Stations do 2310 with MapStation do 2311 if Random < NewPassengerProbability then begin 2312 Passenger := Self.Passengers.AddNew; 2313 Passenger.Shape := TStationShape(Random(Integer(ShapeCount))); 2314 Passengers.Add(Passenger); 2315 2316 // Passenger is not allowed to have same shape 2317 while (Passenger.Shape = Shape) or 2318 not (Passenger.Shape in GetExistStationShapes) do 2319 Passenger.Shape := TStationShape((Integer(Passenger.Shape) + 1) mod Integer(ShapeCount)); 2320 Redraw; 2321 end; 2322 end; 2323 2324 // Check station passenger overload state 2325 for MapStation in Stations do 2326 with MapStation do begin 2327 if Passengers.Count > MaxWaitingPassengers then begin 2328 OverloadDuration := OverloadDuration + (FTime - FLastTime); 2329 if OverloadDuration > MaxPassengersOveloadTime then 2330 OverloadDuration := MaxPassengersOveloadTime; 2331 if OverloadDuration < MaxPassengersOveloadTime then Redraw; 2332 end; 2333 if Passengers.Count <= MaxWaitingPassengers then begin 2334 if OverloadDuration > 0 then Redraw; 2335 OverloadDuration := OverloadDuration - (FTime - FLastTime); 2336 if OverloadDuration < 0 then begin 2337 OverloadDuration := 0; 2338 end; 2339 end; 2340 end; 2341 2342 TrainMovement; 2343 2344 // Game over 2345 for MapStation in Stations do 2346 with MapStation do begin 2347 if OverloadDuration >= MaxPassengersOveloadTime then begin 2348 State := gsGameOver; 2349 Redraw; 2350 end; 2351 end; 2352 2400 with MapStation do begin 2401 if Passengers.Count > MaxWaitingPassengers then begin 2402 OverloadDuration := OverloadDuration + (FTime - FLastTime); 2403 if OverloadDuration > MaxPassengersOveloadTime then 2404 OverloadDuration := MaxPassengersOveloadTime; 2405 if OverloadDuration < MaxPassengersOveloadTime then Redraw; 2406 end; 2407 if Passengers.Count <= MaxWaitingPassengers then begin 2408 if OverloadDuration > 0 then Redraw; 2409 OverloadDuration := OverloadDuration - (FTime - FLastTime); 2410 if OverloadDuration < 0 then begin 2411 OverloadDuration := 0; 2412 end; 2413 end; 2414 end; 2415 2416 TrainMovement; 2417 2418 // Game over 2419 for MapStation in Stations do 2420 with MapStation do begin 2421 if OverloadDuration >= MaxPassengersOveloadTime then begin 2422 State := gsGameOver; 2423 Redraw; 2424 end; 2425 end; 2353 2426 end; 2354 2427 LastTickTime := Now; … … 2425 2498 Menu.MouseUp(Button, Position); 2426 2499 Redraw; 2427 end else begin 2428 // Back button 2429 if ButtonBack.Bounds.Contains(Position) then begin 2430 if Assigned(ButtonBack.OnClick) then 2431 ButtonBack.OnClick(ButtonBack); 2432 end; 2433 2434 // Pause button 2435 if ImagePause.Bounds.Contains(Position) then begin 2436 if Assigned(ImagePause.OnClick) then 2437 ImagePause.OnClick(ImagePause); 2438 end; 2439 2440 // Play button 2441 if ImagePlay.Bounds.Contains(Position) then begin 2442 if Assigned(ImagePlay.OnClick) then 2443 ImagePlay.OnClick(ImagePlay); 2444 end; 2445 2446 // Fast forward button 2447 if ImageFastForward.Bounds.Contains(Position) then begin 2448 if Assigned(ImageFastForward.OnClick) then 2449 ImageFastForward.OnClick(ImageFastForward); 2450 end; 2500 end else 2501 if State = gsNewWeek then begin 2502 ImageNewTrain.MouseUp(Position); 2503 end 2504 else 2505 if State = gsRunning then begin 2506 ButtonBack.MouseUp(Position); 2507 ImagePause.MouseUp(Position); 2508 ImagePlay.MouseUp(Position); 2509 ImageFastForward.MouseUp(Position); 2451 2510 2452 2511 // Place selected train if focused track … … 2608 2667 KeyF3 = 114; 2609 2668 KeyF4 = 115; 2669 KeyF5 = 116; 2610 2670 begin 2611 2671 if Key = KeyEsc then begin … … 2635 2695 Redraw; 2636 2696 end; 2697 end else 2698 if Key = KeyF5 then begin 2699 if State = gsRunning then begin 2700 State := gsNewWeek; 2701 Redraw; 2702 end; 2637 2703 end; 2638 2704 {$ENDIF} … … 2647 2713 procedure TEngine.Clear; 2648 2714 begin 2715 Week := 0; 2649 2716 Trains.Clear; 2650 2717 Passengers.Clear; … … 2673 2740 end; 2674 2741 2675 for I := 0 to 8do begin2742 for I := 0 to 2 do begin 2676 2743 Lines.AddNew; 2677 2744 NewTrain := TMetroTrain.Create; … … 2754 2821 ImageFastForward := TImage.Create; 2755 2822 ImageFastForward.OnClick := ButtonFastForward; 2823 ImageNewTrain := TImage.Create; 2824 ImageNewTrain.OnClick := ButtonNewTrain; 2756 2825 //if FileExists(ImagePassengerName) then 2757 2826 // ImagePassenger.Picture.LoadFromFile(ImagePassengerName); … … 2770 2839 FreeAndNil(Trains); 2771 2840 FreeAndNil(Carriages); 2841 FreeAndNil(ImageNewTrain); 2772 2842 FreeAndNil(ImagePlay); 2773 2843 FreeAndNil(ImageFastForward); … … 2809 2879 MetaCanvas.DrawTo(Canvas); 2810 2880 2811 if State <> gsMenu then begin2812 DrawGameControls(Canvas, CanvasSize);2813 end;2814 2815 2881 // Game over 2816 2882 if State = gsGameOver then … … 2820 2886 if State = gsMenu then begin 2821 2887 Menu.Paint(Canvas, CanvasSize); 2888 end else 2889 if State = gsNewWeek then begin 2890 DrawNewWeek(Canvas, CanvasSize); 2891 end else 2892 if State in [gsRunning, gsPaused] then begin 2893 DrawGameControls(Canvas, CanvasSize); 2822 2894 end; 2823 2895 -
trunk/UMenu.pas
r86 r95 78 78 property OnExit: TNotifyEvent read FOnExit write FOnExit; 79 79 end; 80 81 resourcestring82 SPlay = 'Play';83 SOptions = 'Options';84 SExit = 'Exit';85 SBigMetro = 'Big Metro';86 SDarkMode = 'Dark mode';87 SLanguage = 'Language';88 SCzech = 'Czech';89 SEnglish = 'English';90 SBack = 'Back';91 SAutomatic = 'Automatic';92 SFullScreen = 'Full screen';93 SContinue = 'Continue';94 SRestart = 'Try again';95 80 96 81
Note:
See TracChangeset
for help on using the changeset viewer.