Changeset 99
- Timestamp:
- Sep 28, 2022, 4:28:06 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Languages/BigMetro.cs.po
r96 r99 73 73 msgstr "Odejít" 74 74 75 #: uengine.sfrench 76 msgid "French" 77 msgstr "Francouzština" 78 75 79 #: uengine.sfullscreen 76 80 msgctxt "uengine.sfullscreen" … … 83 87 84 88 #: uengine.sgameoverreason 85 msgid "Overcrowding at this stationhas forced you to resign as metro manager."86 msgstr "Přeplnění v této stanici vásdonutilo odstoupit z pozice správce metra."89 msgid "Overcrowding at one of your stations has forced you to resign as metro manager." 90 msgstr "Přeplnění v jedné z tvých stanic tě donutilo odstoupit z pozice správce metra." 87 91 88 92 #: uengine.sgameoverstatistic 89 93 #, object-pascal-format 90 94 msgid "%d passengers travelled on your metro over %d days." 91 msgstr "%d cestujících cestovalo ve vašem metru během %d dnů." 95 msgstr "%d cestujících cestovalo ve tvém metru během %d dnů." 96 97 #: uengine.sgerman 98 msgid "German" 99 msgstr "Němčina" 92 100 93 101 #: uengine.slanguage … … 151 159 msgid "Try again" 152 160 msgstr "Zkusit znovu" 161 162 #: uengine.srome 163 msgid "Rome" 164 msgstr "Řím" 153 165 154 166 #: uengine.sstationnotdefined -
trunk/Languages/BigMetro.de.po
r96 r99 81 81 msgstr "Beenden" 82 82 83 #: uengine.sfrench 84 msgid "French" 85 msgstr "" 86 83 87 #: uengine.sfullscreen 84 88 #, fuzzy … … 92 96 93 97 #: uengine.sgameoverreason 94 msgid "Overcrowding at this station has forced you to resign as metro manager." 98 #, fuzzy 99 #| msgid "Overcrowding at this station has forced you to resign as metro manager." 100 msgid "Overcrowding at one of your stations has forced you to resign as metro manager." 95 101 msgstr "Die Passagiere an einer Station haben zu lange gewartet. Du musst als Metro manager zurücktreten." 96 102 … … 100 106 msgstr "%d Passagiere fuhren mit deiner Metro über %d Tage." 101 107 108 #: uengine.sgerman 109 msgid "German" 110 msgstr "" 111 102 112 #: uengine.slanguage 103 113 #, fuzzy … … 165 175 msgstr "Neustart" 166 176 177 #: uengine.srome 178 msgid "Rome" 179 msgstr "" 180 167 181 #: uengine.sstationnotdefined 168 182 msgid "Station have to be defined" -
trunk/Languages/BigMetro.fr.po
r96 r99 81 81 msgstr "Sortie" 82 82 83 #: uengine.sfrench 84 msgid "French" 85 msgstr "" 86 83 87 #: uengine.sfullscreen 84 88 #, fuzzy … … 92 96 93 97 #: uengine.sgameoverreason 94 msgid "Overcrowding at this station has forced you to resign as metro manager." 98 #, fuzzy 99 #| msgid "Overcrowding at this station has forced you to resign as metro manager." 100 msgid "Overcrowding at one of your stations has forced you to resign as metro manager." 95 101 msgstr "Les passagers ont attendu trop longtemps. Vous avez été licencié." 96 102 … … 100 106 msgstr "%d passagers ont pris votre métro pendant %d jours." 101 107 108 #: uengine.sgerman 109 msgid "German" 110 msgstr "" 111 102 112 #: uengine.slanguage 103 113 #, fuzzy … … 165 175 msgstr "Redémarrer" 166 176 177 #: uengine.srome 178 msgid "Rome" 179 msgstr "" 180 167 181 #: uengine.sstationnotdefined 168 182 msgid "Station have to be defined" -
trunk/Languages/BigMetro.pot
r96 r99 63 63 msgstr "" 64 64 65 #: uengine.sfrench 66 msgid "French" 67 msgstr "" 68 65 69 #: uengine.sfullscreen 66 70 msgctxt "uengine.sfullscreen" … … 73 77 74 78 #: uengine.sgameoverreason 75 msgid "Overcrowding at this stationhas forced you to resign as metro manager."79 msgid "Overcrowding at one of your stations has forced you to resign as metro manager." 76 80 msgstr "" 77 81 … … 81 85 msgstr "" 82 86 87 #: uengine.sgerman 88 msgid "German" 89 msgstr "" 90 83 91 #: uengine.slanguage 84 92 msgctxt "uengine.slanguage" … … 140 148 msgctxt "uengine.srestart" 141 149 msgid "Try again" 150 msgstr "" 151 152 #: uengine.srome 153 msgid "Rome" 142 154 msgstr "" 143 155 -
trunk/UEngine.pas
r98 r99 187 187 function GetTrainOnPos(Pos: TPoint): TMetroTrain; 188 188 function GetCarriageOnPos(Pos: TPoint): TMetroCarriage; 189 procedure DrawFrame(Canvas: TCanvas; Rect: TRect); 189 190 procedure DrawLine(Canvas: TCanvas; Pos: TPoint); 190 191 procedure DrawShape(Canvas: TCanvas; Position: TPoint; Shape: TStationShape; … … 329 330 resourcestring 330 331 SGameOver = 'Game Over'; 331 SGameOverReason = 'Overcrowding at this stationhas forced you to resign as metro manager.';332 SGameOverReason = 'Overcrowding at one of your stations has forced you to resign as metro manager.'; 332 333 SGameOverStatistic = '%d passengers travelled on your metro over %d days.'; 333 334 SDay = 'Day'; … … 349 350 SCzech = 'Czech'; 350 351 SEnglish = 'English'; 352 SFrench = 'French'; 353 SGerman = 'German'; 351 354 SBack = 'Back'; 352 355 SAutomatic = 'Automatic'; … … 365 368 SNewYork = 'New York'; 366 369 STokyo = 'Tokyo'; 370 SRome = 'Rome'; 367 371 368 372 { TMetroCarriage } … … 1150 1154 end; 1151 1155 end; 1156 end; 1157 end; 1158 1159 procedure TEngine.DrawFrame(Canvas: TCanvas; Rect: TRect); 1160 begin 1161 with Canvas do begin 1162 Pen.Color := Self.Colors.Text; 1163 Pen.Style := psSolid; 1164 Pen.Width := ScaleX(2, 96); 1165 Brush.Color := Self.Colors.Background2; 1166 Brush.Style := bsSolid; 1167 Rectangle(Rect); 1168 Pen.Style := psClear; 1152 1169 end; 1153 1170 end; … … 2110 2127 begin 2111 2128 with Canvas do begin 2129 DrawFrame(Canvas, Bounds(CanvasSize.X div 8, ScaleY(90, 96), 2130 Round(CanvasSize.X / 4 * 3), ScaleY(210, 96))); 2131 2112 2132 Canvas.Font.Color := Self.Colors.Text; 2113 Brush.Style := bs Solid;2114 Brush.Color := Self.Colors.Background;2133 Brush.Style := bsClear; 2134 Pen.Style := psClear; 2115 2135 2116 2136 Y := ScaleY(100, 96); 2137 2117 2138 Font.Size := 40; 2118 2139 TextOut((CanvasSize.X - TextWidth(SGameOver)) div 2, Y, SGameOver); … … 2152 2173 Y: Integer; 2153 2174 X: Integer; 2154 const2155 ImageZoom = 4;2156 2175 begin 2157 2176 with Canvas do begin 2158 Pen.Color := Self.Colors.Text; 2159 Pen.Style := psSolid; 2160 Pen.Width := ScaleX(2, 96); 2161 Brush.Color := Self.Colors.Background2; 2162 Brush.Style := bsSolid; 2163 Rectangle(Bounds(CanvasSize.X div 4, CanvasSize.Y div 4, CanvasSize.X div 2, CanvasSize.Y div 2)); 2164 Pen.Style := psClear; 2177 2178 DrawFrame(Canvas, Bounds(CanvasSize.X div 4, CanvasSize.Y div 4, CanvasSize.X div 2, CanvasSize.Y div 2)); 2165 2179 X := CanvasSize.X div 4 + ScaleX(10, 96); 2166 2180 Y := CanvasSize.Y div 4 + ScaleX(10, 96); … … 2208 2222 Center := Point(CanvasSize.X div 2, CanvasSize.Y div 2); 2209 2223 2210 Pen.Color := Self.Colors.Text; 2211 Pen.Style := psSolid; 2212 Pen.Width := ScaleX(2, 96); 2213 Brush.Color := Self.Colors.Background2; 2214 Brush.Style := bsSolid; 2215 Rectangle(Bounds(CanvasSize.X div 4, CanvasSize.Y div 4, CanvasSize.X div 2, CanvasSize.Y div 2)); 2216 Pen.Style := psClear; 2224 DrawFrame(Canvas, Bounds(CanvasSize.X div 4, CanvasSize.Y div 4, CanvasSize.X div 2, CanvasSize.Y div 2)); 2217 2225 X := CanvasSize.X div 4 + ScaleX(10, 96); 2218 2226 Y := CanvasSize.Y div 4 + ScaleX(10, 96); … … 2644 2652 end; 2645 2653 2654 if Assigned(SelectedTrain) or Assigned(SelectedCarriage) then Redraw; 2655 2646 2656 LastMousePos := Position; 2647 2657 if MouseHold then begin 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2658 FocusedStation := GetStationOnPos(View.PointDestToSrc(Position)); 2659 Line := nil; 2660 if Assigned(TrackStationDown) then begin 2661 Line := TMetroLine(TrackStationDown.Track.Owner); 2662 Redraw; 2663 end; 2664 if Assigned(TrackStationUp) then begin 2665 Line := TMetroLine(TrackStationUp.Track.Owner); 2666 Redraw; 2667 end; 2668 if Assigned(Line) and not Assigned(LastFocusedStation) and Assigned(FocusedStation) then begin 2669 if Assigned(TrackStationDown) and (TLineStation(TrackStationDown.OwnerPoint).MapStation = FocusedStation) then begin 2670 // Disconnect down 2671 CurrentTrackPoint := TrackStationDown; 2672 TrackStationDown := TrackStationDown.GetDown; 2673 Line.DisconnectStation(TLineStation(CurrentTrackPoint.OwnerPoint)); 2674 end else 2675 if Assigned(TrackStationUp) and (TLineStation(TrackStationUp.OwnerPoint).MapStation = FocusedStation) then begin 2676 // Disconnect up 2677 CurrentTrackPoint := TrackStationUp; 2678 if Assigned(TrackStationUp) then 2679 TrackStationUp := TrackStationUp.GetUp; 2680 Line.DisconnectStation(TLineStation(CurrentTrackPoint.OwnerPoint)); 2681 end else 2682 if Assigned(Line) and ((not Line.IsCircular) or ((TrackStationDown <> nil) and (TrackStationUp <> nil))) and 2683 ((Line.LineStations.SearchMapStation(FocusedStation) = nil) or 2684 ((Line.LineStations.Count > 0) and 2685 ((Line.LineStations.First.MapStation = FocusedStation) or 2686 (Line.LineStations.Last.MapStation = FocusedStation)) and 2687 ((TrackStationDown = nil) or (TrackStationUp = nil)) and 2688 (not Line.IsCircular))) then begin 2689 if Assigned(TrackStationDown) then LineStationDown := TLineStation(TrackStationDown.OwnerPoint) 2690 else LineStationDown := nil; 2691 if Assigned(TrackStationUp) then LineStationUp := TLineStation(TrackStationUp.OwnerPoint) 2692 else LineStationUp := nil; 2693 Line.ConnectStation(FocusedStation, LineStationDown, LineStationUp); 2694 if Assigned(TrackStationDown) then TrackStationDown := TrackStationDown.GetUp 2695 else if Assigned(TrackStationUp) then TrackStationUp := TrackStationUp.GetDown; 2696 end; 2697 end; 2698 LastFocusedStation := FocusedStation; 2689 2699 end; 2690 2700 end; … … 2700 2710 Menu.MouseUp(Button, Position); 2701 2711 Redraw; 2712 end else 2713 if State = gsGameOver then begin 2714 ButtonBack.MouseUp(Position); 2702 2715 end else 2703 2716 if State = gsNewWeek then begin … … 2709 2722 end 2710 2723 else 2711 if State = gsRunningthen begin2724 if State in [gsRunning, gsPaused] then begin 2712 2725 ButtonBack.MouseUp(Position); 2713 2726 ImagePause.MouseUp(Position); 2714 2727 ImagePlay.MouseUp(Position); 2715 2728 ImageFastForward.MouseUp(Position); 2729 Redraw; 2716 2730 2717 2731 // Place selected train if focused track … … 2793 2807 NewIndex: Integer; 2794 2808 begin 2795 if (Button = mbLeft) and (State <> gsMenu) then begin 2796 MouseHold := True; 2797 LastFocusedStation := nil; 2798 2799 // Train selection 2800 SelectedTrain := GetTrainOnPos(View.PointDestToSrc(Position)); 2801 if Assigned(SelectedTrain) then begin 2802 Exit; 2803 end; 2804 2805 // Carriage selection 2806 SelectedCarriage := GetCarriageOnPos(View.PointDestToSrc(Position)); 2807 if Assigned(SelectedCarriage) then begin 2808 Exit; 2809 end; 2810 2811 // Select unused train 2812 if (Distance(Position, ImageLocomotive.Bounds.CenterPoint) < 30) and 2813 (Trains.GetUnusedCount > 0) then begin 2814 SelectedTrain := Trains.GetUnused; 2815 Exit; 2816 end; 2817 2818 // Select unused carriage 2819 if (Distance(Position, ImageCarriage.Bounds.CenterPoint) < 30) and 2820 (Carriages.GetUnusedCount > 0) then begin 2821 SelectedCarriage := Carriages.GetUnused; 2822 Exit; 2823 end; 2824 2825 // New track creation from selected station as start 2826 Station := GetStationOnPos(View.PointDestToSrc(Position)); 2827 if Assigned(Station) then begin 2828 if Assigned(SelectedLine) and (SelectedLine.LineStations.Count = 0) then NewLine := SelectedLine 2829 else NewLine := GetUnusedLine; 2830 if Assigned(NewLine) then begin 2831 NewLine.ConnectStation(Station, nil, nil); 2832 TrackStationDown := NewLine.Track.Points.Last; 2833 TrackStationUp := nil; 2834 LastFocusedStation := Station; 2835 SelectedLine := NewLine; 2809 if (Button = mbLeft) then begin 2810 if State in [gsRunning, gsPaused] then begin 2811 MouseHold := True; 2812 LastFocusedStation := nil; 2813 Redraw; 2814 2815 // Train selection 2816 SelectedTrain := GetTrainOnPos(View.PointDestToSrc(Position)); 2817 if Assigned(SelectedTrain) then begin 2836 2818 Exit; 2837 2819 end; 2838 end; 2839 2840 // Line selection 2841 Track := GetTrackOnPos(View.PointDestToSrc(Position)); 2842 if Assigned(Track) and Assigned(Track.Points[0]) and Assigned(Track.Points[1]) then begin 2843 SelectedLine := TMetroLine(Track.Points[0].Track.Owner); 2844 2845 TrackStationDown := Track.Points[0]; 2846 NewIndex := TrackStationDown.Track.Points.IndexOf(TrackStationDown); 2847 while Assigned(TrackStationDown) and (not Assigned(TrackStationDown.OwnerPoint)) do begin 2848 NewIndex := NewIndex - 1; 2849 if NewIndex >= 0 then TrackStationDown := TrackStationDown.Track.Points[NewIndex] 2850 else TrackStationDown := nil; 2851 end; 2852 TrackStationUp := Track.Points[1]; 2853 NewIndex := TrackStationUp.Track.Points.IndexOf(TrackStationDown); 2854 while Assigned(TrackStationUp) and (not Assigned(TrackStationUp.OwnerPoint)) do begin 2855 NewIndex := NewIndex + 1; 2856 if NewIndex < TrackStationUp.Track.Points.Count then 2857 TrackStationUp := TrackStationUp.Track.Points[NewIndex] 2858 else TrackStationUp := nil; 2859 end; 2860 Track.Free; 2861 Exit; 2862 end; 2863 if Assigned(Track) then Track.Free; 2820 2821 // Carriage selection 2822 SelectedCarriage := GetCarriageOnPos(View.PointDestToSrc(Position)); 2823 if Assigned(SelectedCarriage) then begin 2824 Exit; 2825 end; 2826 2827 // Select unused train 2828 if (Distance(Position, ImageLocomotive.Bounds.CenterPoint) < 30) and 2829 (Trains.GetUnusedCount > 0) then begin 2830 SelectedTrain := Trains.GetUnused; 2831 Exit; 2832 end; 2833 2834 // Select unused carriage 2835 if (Distance(Position, ImageCarriage.Bounds.CenterPoint) < 30) and 2836 (Carriages.GetUnusedCount > 0) then begin 2837 SelectedCarriage := Carriages.GetUnused; 2838 Exit; 2839 end; 2840 2841 // New track creation from selected station as start 2842 Station := GetStationOnPos(View.PointDestToSrc(Position)); 2843 if Assigned(Station) then begin 2844 if Assigned(SelectedLine) and (SelectedLine.LineStations.Count = 0) then NewLine := SelectedLine 2845 else NewLine := GetUnusedLine; 2846 if Assigned(NewLine) then begin 2847 NewLine.ConnectStation(Station, nil, nil); 2848 TrackStationDown := NewLine.Track.Points.Last; 2849 TrackStationUp := nil; 2850 LastFocusedStation := Station; 2851 SelectedLine := NewLine; 2852 Exit; 2853 end; 2854 end; 2855 2856 // Line selection 2857 Track := GetTrackOnPos(View.PointDestToSrc(Position)); 2858 if Assigned(Track) and Assigned(Track.Points[0]) and Assigned(Track.Points[1]) then begin 2859 SelectedLine := TMetroLine(Track.Points[0].Track.Owner); 2860 2861 TrackStationDown := Track.Points[0]; 2862 NewIndex := TrackStationDown.Track.Points.IndexOf(TrackStationDown); 2863 while Assigned(TrackStationDown) and (not Assigned(TrackStationDown.OwnerPoint)) do begin 2864 NewIndex := NewIndex - 1; 2865 if NewIndex >= 0 then TrackStationDown := TrackStationDown.Track.Points[NewIndex] 2866 else TrackStationDown := nil; 2867 end; 2868 TrackStationUp := Track.Points[1]; 2869 NewIndex := TrackStationUp.Track.Points.IndexOf(TrackStationDown); 2870 while Assigned(TrackStationUp) and (not Assigned(TrackStationUp.OwnerPoint)) do begin 2871 NewIndex := NewIndex + 1; 2872 if NewIndex < TrackStationUp.Track.Points.Count then 2873 TrackStationUp := TrackStationUp.Track.Points[NewIndex] 2874 else TrackStationUp := nil; 2875 end; 2876 Track.Free; 2877 Exit; 2878 end; 2879 if Assigned(Track) then Track.Free; 2880 end; 2864 2881 end; 2865 2882 end; … … 2883 2900 end; 2884 2901 {$IFDEF DEBUG} 2885 if Key = KeyF2then begin2886 if State = gsRunningthen begin2902 if State in [gsRunning, gsPaused] then begin 2903 if Key = KeyF2 then begin 2887 2904 State := gsGameOver; 2888 2905 Redraw; 2889 2906 end; 2890 end else 2891 if Key = KeyF3 then begin 2892 if State = gsRunning then begin 2907 if Key = KeyF3 then begin 2893 2908 Trains.AddNew; 2894 2909 Redraw; 2895 2910 end; 2896 end else 2897 if Key = KeyF4 then begin 2898 if State = gsRunning then begin 2911 if Key = KeyF4 then begin 2899 2912 Carriages.AddNew; 2900 2913 Redraw; 2901 2914 end; 2902 end else 2903 if Key = KeyF5 then begin 2904 if State = gsRunning then begin 2915 if Key = KeyF5 then begin 2905 2916 State := gsNewWeek; 2906 2917 Redraw; 2907 2918 end; 2908 end else 2909 if Key = KeyF6 then begin 2910 if State = gsRunning then begin 2919 if Key = KeyF6 then begin 2911 2920 Stations.AddNew; 2912 2921 ResizeView; … … 3107 3116 begin 3108 3117 DrawGameOver(Canvas, CanvasSize); 3118 DrawGameControls(Canvas, CanvasSize); 3109 3119 end else 3110 3120 if State = gsMenu then begin
Note:
See TracChangeset
for help on using the changeset viewer.