Changeset 51
- Timestamp:
- Nov 3, 2019, 6:20:02 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Languages/Game2048.cs.po
r50 r51 191 191 #: ucore.swinmessage 192 192 msgctxt "ucore.swinmessage" 193 msgid "You reached % dand won! You can continue to play to get higher score."194 msgstr "Dosáhl jsi % da vyhrál! Můžeš pokračovat ve hře k dosažení vyššího skóre."193 msgid "You reached %s and won! You can continue to play to get higher score." 194 msgstr "Dosáhl jsi %s a vyhrál! Můžeš pokračovat ve hře k dosažení vyššího skóre." 195 195 196 196 #: uformabout.slicense … … 238 238 msgstr "Skóre" 239 239 240 #: ugame.sskinalpha 241 msgid "Alpha" 242 msgstr "Písmena" 243 240 244 #: ugame.sskinlinear 241 245 msgid "Linear" -
trunk/Languages/Game2048.po
r50 r51 181 181 #: ucore.swinmessage 182 182 msgctxt "ucore.swinmessage" 183 msgid "You reached % dand won! You can continue to play to get higher score."183 msgid "You reached %s and won! You can continue to play to get higher score." 184 184 msgstr "" 185 185 … … 228 228 msgstr "" 229 229 230 #: ugame.sskinalpha 231 msgid "Alpha" 232 msgstr "" 233 230 234 #: ugame.sskinlinear 231 235 msgid "Linear" -
trunk/UCore.lfm
r50 r51 4 4 OldCreateOrder = False 5 5 Height = 534 6 HorizontalOffset = 10927 VerticalOffset = 4946 HorizontalOffset = 773 7 VerticalOffset = 525 8 8 Width = 635 9 9 PPI = 144 … … 37 37 object Translator1: TTranslator 38 38 POFilesFolder = 'Languages' 39 OnTranslate = Translator1Translate 39 40 left = 336 40 41 top = 295 … … 81 82 end 82 83 end 84 object ThemeManager2: TThemeManager 85 left = 163 86 top = 405 87 end 83 88 end -
trunk/UCore.pas
r50 r51 64 64 SGameOverMessage = 'Game over!'; 65 65 SWinCaption = 'Win'; 66 SWinMessage = 'You reached % dand won! You can continue to play to get higher score.';66 SWinMessage = 'You reached %s and won! You can continue to play to get higher score.'; 67 67 68 68 { TCore } -
trunk/UGame.pas
r50 r51 94 94 end; 95 95 96 TTileSkin = (tsLinear, tsPowerOfTwo );96 TTileSkin = (tsLinear, tsPowerOfTwo, tsAlpha); 97 97 98 98 { TGame } … … 145 145 procedure SaveToRegistry(RegContext: TRegistryContext); 146 146 procedure LoadFromRegistry(RegContext: TRegistryContext); 147 function GetTileSkinValue(Value: Integer): Integer; 147 function GetTileSkinValue(Value: Integer): string; 148 function GetTileSkinScore(Value: Integer): Integer; 148 149 constructor Create; 149 150 destructor Destroy; override; … … 176 177 SSkinLinear = 'Linear'; 177 178 SSkinPowerOfTwo = 'Power of two'; 179 SSkinAlpha = 'Alpha'; 178 180 STileShouldBeEmpty = 'Tile should be empty'; 181 179 182 180 183 procedure Translate; … … 190 193 SkinText[tsLinear] := SSkinLinear; 191 194 SkinText[tsPowerOfTwo] := SSkinPowerOfTwo; 195 SkinText[tsAlpha] := SSkinAlpha; 192 196 end; 193 197 … … 694 698 Board.Tiles[P.Y, P.X].Value := 0; 695 699 Board.Tiles[P.Y, P.X].Merged := False; 696 Score := Score + GetTileSkin Value(Board.Tiles[PNew.Y, PNew.X].Value);700 Score := Score + GetTileSkinScore(Board.Tiles[PNew.Y, PNew.X].Value); 697 701 end; 698 702 end; … … 715 719 Canvas.RoundRect(TileRect, ScaleX(TileRect.Width div 20, 96), ScaleY(TileRect.Height div 20, 96)); 716 720 if WithText and (Tile.Value <> 0) then begin 717 ValueStr := IntToStr(GetTileSkinValue(Tile.Value));721 ValueStr := GetTileSkinValue(Tile.Value); 718 722 Canvas.Brush.Style := bsClear; 719 723 Canvas.Font.Height := Trunc(TileRect.Height * 0.7); … … 859 863 Board.Tiles[P.Y, P.X].NewValue := 0; 860 864 Board.Tiles[P.Y, P.X].Merged := False; 861 Score := Score + GetTileSkin Value(Board.Tiles[PNew.Y, PNew.X].NewValue);865 Score := Score + GetTileSkinScore(Board.Tiles[PNew.Y, PNew.X].NewValue); 862 866 TileMoved := True; 863 867 end; … … 918 922 end; 919 923 920 function TGame.GetTileSkinValue(Value: Integer): Integer; 921 begin 922 if FSkin = tsPowerOfTwo then Result := 1 shl Value 923 else Result := Value; 924 function TGame.GetTileSkinValue(Value: Integer): string; 925 begin 926 case FSkin of 927 tsLinear: Result := IntToStr(Value); 928 tsPowerOfTwo: Result := IntToStr(1 shl Value); 929 tsAlpha: Result := Chr(Ord('A') + Value - 1); 930 else Result := IntToStr(Value); 931 end; 932 end; 933 934 function TGame.GetTileSkinScore(Value: Integer): Integer; 935 begin 936 case FSkin of 937 tsLinear: Result := Value; 938 tsPowerOfTwo: Result := 1 shl Value; 939 tsAlpha: Result := Value; 940 else Result := Value; 941 end; 924 942 end; 925 943 … … 1083 1101 end; 1084 1102 1103 initialization 1104 Translate; 1105 1085 1106 end. 1086 1107
Note:
See TracChangeset
for help on using the changeset viewer.