Changeset 276 for trunk/Forms
- Timestamp:
- Feb 3, 2019, 11:55:30 PM (6 years ago)
- Location:
- trunk/Forms
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormGameSystem.lfm
r275 r276 8 8 ClientWidth = 781 9 9 DesignTimePPI = 144 10 OnClose = FormClose 11 OnCreate = FormCreate 12 OnShow = FormShow 10 13 LCLVersion = '1.8.4.0' 11 14 object ButtonSave: TButton … … 14 17 Top = 528 15 18 Width = 113 16 Anchors = [ak Top, akLeft, akBottom]19 Anchors = [akLeft, akBottom] 17 20 Caption = 'Save' 18 21 OnClick = ButtonSaveClick … … 30 33 end 31 34 object ButtonCancel: TButton 32 Left = 47235 Left = 504 33 36 Height = 38 34 37 Top = 528 35 38 Width = 113 36 Anchors = [ak Left]39 Anchors = [akRight] 37 40 Caption = 'Cancel' 38 41 ModalResult = 2 … … 40 43 end 41 44 object ButtonOk: TButton 42 Left = 6 1645 Left = 647 43 46 Height = 38 44 Top = 52 947 Top = 528 45 48 Width = 113 46 Anchors = [ak Left, akBottom]49 Anchors = [akRight, akBottom] 47 50 Caption = 'OK' 48 51 ModalResult = 1 49 52 TabOrder = 3 53 end 54 object PageControl1: TPageControl 55 Left = 16 56 Height = 496 57 Top = 16 58 Width = 744 59 ActivePage = TabSheetGeneral 60 Anchors = [akTop, akLeft, akRight, akBottom] 61 TabIndex = 0 62 TabOrder = 4 63 object TabSheetGeneral: TTabSheet 64 Caption = 'General' 65 ClientHeight = 456 66 ClientWidth = 734 67 object CheckBoxEmptyCellsNeutral: TCheckBox 68 Left = 16 69 Height = 30 70 Top = 16 71 Width = 362 72 Caption = 'Set cells without player units as neutral' 73 TabOrder = 0 74 end 75 object CheckBoxUnitsSplitMerge: TCheckBox 76 Left = 16 77 Height = 30 78 Top = 55 79 Width = 231 80 Caption = 'Units can split or merge' 81 TabOrder = 1 82 end 83 object CheckBoxUnitsMoveImmediately: TCheckBox 84 Left = 16 85 Height = 30 86 Top = 95 87 Width = 234 88 Caption = 'Units move immediately' 89 TabOrder = 2 90 end 91 end 92 object TabSheetUnits: TTabSheet 93 Caption = 'Units' 94 end 50 95 end 51 96 object OpenDialog1: TOpenDialog -
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 -
trunk/Forms/UFormGameSystems.pas
r275 r276 67 67 SRemoveItems = 'Remove items'; 68 68 SRemoveItemsQuery = 'Do you want to remove selected items?'; 69 69 SNewGameSystem = 'New game system'; 70 70 71 71 { TFormGameSystems } … … 96 96 with TGameSystem(ListView1.Selected.Data) do begin 97 97 TempEntry := TGameSystem.Create; 98 TempEntry.Assign(TGameSystem(ListView1.Selected.Data)); 98 99 FormGameSystem := TFormGameSystem.Create(Self); 99 100 try … … 101 102 if FormGameSystem.ShowModal = mrOk then begin 102 103 FormGameSystem.SaveData(TempEntry); 104 TGameSystem(ListView1.Selected.Data).Assign(TempEntry); 103 105 UpdateList; 104 106 UpdateInterface; … … 118 120 FormGameSystem := TFormGameSystem.Create(Self); 119 121 try 122 TempEntry.FileName := SNewGameSystem + GameSystemExt; 120 123 FormGameSystem.LoadData(TempEntry); 121 124 if FormGameSystem.ShowModal = mrOk then begin 122 125 FormGameSystem.SaveData(TempEntry); 126 TGameSystem(ListView1.Selected.Data).Assign(TempEntry); 123 127 UpdateList; 124 128 UpdateInterface; … … 165 169 if Item.Index < ListView1.Items.Count then 166 170 with TGameSystem(GameSystems[Item.Index]) do begin 167 Item.Caption := Name;171 Item.Caption := GetName; 168 172 Item.Data := GameSystems[Item.Index]; 169 173 end; -
trunk/Forms/UFormNew.lfm
r275 r276 21 21 Top = 60 22 22 Width = 806 23 ActivePage = TabSheet Mode23 ActivePage = TabSheetRules 24 24 Align = alClient 25 25 BorderSpacing.Around = 4 26 TabIndex = 026 TabIndex = 3 27 27 TabOrder = 0 28 28 OnChange = PageControl1Change … … 546 546 object Panel4: TPanel 547 547 Left = 0 548 Height = 652548 Height = 596 549 549 Top = 0 550 550 Width = 796 551 551 Align = alClient 552 552 BevelOuter = bvNone 553 ClientHeight = 652553 ClientHeight = 596 554 554 ClientWidth = 796 555 555 TabOrder = 0 … … 694 694 end 695 695 end 696 object CheckBoxEmptyCellsNeutral: TCheckBox697 Left = 336698 Height = 30699 Top = 62700 Width = 362701 Caption = 'Set cells without player units as neutral'702 TabOrder = 5703 end704 object CheckBoxUnitsSplitMerge: TCheckBox705 Left = 336706 Height = 30707 Top = 101708 Width = 231709 Caption = 'Units can split or merge'710 TabOrder = 6711 end712 object CheckBoxUnitsMoveImmediately: TCheckBox713 Left = 336714 Height = 30715 Top = 141716 Width = 234717 Caption = 'Units move immediately'718 TabOrder = 7719 end720 696 end 721 697 end -
trunk/Forms/UFormNew.pas
r275 r276 33 33 ButtonPlayerModify: TButton; 34 34 ButtonPlayerRemove: TButton; 35 CheckBoxUnitsSplitMerge: TCheckBox;36 CheckBoxEmptyCellsNeutral: TCheckBox;37 35 CheckBoxBridges: TCheckBox; 38 36 CheckBoxCity: TCheckBox; … … 40 38 CheckBoxFogOfWar: TCheckBox; 41 39 CheckBoxSymetricMap: TCheckBox; 42 CheckBoxUnitsMoveImmediately: TCheckBox;43 40 CheckBoxVoid: TCheckBox; 44 41 ComboBoxGameSystem: TComboBox; … … 192 189 uses 193 190 UFormPlayer, UFormChat, UCore, UFormServer, UClientGUI, UFormClient, 194 UFormGameSystems ;191 UFormGameSystems, UGameSystem; 195 192 196 193 resourcestring … … 367 364 SpinEditTurns.Value := StayAliveForDefinedTurns; 368 365 SpinEditSpecialCells.Value := SpecialCaptureCellCount; 369 CheckBoxEmptyCellsNeutral.Checked := GameSystem.EmptyCellsNeutral; 370 CheckBoxUnitsSplitMerge.Checked := GameSystem.UnitsSplitMerge; 371 CheckBoxUnitsMoveImmediately.Checked := GameSystem.UnitsMoveImmediately; 366 ComboBoxGameSystem.ItemIndex := ComboBoxGameSystem.Items.IndexOf(GameSystemName); 372 367 end; 373 368 end; … … 398 393 StayAliveForDefinedTurns := SpinEditTurns.Value; 399 394 SpecialCaptureCellCount := SpinEditSpecialCells.Value; 400 GameSystem.EmptyCellsNeutral := CheckBoxEmptyCellsNeutral.Checked; 401 GameSystem.UnitsSplitMerge := CheckBoxUnitsSplitMerge.Checked; 402 GameSystem.UnitsMoveImmediately := CheckBoxUnitsMoveImmediately.Checked; 395 GameSystem := TGameSystem(ComboBoxGameSystem.Items.Objects[ComboBoxGameSystem.ItemIndex]); 396 GameSystemName := GameSystem.GetName; 403 397 end; 404 398 end; … … 424 418 ComboBoxGameSystem.Items.Add(''); 425 419 for I := 0 to Core.GameSystems.Count - 1 do begin 426 ComboBoxGameSystem.Items[I] := Core.GameSystems[I]. Name;420 ComboBoxGameSystem.Items[I] := Core.GameSystems[I].GetName; 427 421 ComboBoxGameSystem.Items.Objects[I] := Core.GameSystems[I]; 428 422 end; … … 558 552 Core.PersistentForm.Load(Self); 559 553 Core.ThemeManager1.UseTheme(Self); 560 ReloadGameSystemsMenu;561 554 ReloadView; 562 555 //Height := Trunc(1.5 * Height); … … 773 766 procedure TFormNew.Load(Server: TServer); 774 767 begin 768 ReloadGameSystemsMenu; 775 769 with Server do begin 776 770 RadioButtonModeLocal.Checked := Mode = smLocal;
Note:
See TracChangeset
for help on using the changeset viewer.