Changeset 189 for trunk/Start.pas
- Timestamp:
- May 7, 2020, 12:46:55 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r188 r189 153 153 invalidateTab0: boolean = false); overload; 154 154 procedure LoadConfig; 155 procedure SaveConfig; 155 156 end; 156 157 … … 162 163 163 164 uses 164 Directories, Direct, ScreenTools, Inp, Back, Locale, PixelPointer;165 Global, Directories, Direct, ScreenTools, Inp, Back, Locale, PixelPointer; 165 166 166 167 {$R *.lfm} 167 168 168 169 const 169 CevoExt = '.cevo';170 CevoMapExt = '.cevo map';171 170 // predefined world size 172 171 // attention: lx*ly+1 must be prime! … … 467 466 DirectDlg.Top := (Screen.Height - DirectDlg.Height) div 2; 468 467 469 if FullScreen then 470 begin 468 if FullScreen then begin 471 469 Location := Point((Screen.Width - 800) * 3 div 8, 472 470 Screen.Height - Height - (Screen.Height - 600) div 3); … … 484 482 SetWindowRgn(Handle, r0, False); 485 483 DeleteObject(r0); // causes crash with Windows 95 486 end 487 else 488 begin 484 end else begin 489 485 Left := (Screen.Width - Width) div 2; 490 486 Top := (Screen.Height - Height) div 2; … … 599 595 procedure TStartDlg.FormDestroy(Sender: TObject); 600 596 begin 597 SaveConfig; 601 598 FreeAndNil(FormerGames); 602 599 FreeAndNil(Maps); … … 622 619 DeleteObject(r1); 623 620 end; 624 if not invalidateTab0 then 625 begin 621 if not invalidateTab0 then begin 626 622 r1 := CreateRectRgn(0, 0, 6 + 36, 3 + 38); // tab 0 icon 627 623 CombineRgn(r0, r0, r1, RGN_DIFF); … … 652 648 WriteInteger('Diff' + IntToStr(I), 2); 653 649 end; 654 WriteInteger('MultiControl', 0);655 650 656 651 OpenKey(AppRegistryKey, True); 652 if ValueExists('Gamma') then Gamma := ReadInteger('Gamma') 653 else Gamma := 100; 654 if Gamma <> 100 then InitGammaLookupTable; 655 if ValueExists('Locale') then LocaleCode := ReadString('Locale') 656 else LocaleCode := ''; 657 657 if ValueExists('WorldSize') then WorldSize := Reg.ReadInteger('WorldSize') 658 658 else WorldSize := DefaultWorldSize; … … 680 680 if ValueExists('ResolutionFreq') then 681 681 ResolutionFreq := ReadInteger('ResolutionFreq'); 682 if ValueExists('MultiControl') then 683 MultiControl := ReadInteger('MultiControl') 684 else MultiControl := 0; 682 685 {$IFDEF WINDOWS} 683 686 if ScreenMode = 2 then … … 685 688 ResolutionFreq); 686 689 {$ENDIF} 690 finally 691 Free; 692 end; 693 end; 694 695 procedure TStartDlg.SaveConfig; 696 var 697 Reg: TRegistry; 698 begin 699 Reg := TRegistry.Create; 700 with Reg do try 701 OpenKey(AppRegistryKey, True); 702 WriteInteger('WorldSize', WorldSize); 703 WriteInteger('LandMass', StartLandMass); 704 WriteString('Locale', LocaleCode); 705 WriteInteger('Gamma', Gamma); 706 if FullScreen then WriteInteger('ScreenMode', 1) 707 else WriteInteger('ScreenMode', 0); 708 WriteInteger('MultiControl', MultiControl); 687 709 finally 688 710 Free; … … 1163 1185 end; 1164 1186 1165 // save settings and AI assignment1187 // Save settings and AI assignment 1166 1188 if Page = pgStartRandom then begin 1167 WriteInteger('WorldSize', WorldSize); 1168 WriteInteger('LandMass', StartLandMass); 1169 1189 SaveConfig; 1170 1190 OpenKey(AppRegistryKey + '\AI', True); 1171 1191 if AutoDiff < 0 then … … 1177 1197 WriteInteger('Diff' + IntToStr(I), Difficulty[I]); 1178 1198 end; 1179 WriteInteger('MultiControl', MultiControl);1180 1199 end; 1181 1200 … … 1237 1256 MapFileName := Format(Phrases.Lookup('MAP'), [MapCount]) + CevoMapExt; 1238 1257 EditMap(MapFileName, WorldSizes[WorldSize].X, WorldSizes[WorldSize].Y, StartLandMass); 1239 end 1240 end 1258 end; 1259 end; 1241 1260 end; 1242 1261 … … 1505 1524 PlayersBrain[p1] := Brains[j]; 1506 1525 end; 1507 MultiControl := Reg.ReadInteger('MultiControl');1508 1526 finally 1509 1527 Free; … … 1655 1673 OpenDocument(pchar(HomeDir + 'AI Template' + DirectorySeparator + 'AI development manual.html')); 1656 1674 maWeb: 1657 OpenURL( 'http://c-evo.org')1675 OpenURL(CevoHomepage); 1658 1676 end; 1659 1677 end
Note:
See TracChangeset
for help on using the changeset viewer.