Ignore:
Timestamp:
Jan 4, 2026, 6:07:38 PM (3 days ago)
Author:
chronos
Message:
  • Modified: Do not store .png file extension in graphics names in book files. This is for compatibility with older C-evo versions.
File:
1 edited

Legend:

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

    r711 r715  
    116116
    117117const
     118  BmpExt = '.bmp';
     119  PngExt = '.png';
     120  JpgExt = '.jpg';
     121
    118122  TransparentColor1 = $FF00FF;
    119123  TransparentColor2 = $7F007F;
     
    434438  Result := False;
    435439  if ExtractFileExt(FileName) = '' then
    436     FileName := FileName + '.png';
     440    FileName := FileName + PngExt;
    437441
    438442  if FileExists(FileName) then begin
    439     if ExtractFileExt(FileName) = '.jpg' then begin
     443    if ExtractFileExt(FileName) = JpgExt then begin
    440444      Jpeg := TJpegImage.Create;
    441445      try
     
    451455      FreeAndNil(Jpeg);
    452456    end else
    453     if ExtractFileExt(FileName) = '.png' then begin
     457    if ExtractFileExt(FileName) = PngExt then begin
    454458      Png := TPortableNetworkGraphic.Create;
    455459      try
     
    473477      FreeAndNil(Png);
    474478    end else
    475     if ExtractFileExt(FileName) = '.bmp' then begin
     479    if ExtractFileExt(FileName) = BmpExt then begin
    476480      try
    477481        Bmp.LoadFromFile(FileName);
     
    18821886  LoadPhrases;
    18831887  LoadFonts;
    1884   Templates := LoadGraphicSet('Templates.png', False);
     1888  Templates := LoadGraphicSet('Templates' + PngExt, False);
    18851889  with Templates do begin
    18861890    Logo := GetItem('Logo');
     
    18981902  end;
    18991903
    1900   LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
    1901   LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');
    1902   LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons.png');
     1904  LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors' + PngExt);
     1905  LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper' + JpgExt);
     1906  LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons' + PngExt);
    19031907end;
    19041908
     
    19231927  GrExt := TGraphicSets.Create;
    19241928
    1925   HGrSystem := LoadGraphicSet('System.png');
     1929  HGrSystem := LoadGraphicSet('System' + PngExt);
    19261930  with HGrSystem do begin
    19271931    CityMark1 := GetItem('CityMark1');
     
    19291933  end;
    19301934
    1931   HGrSystem2 := LoadGraphicSet('System2.png');
     1935  HGrSystem2 := LoadGraphicSet('System2' + PngExt);
    19321936  with HGrSystem2 do begin
    19331937    Ornament := GetItem('Ornament');
Note: See TracChangeset for help on using the changeset viewer.