Changeset 381 for trunk/Packages


Ignore:
Timestamp:
Apr 25, 2021, 11:00:24 AM (4 years ago)
Author:
chronos
Message:
  • Fixed: Error if map without map picture was renamed.
  • Fixed: Copy default map files and example saved game only once if such target directories don't exist yet.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/Directories.pas

    r379 r381  
    7979end;
    8080
     81procedure CopyFiles;
     82begin
     83  if DirectoryExists(GetSavedDir(True)) and not DirectoryExists(GetSavedDir(False)) then
     84    CopyDir(GetSavedDir(True), GetSavedDir(False), '*.*');
     85  if DirectoryExists(GetMapsDir(True)) and not DirectoryExists(GetMapsDir(False)) then
     86    CopyDir(GetMapsDir(True), GetMapsDir(False), '*.*');
     87end;
     88
    8189procedure UnitInit;
    8290var
     
    8795
    8896  AppDataDir := GetAppConfigDir(False);
    89   if AppDataDir = '' then
    90     DataDir := HomeDir
    91   else
    92   begin
     97  if AppDataDir = '' then DataDir := HomeDir
     98  else begin
    9399    if not DirectoryExists(AppDataDir) then ForceDirectories(AppDataDir);
    94100    DataDir := AppDataDir;
    95101  end;
    96 
    97   CopyDir(GetSavedDir(True), GetSavedDir(False), '*.*');
    98   CopyDir(GetMapsDir(True), GetMapsDir(False), '*.*');
     102  CopyFiles;
    99103end;
    100104
Note: See TracChangeset for help on using the changeset viewer.