Changeset 281 for trunk/Forms/UFormNew.pas
- Timestamp:
- Feb 21, 2019, 10:45:41 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.