Changeset 275 for trunk/Forms
- Timestamp:
- Feb 3, 2019, 11:28:03 PM (6 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r274 r275 18 18 object PageControl1: TPageControl 19 19 Left = 4 20 Height = 6 9221 Top = 420 Height = 636 21 Top = 60 22 22 Width = 806 23 ActivePage = TabSheet Rules23 ActivePage = TabSheetMode 24 24 Align = alClient 25 25 BorderSpacing.Around = 4 26 TabIndex = 326 TabIndex = 0 27 27 TabOrder = 0 28 28 OnChange = PageControl1Change 29 29 object TabSheetMode: TTabSheet 30 30 Caption = 'Mode' 31 ClientHeight = 65231 ClientHeight = 596 32 32 ClientWidth = 796 33 33 object Panel3: TPanel 34 34 Left = 0 35 Height = 65235 Height = 596 36 36 Top = 0 37 37 Width = 796 38 38 Align = alClient 39 39 BevelOuter = bvNone 40 ClientHeight = 65240 ClientHeight = 596 41 41 ClientWidth = 796 42 42 TabOrder = 0 … … 103 103 object ListViewServers: TListView 104 104 Left = 26 105 Height = 420105 Height = 364 106 106 Top = 181 107 107 Width = 334 … … 131 131 Left = 27 132 132 Height = 31 133 Top = 613133 Top = 557 134 134 Width = 94 135 135 Action = AServerAdd … … 140 140 Left = 240 141 141 Height = 31 142 Top = 613142 Top = 557 143 143 Width = 94 144 144 Action = AServerRemove … … 149 149 Left = 136 150 150 Height = 30 151 Top = 613151 Top = 557 152 152 Width = 94 153 153 Action = AServerModify … … 159 159 object TabSheetPlayers: TTabSheet 160 160 Caption = 'Players' 161 ClientHeight = 652161 ClientHeight = 596 162 162 ClientWidth = 796 163 163 object Panel2: TPanel … … 241 241 object TabSheetMap: TTabSheet 242 242 Caption = 'Map' 243 ClientHeight = 652243 ClientHeight = 596 244 244 ClientWidth = 796 245 245 OnShow = TabSheetMapShow … … 542 542 object TabSheetRules: TTabSheet 543 543 Caption = 'Rules' 544 ClientHeight = 652544 ClientHeight = 596 545 545 ClientWidth = 796 546 546 object Panel4: TPanel … … 754 754 object PanelChat: TPanel 755 755 Left = 820 756 Height = 700757 Top = 0756 Height = 644 757 Top = 56 758 758 Width = 391 759 759 Align = alRight … … 763 763 object Splitter1: TSplitter 764 764 Left = 814 765 Height = 700766 Top = 0765 Height = 644 766 Top = 56 767 767 Width = 6 768 768 Align = alRight 769 769 ResizeAnchor = akRight 770 end 771 object Panel5: TPanel 772 Left = 0 773 Height = 56 774 Top = 0 775 Width = 1211 776 Align = alTop 777 BevelOuter = bvNone 778 ClientHeight = 56 779 ClientWidth = 1211 780 TabOrder = 4 781 object Label16: TLabel 782 Left = 12 783 Height = 26 784 Top = 16 785 Width = 121 786 Caption = 'Game system:' 787 ParentColor = False 788 end 789 object ComboBoxGameSystem: TComboBox 790 Left = 176 791 Height = 43 792 Top = 9 793 Width = 254 794 ItemHeight = 0 795 Style = csDropDownList 796 TabOrder = 0 797 end 798 object ButtonGameSystems: TButton 799 Left = 443 800 Height = 38 801 Top = 12 802 Width = 113 803 Caption = 'Manage' 804 OnClick = ButtonGameSystemsClick 805 TabOrder = 1 806 end 770 807 end 771 808 object ActionList1: TActionList -
trunk/Forms/UFormNew.pas
r274 r275 25 25 Button2: TButton; 26 26 Button3: TButton; 27 ButtonGameSystems: TButton; 27 28 ButtonRandomize: TButton; 28 29 ButtonCancel: TButton; … … 41 42 CheckBoxUnitsMoveImmediately: TCheckBox; 42 43 CheckBoxVoid: TCheckBox; 44 ComboBoxGameSystem: TComboBox; 43 45 ComboBoxGridType: TComboBox; 44 46 ComboBoxMapShape: TComboBox; … … 54 56 Label14: TLabel; 55 57 Label15: TLabel; 58 Label16: TLabel; 56 59 Label2: TLabel; 57 60 Label3: TLabel; … … 117 120 procedure AServerModifyExecute(Sender: TObject); 118 121 procedure AServerRemoveExecute(Sender: TObject); 122 procedure ButtonGameSystemsClick(Sender: TObject); 119 123 procedure ButtonImageBrowseClick(Sender: TObject); 120 124 procedure ButtonRandomizeClick(Sender: TObject); … … 169 173 procedure MapPreviewPaint; 170 174 procedure MapPreviewRedraw; 175 procedure ReloadGameSystemsMenu; 171 176 public 172 177 procedure Translate; … … 186 191 187 192 uses 188 UFormPlayer, UFormChat, UCore, UFormServer, UClientGUI, UFormClient; 193 UFormPlayer, UFormChat, UCore, UFormServer, UClientGUI, UFormClient, 194 UFormGameSystems; 189 195 190 196 resourcestring … … 403 409 end; 404 410 411 procedure TFormNew.ReloadGameSystemsMenu; 412 var 413 I: Integer; 414 LastSystem: Pointer; 415 begin 416 if ComboBoxGameSystem.ItemIndex <> -1 then 417 LastSystem := ComboBoxGameSystem.Items.Objects[ComboBoxGameSystem.ItemIndex] 418 else LastSystem := nil; 419 ComboBoxGameSystem.Items.BeginUpdate; 420 try 421 while ComboBoxGameSystem.Items.Count > Core.GameSystems.Count do 422 ComboBoxGameSystem.Items.Delete(ComboBoxGameSystem.Items.Count - 1); 423 while ComboBoxGameSystem.Items.Count < Core.GameSystems.Count do 424 ComboBoxGameSystem.Items.Add(''); 425 for I := 0 to Core.GameSystems.Count - 1 do begin 426 ComboBoxGameSystem.Items[I] := Core.GameSystems[I].Name; 427 ComboBoxGameSystem.Items.Objects[I] := Core.GameSystems[I]; 428 end; 429 if Assigned(LastSystem) then 430 ComboBoxGameSystem.ItemIndex := ComboBoxGameSystem.Items.IndexOfObject(LastSystem); 431 if (ComboBoxGameSystem.ItemIndex = -1) and (ComboBoxGameSystem.Items.Count > 0) then 432 ComboBoxGameSystem.ItemIndex := 0; 433 finally 434 ComboBoxGameSystem.Items.EndUpdate; 435 end; 436 end; 437 405 438 procedure TFormNew.MapPreviewPaint; 406 439 var … … 525 558 Core.PersistentForm.Load(Self); 526 559 Core.ThemeManager1.UseTheme(Self); 560 ReloadGameSystemsMenu; 527 561 ReloadView; 528 562 //Height := Trunc(1.5 * Height); … … 678 712 ServerList.Items.Delete(I); 679 713 ReloadView; 714 end; 715 end; 716 717 procedure TFormNew.ButtonGameSystemsClick(Sender: TObject); 718 begin 719 FormGameSystems := TFormGameSystems.Create(nil); 720 try 721 FormGameSystems.GameSystems := Core.GameSystems; 722 FormGameSystems.ShowModal; 723 ReloadGameSystemsMenu; 724 finally 725 FreeAndNil(FormGameSystems); 680 726 end; 681 727 end;
Note:
See TracChangeset
for help on using the changeset viewer.