- Timestamp:
- Sep 28, 2014, 2:36:03 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormSettings.lfm
r55 r68 29 29 object Label1: TLabel 30 30 Left = 20 31 Height = 2 531 Height = 22 32 32 Top = 26 33 Width = 9533 Width = 80 34 34 Caption = 'Language:' 35 35 ParentColor = False … … 37 37 object ComboBoxLanguage: TComboBox 38 38 Left = 178 39 Height = 3 739 Height = 34 40 40 Top = 24 41 41 Width = 196 … … 46 46 object CheckBoxDevelMode: TCheckBox 47 47 Left = 16 48 Height = 2 748 Height = 24 49 49 Top = 80 50 Width = 1 7650 Width = 157 51 51 Caption = 'Developer mode' 52 52 TabOrder = 3 53 53 end 54 object SpinEditAnimSpeed: TSpinEdit 55 Left = 184 56 Height = 32 57 Top = 120 58 Width = 122 59 TabOrder = 4 60 end 61 object Label2: TLabel 62 Left = 19 63 Height = 22 64 Top = 126 65 Width = 140 66 Caption = 'Animation speed:' 67 ParentColor = False 68 end 69 object Label3: TLabel 70 Left = 311 71 Height = 22 72 Top = 128 73 Width = 15 74 Caption = '%' 75 ParentColor = False 76 end 54 77 end -
trunk/Forms/UFormSettings.lrt
r55 r68 4 4 TFORMSETTINGS.LABEL1.CAPTION=Language: 5 5 TFORMSETTINGS.CHECKBOXDEVELMODE.CAPTION=Developer mode 6 TFORMSETTINGS.LABEL2.CAPTION=Animation speed: 7 TFORMSETTINGS.LABEL3.CAPTION=% -
trunk/Forms/UFormSettings.pas
r55 r68 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls; 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Spin; 9 10 10 11 type … … 18 19 ComboBoxLanguage: TComboBox; 19 20 Label1: TLabel; 21 Label2: TLabel; 22 Label3: TLabel; 23 SpinEditAnimSpeed: TSpinEdit; 20 24 private 21 25 { private declarations } … … 40 44 begin 41 45 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 42 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 43 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 44 CheckBoxDevelMode.Checked := Core.DevelMode; 46 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 47 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 48 CheckBoxDevelMode.Checked := Core.DevelMode; 49 SpinEditAnimSpeed.Value := Core.AnimationSpeed; 45 50 end; 46 51 … … 50 55 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 51 56 Core.DevelMode := CheckBoxDevelMode.Checked; 57 Core.AnimationSpeed := SpinEditAnimSpeed.Value; 52 58 end; 53 59 -
trunk/Languages/xtactics.cs.po
r64 r68 355 355 msgstr "Jazyk:" 356 356 357 #: tformsettings.label2.caption 358 msgid "Animation speed:" 359 msgstr "" 360 361 #: tformsettings.label3.caption 362 #, fuzzy 363 msgctxt "tformsettings.label3.caption" 364 msgid "%" 365 msgstr "%" 366 357 367 #: ucore.sendgame 358 368 msgid "End game?" -
trunk/Languages/xtactics.po
r64 r68 343 343 msgstr "" 344 344 345 #: tformsettings.label2.caption 346 msgid "Animation speed:" 347 msgstr "" 348 349 #: tformsettings.label3.caption 350 msgctxt "TFORMSETTINGS.LABEL3.CAPTION" 351 msgid "%" 352 msgstr "" 353 345 354 #: ucore.sendgame 346 355 msgid "End game?" -
trunk/UCore.pas
r65 r68 48 48 CountRepeat: Integer; Update: Boolean; var Confirm: Boolean); 49 49 procedure DoOnWin(Player: TPlayer); 50 procedure Delay(Time: Integer); 50 51 public 51 52 Game: TGame; … … 53 54 DevelMode: Boolean; 54 55 LastMapFileName: string; 55 View: TView;56 AnimationSpeed: Integer; 56 57 procedure UpdateActions; 57 58 procedure Init; … … 106 107 end; 107 108 109 procedure TCore.Delay(Time: Integer); 110 var 111 I: Integer; 112 const 113 Slice = 50; // ms 114 begin 115 while Time > 0 do begin 116 Application.ProcessMessages; 117 if Time > Slice then Sleep(Slice) else Sleep(Time); 118 Dec(Time, Slice); 119 end; 120 end; 121 108 122 procedure TCore.UpdateActions; 109 123 begin … … 146 160 Computer.Free; 147 161 FormMain.Redraw; 148 for I := 0 to 10 do begin 149 Application.ProcessMessages; 150 Sleep(100); 151 end; 162 Delay(Trunc((100 - AnimationSpeed) / 100 * 2000)); 152 163 end; 153 164 Game.NextTurn; … … 232 243 XMLConfig1.SetValue('LastMapFileName', LastMapFileName); 233 244 XMLConfig1.SetValue('DevelMode', DevelMode); 245 XMLConfig1.SetValue('AnimationSpeed', AnimationSpeed); 234 246 FreeAndNil(Game); 235 247 end; … … 242 254 LastMapFileName := XMLConfig1.GetValue('LastMapFileName', ''); 243 255 DevelMode := XMLConfig1.GetValue('DevelMode', false); 256 AnimationSpeed := XMLConfig1.GetValue('AnimationSpeed', 50); 244 257 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', '')); 245 258 for I := 0 to Game.Players.Count - 1 do -
trunk/UGame.pas
r67 r68 1092 1092 begin 1093 1093 SourceRect := Source.SourceRect; 1094 DestRect := Source.DestRect;1095 Zoom := Source.Zoom;1094 FDestRect := Source.DestRect; 1095 FZoom := Source.Zoom; 1096 1096 SelectedCell := Source.SelectedCell; 1097 1097 FocusedCell := Source.FocusedCell; -
trunk/xtactics.lpi
r66 r68 118 118 <HasResources Value="True"/> 119 119 <ResourceBaseClass Value="Form"/> 120 <UnitName Value="UFormSettings"/> 120 121 </Unit4> 121 122 <Unit5>
Note:
See TracChangeset
for help on using the changeset viewer.