Changeset 13
- Timestamp:
- Oct 5, 2019, 11:16:00 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r8 r13 1 1 object FormNew: TFormNew 2 Left = 75 92 Left = 753 3 3 Height = 212 4 Top = 82 24 Top = 825 5 5 Width = 487 6 6 Caption = 'New game' … … 32 32 '9 x 9' 33 33 '10 x 10 ' 34 '11 x 11' 35 '12 x 12' 34 36 ) 35 37 Style = csDropDownList -
trunk/Forms/UFormNew.pas
r8 r13 1 1 unit UFormNew; 2 2 3 {$mode objfpc}{$H+}3 {$mode delphi}{$H+} 4 4 5 5 interface -
trunk/Forms/UFormSettings.lfm
r11 r13 8 8 ClientWidth = 480 9 9 DesignTimePPI = 144 10 OnClose = FormClose 11 OnCreate = FormCreate 10 12 OnShow = FormShow 11 13 LCLVersion = '2.0.2.0' … … 48 50 TabOrder = 2 49 51 end 52 object ComboBoxLanguage: TComboBox 53 Left = 208 54 Height = 43 55 Top = 86 56 Width = 230 57 ItemHeight = 0 58 Style = csDropDownList 59 TabOrder = 3 60 end 61 object Label2: TLabel 62 Left = 19 63 Height = 26 64 Top = 94 65 Width = 88 66 Caption = 'Language:' 67 ParentColor = False 68 end 50 69 end -
trunk/Forms/UFormSettings.lrj
r11 r13 3 3 {"hash":69745274,"name":"tformsettings.label1.caption","sourcebytes":[65,110,105,109,97,116,105,111,110,32,115,112,101,101,100,58],"value":"Animation speed:"}, 4 4 {"hash":1339,"name":"tformsettings.buttonok.caption","sourcebytes":[79,75],"value":"OK"}, 5 {"hash":77089212,"name":"tformsettings.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"} 5 {"hash":77089212,"name":"tformsettings.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}, 6 {"hash":82521866,"name":"tformsettings.label2.caption","sourcebytes":[76,97,110,103,117,97,103,101,58],"value":"Language:"} 6 7 ]} -
trunk/Forms/UFormSettings.pas
r11 r13 6 6 7 7 uses 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls; 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, 9 ULanguages; 9 10 10 11 type … … 15 16 ButtonOk: TButton; 16 17 ButtonCancel: TButton; 18 ComboBoxLanguage: TComboBox; 17 19 Label1: TLabel; 20 Label2: TLabel; 18 21 TrackBar1: TTrackBar; 19 22 procedure ButtonCancelClick(Sender: TObject); 20 23 procedure ButtonOkClick(Sender: TObject); 24 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 25 procedure FormCreate(Sender: TObject); 21 26 procedure FormShow(Sender: TObject); 22 27 private … … 29 34 FormSettings: TFormSettings; 30 35 36 31 37 implementation 32 38 … … 35 41 uses 36 42 UCore; 43 44 resourcestring 45 SLanguageChangeTitle = 'Language change'; 46 SLanguageChangeMessage = 'Interface language was changed. It may require restart of application.'; 47 37 48 38 49 { TFormSettings } … … 46 57 begin 47 58 Core.Game.AnimationDuration := TrackBar1.Position; 59 if ComboBoxLanguage.ItemIndex <> -1 then begin 60 if (Core.Translator1.Language <> TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex])) then 61 MessageDlg(SLanguageChangeTitle, SLanguageChangeMessage, mtInformation, [mbOk], 0); 62 Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 63 end; 48 64 Close; 65 end; 66 67 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction 68 ); 69 begin 70 Core.PersistentForm1.Save(Self); 71 end; 72 73 procedure TFormSettings.FormCreate(Sender: TObject); 74 begin 75 Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items); 49 76 end; 50 77 51 78 procedure TFormSettings.FormShow(Sender: TObject); 52 79 begin 80 Core.PersistentForm1.Load(Self); 53 81 TrackBar1.Position := Core.Game.AnimationDuration; 82 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator1.Language); 83 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 54 84 end; 55 85 -
trunk/Languages/Game2048.cs.po
r12 r13 13 13 14 14 #: tcore.aabout.caption 15 #, fuzzy16 15 msgctxt "tcore.aabout.caption" 17 16 msgid "About" … … 19 18 20 19 #: tcore.aexit.caption 21 #, fuzzy22 20 msgctxt "tcore.aexit.caption" 23 21 msgid "Exit" … … 25 23 26 24 #: tcore.agamenew.caption 27 #, fuzzy28 25 msgctxt "tcore.agamenew.caption" 29 26 msgid "New..." … … 31 28 32 29 #: tcore.asettings.caption 33 #, fuzzy34 30 msgctxt "tcore.asettings.caption" 35 31 msgid "Settings" … … 88 84 89 85 #: tformsettings.buttoncancel.caption 90 #, fuzzy91 86 msgctxt "tformsettings.buttoncancel.caption" 92 87 msgid "Cancel" … … 94 89 95 90 #: tformsettings.buttonok.caption 96 #, fuzzy97 91 msgctxt "tformsettings.buttonok.caption" 98 92 msgid "OK" … … 106 100 #: tformsettings.label1.caption 107 101 msgid "Animation speed:" 108 msgstr "" 102 msgstr "Rychlost animace:" 103 104 #: tformsettings.label2.caption 105 msgid "Language:" 106 msgstr "Jazyk:" 109 107 110 108 #: uformabout.slicense … … 120 118 msgstr "Verze" 121 119 120 #: uformsettings.slanguagechangemessage 121 msgid "Interface language was changed. It may require restart of application." 122 msgstr "Jazyk rozhraní byl změněn. To může vyžadovat restart aplikace." 123 124 #: uformsettings.slanguagechangetitle 125 msgid "Language change" 126 msgstr "Změna jazyka" 127 122 128 #: ugame.sgameovercaption 123 129 msgid "Lost" 124 msgstr " "130 msgstr "Prohra" 125 131 126 132 #: ugame.sgameovermessage 127 133 msgid "Game over!" 128 msgstr " "134 msgstr "Konec hry!" 129 135 130 136 #: ugame.swincaption 131 137 msgid "Win" 132 msgstr " "138 msgstr "Vítězství" 133 139 134 140 #: ugame.swinmessage 135 141 msgid "You won! Do you want to continue to play?" 136 msgstr "" 137 142 msgstr "Vyhrál jsi! Chceš pokračovat ve hře?" -
trunk/Languages/Game2048.po
r12 r13 92 92 msgstr "" 93 93 94 #: tformsettings.label2.caption 95 msgid "Language:" 96 msgstr "" 97 94 98 #: uformabout.slicense 95 99 msgid "License" … … 102 106 #: uformabout.sversion 103 107 msgid "Version" 108 msgstr "" 109 110 #: uformsettings.slanguagechangemessage 111 msgid "Interface language was changed. It may require restart of application." 112 msgstr "" 113 114 #: uformsettings.slanguagechangetitle 115 msgid "Language change" 104 116 msgstr "" 105 117 -
trunk/UCore.pas
r11 r13 118 118 Game.Size := Point(ReadIntegerWithDefault('SizeX', 4), ReadIntegerWithDefault('SizeY', 4)); 119 119 Game.AnimationDuration := ReadIntegerWithDefault('AnimationDuration', 30); 120 if ValueExists('LanguageCode') then 121 Translator1.Language := Translator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', '')) 122 else Translator1.Language := Translator1.Languages.SearchByCode(''); 120 123 finally 121 124 Free; … … 133 136 WriteInteger('SizeY', Game.Size.Y); 134 137 WriteInteger('AnimationDuration', Game.AnimationDuration); 138 if Assigned(Translator1.Language) and (Translator1.Language.Code <> '') then 139 WriteString('LanguageCode', Translator1.Language.Code) 140 else DeleteValue('LanguageCode'); 135 141 finally 136 142 Free;
Note:
See TracChangeset
for help on using the changeset viewer.