Changeset 381 for trunk/Start.pas


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/Start.pas

    r373 r381  
    16241624  f: file;
    16251625  ok: boolean;
     1626  MapPictureFileName: string;
    16261627begin
    16271628  if List.ItemIndex >= 0 then
     
    16441645        begin
    16451646          SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[i]]));
    1646           exit
     1647          Exit;
    16471648        end;
    16481649      if Page = pgLoad then
     
    16591660      except
    16601661        // Play('INVALID');
    1661         ok := false
    1662       end;
    1663       if Page <> pgLoad then
    1664         try // rename map picture
     1662        ok := False;
     1663      end;
     1664      if Page <> pgLoad then begin
     1665        // Rename map picture
     1666        MapPictureFileName := GetMapsDir + DirectorySeparator +
     1667          List.Items[List.ItemIndex] + CevoMapPictureExt;
     1668        if FileExists(MapPictureFileName) then
     1669        try
    16651670          AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]
    1666             + '.png');
    1667           Rename(f, GetMapsDir + DirectorySeparator + NewName + '.png');
     1671            + CevoMapPictureExt);
     1672          Rename(f, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);
    16681673        except
    16691674        end;
    1670       if ok then
    1671       begin
     1675      end;
     1676      if ok then begin
    16721677        if Page = pgLoad then
    16731678          FormerGames[List.ItemIndex] := NewName
Note: See TracChangeset for help on using the changeset viewer.