Changeset 270 for trunk/Forms
- Timestamp:
- Jan 28, 2019, 10:38:17 PM (6 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r269 r270 518 518 Top = 272 519 519 Width = 359 520 Anchors = [akTop, akLeft, akRight] 521 OnResize = Image1Resize 520 522 end 521 523 object Label15: TLabel … … 523 525 Height = 26 524 526 Top = 240 525 Width = 147 526 Caption = 'Random preview:' 527 ParentColor = False 527 Width = 71 528 Caption = 'Preview:' 529 ParentColor = False 530 end 531 object ButtonRandomize: TButton 532 Left = 10 533 Height = 38 534 Top = 540 535 Width = 153 536 Caption = 'Randomize' 537 OnClick = ButtonRandomizeClick 538 TabOrder = 17 528 539 end 529 540 end -
trunk/Forms/UFormNew.pas
r269 r270 25 25 Button2: TButton; 26 26 Button3: TButton; 27 ButtonRandomize: TButton; 27 28 ButtonCancel: TButton; 28 29 ButtonImageBrowse: TButton; … … 115 116 procedure AServerRemoveExecute(Sender: TObject); 116 117 procedure ButtonImageBrowseClick(Sender: TObject); 118 procedure ButtonRandomizeClick(Sender: TObject); 117 119 procedure CheckBoxBridgesChange(Sender: TObject); 118 120 procedure CheckBoxCityChange(Sender: TObject); … … 128 130 procedure FormDestroy(Sender: TObject); 129 131 procedure FormShow(Sender: TObject); 132 procedure Image1Resize(Sender: TObject); 130 133 procedure ListViewPlayersCustomDrawSubItem(Sender: TCustomListView; 131 134 Item: TListItem; SubItem: Integer; State: TCustomDrawState; … … 159 162 GamePreview: TGame; 160 163 MapPreviewRedrawPending: Boolean; 164 NewRandSeed: Cardinal; 161 165 procedure LoadGame(Game: TGame); 162 166 procedure SaveGame(Game: TGame); … … 363 367 Game.Players.Assign(Players); 364 368 with Game do begin 369 StoredRandSeed := NewRandSeed; 365 370 SymetricMap := CheckBoxSymetricMap.Checked; 366 371 CyclicMap := CheckBoxCyclicMap.Checked; … … 397 402 Bitmap: TBitmap; 398 403 begin 404 Image1.Height := Round(Image1.Width * SpinEditMapSizeY.Value / SpinEditMapSizeX.Value); 399 405 GamePreview.GameSystem := Core.GameSystems.First; 400 406 SaveGame(GamePreview); … … 508 514 procedure TFormNew.FormShow(Sender: TObject); 509 515 begin 516 Randomize; 517 NewRandSeed := RandSeed; 510 518 Core.PersistentForm.Load(Self); 511 519 Core.ThemeManager1.UseTheme(Self); … … 517 525 TabSheetMode.Enabled := False; 518 526 {$ENDIF} 527 end; 528 529 procedure TFormNew.Image1Resize(Sender: TObject); 530 begin 531 MapPreviewRedraw; 519 532 end; 520 533 … … 667 680 EditImageFile.Text := OpenPictureDialog1.FileName; 668 681 end; 682 end; 683 684 procedure TFormNew.ButtonRandomizeClick(Sender: TObject); 685 begin 686 Randomize; 687 NewRandSeed := RandSeed; 688 MapPreviewRedraw; 669 689 end; 670 690
Note:
See TracChangeset
for help on using the changeset viewer.