Changeset 276 for trunk/Forms/UFormGameSystem.pas
- Timestamp:
- Feb 3, 2019, 11:55:30 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormGameSystem.pas
r275 r276 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UGameSystem;9 ComCtrls, UGameSystem; 10 10 11 11 type … … 18 18 ButtonSave: TButton; 19 19 ButtonLoad: TButton; 20 CheckBoxEmptyCellsNeutral: TCheckBox; 21 CheckBoxUnitsMoveImmediately: TCheckBox; 22 CheckBoxUnitsSplitMerge: TCheckBox; 20 23 OpenDialog1: TOpenDialog; 24 PageControl1: TPageControl; 21 25 SaveDialog1: TSaveDialog; 26 TabSheetGeneral: TTabSheet; 27 TabSheetUnits: TTabSheet; 22 28 procedure ButtonLoadClick(Sender: TObject); 23 29 procedure ButtonSaveClick(Sender: TObject); 30 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 31 procedure FormCreate(Sender: TObject); 32 procedure FormShow(Sender: TObject); 24 33 private 25 34 FGameSystem: TGameSystem; … … 38 47 implementation 39 48 49 {$R *.lfm} 50 51 uses 52 UCore; 53 40 54 resourcestring 41 55 SFileDialogFilter = 'xTactics game system (.xts)|*.xts|All files|*.*'; 42 43 44 {$R *.lfm}45 56 46 57 { TFormGameSystem } … … 62 73 SaveDialog1.InitialDir := ExtractFileDir(GameSystem.FileName); 63 74 SaveDialog1.FileName := ExtractFileName(GameSystem.FileName); 75 SaveDialog1.DefaultExt := GameSystemExt; 64 76 if SaveDialog1.Execute then begin 65 77 GameSystem.SaveToFile(SaveDialog1.FileName); 66 78 end; 79 end; 80 81 procedure TFormGameSystem.FormClose(Sender: TObject; 82 var CloseAction: TCloseAction); 83 begin 84 Core.PersistentForm.Save(Self); 85 end; 86 87 procedure TFormGameSystem.FormCreate(Sender: TObject); 88 begin 89 Core.ThemeManager1.UseTheme(Self); 90 Core.CoolTranslator1.TranslateComponentRecursive(Self); 91 end; 92 93 procedure TFormGameSystem.FormShow(Sender: TObject); 94 begin 95 Core.PersistentForm.Load(Self); 67 96 end; 68 97 … … 75 104 procedure TFormGameSystem.LoadData(GameSystem: TGameSystem); 76 105 begin 77 106 Self.GameSystem := GameSystem; 107 CheckBoxEmptyCellsNeutral.Checked := GameSystem.EmptyCellsNeutral; 108 CheckBoxUnitsSplitMerge.Checked := GameSystem.UnitsSplitMerge; 109 CheckBoxUnitsMoveImmediately.Checked := GameSystem.UnitsMoveImmediately; 78 110 end; 79 111 80 112 procedure TFormGameSystem.SaveData(GameSystem: TGameSystem); 81 113 begin 82 114 GameSystem.EmptyCellsNeutral := CheckBoxEmptyCellsNeutral.Checked; 115 GameSystem.UnitsSplitMerge := CheckBoxUnitsSplitMerge.Checked; 116 GameSystem.UnitsMoveImmediately := CheckBoxUnitsMoveImmediately.Checked; 83 117 end; 84 118
Note:
See TracChangeset
for help on using the changeset viewer.