Changeset 281 for trunk/Forms
- Timestamp:
- Feb 21, 2019, 10:45:41 PM (6 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r279 r281 21 21 Top = 60 22 22 Width = 806 23 ActivePage = TabSheet Players23 ActivePage = TabSheetMap 24 24 Align = alClient 25 25 BorderSpacing.Around = 4 26 TabIndex = 126 TabIndex = 2 27 27 TabOrder = 0 28 28 OnChange = PageControl1Change … … 178 178 object Panel1: TPanel 179 179 Left = 0 180 Height = 652180 Height = 596 181 181 Top = 0 182 182 Width = 796 183 183 Align = alClient 184 184 BevelOuter = bvNone 185 ClientHeight = 652185 ClientHeight = 596 186 186 ClientWidth = 796 187 187 TabOrder = 0 … … 260 260 Height = 38 261 261 Top = 104 262 Width = 208262 Width = 304 263 263 ItemHeight = 0 264 264 Items.Strings = ( … … 277 277 Height = 38 278 278 Top = 144 279 Width = 208279 Width = 304 280 280 ItemHeight = 0 281 281 Items.Strings = ( … … 579 579 object TabSheetCaptureCells: TTabSheet 580 580 ClientHeight = 74 581 ClientWidth = 76 3581 ClientWidth = 769 582 582 object Label14: TLabel 583 583 Left = 8 … … 601 601 object TabSheetStayAliveTurns: TTabSheet 602 602 ClientHeight = 74 603 ClientWidth = 76 3603 ClientWidth = 769 604 604 object Label13: TLabel 605 605 Left = 8 … … 701 701 Width = 254 702 702 ItemHeight = 0 703 OnChange = ComboBoxGameSystemChange 703 704 Style = csDropDownList 704 705 TabOrder = 0 -
trunk/Forms/UFormNew.pas
r279 r281 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 ComCtrls, Spin, ExtCtrls, ActnList, ExtDlgs, Menus, UGame, UGeometry, UPlayer, 10 UGameServer, UServerList, UMap, UFormPlayers ;10 UGameServer, UServerList, UMap, UFormPlayers, UGameSystem; 11 11 12 12 type … … 111 111 procedure CheckBoxSymetricMapChange(Sender: TObject); 112 112 procedure CheckBoxVoidChange(Sender: TObject); 113 procedure ComboBoxGameSystemChange(Sender: TObject); 113 114 procedure ComboBoxGridTypeChange(Sender: TObject); 114 115 procedure ComboBoxMapShapeChange(Sender: TObject); … … 143 144 NewRandSeed: Cardinal; 144 145 FormPlayers: TFormPlayers; 146 GameSystem: TGameSystem; 145 147 procedure LoadGame(Game: TGame); 146 148 procedure SaveGame(Game: TGame); … … 165 167 166 168 uses 167 UForm Player, UFormChat, UCore, UFormServer, UClientGUI, UFormClient,168 UFormGameSystems, U GameSystem;169 UFormChat, UCore, UFormServer, UClientGUI, UFormClient, 170 UFormGameSystems, UMapType; 169 171 170 172 resourcestring 171 SGridTypeHexagon = 'Hexagonal';172 SGridTypeSquare = 'Square';173 SGridTypeTriangle = 'Triangural';174 SGridTypeRandom = 'Random';175 SGridTypeIsometric = 'Isometric';176 173 SWinObjectiveNone = 'None'; 177 174 SWinObjectiveDefeatAllOponents = 'Defeat all oponents'; … … 296 293 RadioGroupGrowAmount.ItemIndex := Integer(GrowAmount); 297 294 RadioGroupGrowCells.ItemIndex := Integer(GrowCells); 298 ComboBoxGridType.ItemIndex := Integer(MapType) - 1;295 ComboBoxGridType.ItemIndex := ComboBoxGridType.Items.IndexOfObject(TObject(MapType)); 299 296 ComboBoxWinObjective.ItemIndex := Integer(WinObjective); 300 297 SpinEditNeutralUnits.Value := MaxNeutralUnits; … … 325 322 GrowAmount := TGrowAmount(RadioGroupGrowAmount.ItemIndex); 326 323 GrowCells := TGrowCells(RadioGroupGrowCells.ItemIndex); 327 MapType := TMapType(ComboBoxGridType.Item Index + 1);324 MapType := TMapType(ComboBoxGridType.Items.Objects[ComboBoxGridType.ItemIndex]); 328 325 WinObjective := TWinObjective(ComboBoxWinObjective.ItemIndex); 329 326 MaxNeutralUnits := SpinEditNeutralUnits.Value; … … 406 403 LastIndex := ItemIndex; 407 404 Clear; 408 Items.Add(SGridTypeHexagon); 409 Items.Add(SGridTypeSquare); 410 Items.Add(SGridTypeTriangle); 411 Items.Add(SGridTypeRandom); 412 Items.Add(SGridTypeIsometric); 405 Items.AddObject(SGridTypeHexagonVertical, TObject(mtHexagonVertical)); 406 Items.AddObject(SGridTypeHexagonHorizontal, TObject(mtHexagonHorizontal)); 407 Items.AddObject(SGridTypeSquare, TObject(mtSquare)); 408 Items.AddObject(SGridTypeTriangle, TObject(mtTriangle)); 409 Items.AddObject(SGridTypeRandom, TObject(mtRandom)); 410 Items.AddObject(SGridTypeIsometric, TObject(mtIsometric)); 413 411 ItemIndex := LastIndex; 414 412 end; … … 462 460 WinObjective: TWinObjective; 463 461 begin 462 GameSystem := TGameSystem(ComboBoxGameSystem.Items.Objects[ComboBoxGameSystem.ItemIndex]); 463 ComboBoxGridType.Enabled := GameSystem.PreferedMapType = mtNone; 464 if GameSystem.PreferedMapType <> mtNone then 465 ComboBoxGridType.ItemIndex := ComboBoxGridType.Items.IndexOfObject(TObject(GameSystem.PreferedMapType)); 464 466 EditImageFile.Enabled := ComboBoxMapShape.ItemIndex = Integer(msImage); 465 467 ButtonImageBrowse.Enabled := ComboBoxMapShape.ItemIndex = Integer(msImage); … … 544 546 end; 545 547 548 procedure TFormNew.ComboBoxGameSystemChange(Sender: TObject); 549 begin 550 UpdateInterface; 551 MapPreviewRedraw; 552 end; 553 546 554 procedure TFormNew.ComboBoxGridTypeChange(Sender: TObject); 547 555 begin
Note:
See TracChangeset
for help on using the changeset viewer.