Ignore:
Timestamp:
Jan 10, 2026, 12:15:35 PM (4 weeks ago)
Author:
chronos
Message:

Merged revision(s) 705-716 from trunk:

  • Fixed: Subversion properties.
  • Fixed: Better start screen location calculation for lower than 800x600 resolutions to make visible entire window.
  • Fixed: Memory overflow in minimap drawing with some higher DPI settings.
  • Fixed: Crashes with mini map drawing in Start screen with some DPI resolutions.
  • Added: Enter key confirms battle dialog window.
  • Fixed: Potential battle dialog drawing issue.
  • Modified: Code cleanup.
  • Fixed: Disable auto selection of input text in message dialog.
  • Fixed: Edit boxes to have black background and blue selection.
  • Fixed: Automatically create Saved and Maps user data directories if they don't exist yet.
  • Modified: Code cleanup.
  • Fixed: Wrong unit models opened after click on Military report foreign units.
  • Modified: Do not store .png file extension in graphics names in book files. This is for compatibility with older C-evo versions.
  • Fixed: Support both books with graphics name with and without .png file extensions.
Location:
branches/zoom
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/zoom

  • branches/zoom/Packages/CevoComponents/Directories.pas

    r664 r717  
    2222
    2323uses
    24   FileUtil, LCLIntf, LCLType, LCLProc, LazUTF8, SysUtils, LazFileUtils, Forms;
     24  FileUtil, LCLIntf, LCLType, LCLProc, LazUTF8, SysUtils, LazFileUtils, Forms,
     25  Translations;
    2526
    2627function GetAppSharePath(Path: string): string;
     
    3334  {$IFDEF UNIX}
    3435  // If installed in Linux system then try to use different installation directory
     36  NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' +
     37    DirectorySeparator + 'share' + DirectorySeparator +
     38    ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path;
     39
    3540  if not DirectoryExists(Result) then begin
    36     NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' +
    37       DirectorySeparator + 'share' + DirectorySeparator +
    38       ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path;
    3941    if DirectoryExists(NewPath) then begin
    4042      Result := NewPath;
     
    4244    end;
    4345  end;
     46
    4447  if not FileExists(Result) then begin
    45     NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' +
    46       DirectorySeparator + 'share' + DirectorySeparator +
    47       ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path;
    4848    if FileExists(NewPath) then begin
    4949      Result := NewPath;
     
    5656function GetLocale: string;
    5757var
    58   Lang: string;
    5958  I: Integer;
    60   T: string;
     59  LanguageID: TLanguageID;
    6160begin
    6261  // Win32 user may decide to override locale with LANG variable.
    63   Lang := Copy(GetEnvironmentVariableUTF8('LANG'), 1, 2);
     62  Result := Copy(GetEnvironmentVariableUTF8('LANG'), 1, 2);
    6463
    65   if Lang = '' then begin
    66     for I := 1 to Paramcount - 1 do
     64  if Result = '' then begin
     65    for I := 1 to ParamCount - 1 do
    6766      if (ParamStrUTF8(I) = '--LANG') or (ParamStrUTF8(I) = '-l') or
    6867        (ParamStrUTF8(I) = '--lang') then
    69           Lang := ParamStrUTF8(I + 1);
     68          Result := ParamStrUTF8(I + 1);
    7069  end;
    71   if Lang = '' then begin
    72     T := '';
    73     LazGetLanguageIDs(Lang, T);
    74     Lang := Copy(Lang, 1, 2);
     70  if Result = '' then begin
     71    LanguageID := GetLanguageID;
     72    Result := Copy(LanguageID.LanguageID, 1, 2);
    7573  end;
    76 
    77   Result := Lang;
    7874end;
    7975
  • branches/zoom/Packages/CevoComponents/ScreenTools.pas

    r684 r717  
    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);
     
    17991803
    18001804procedure Gtk2DisableControlStyling(WinControl: TWinControl);
    1801 begin
     1805{$IFDEF LCLGTK2}
     1806var
     1807  GtkWhite: string;
     1808  GtkBlue: string;
     1809  GtkBlack: string;
     1810  GtkOrange: string;
     1811{$ENDIF}
     1812begin
     1813  {$IFDEF LCLGTK2}
    18021814  // https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38516
    1803   {$IFDEF LCLGTK2}
     1815  GtkBlue := '{ 0.373, 0.467, 0.796 }';
     1816  GtkWhite := '{ 1.0, 1.0, 1.0 }';
     1817  GtkBlack := '{ 0, 0, 0 }';
     1818  GtkOrange := '{ 0.373, 0.465, 0.793 }';
     1819
    18041820  // parse gtkrc from string
    18051821  gtk_rc_parse_string(PChar('style "noengine" {' + LineEnding +
    1806     'engine "" {}' + LineEnding +
     1822    'engine "" { }' + LineEnding +
     1823
     1824    'base[INSENSITIVE] = ' + GtkBlack + LineEnding +
     1825    'base[PRELIGHT] = ' + GtkBlack + LineEnding +
     1826    'base[NORMAL] = ' + GtkBlack + LineEnding +
     1827    'base[SELECTED] = ' + GtkBlue + LineEnding +
     1828    'base[ACTIVE] = ' + GtkBlack + LineEnding +
     1829
     1830    'text[INSENSITIVE] = ' + GtkOrange + LineEnding +
     1831    'text[NORMAL] = ' + GtkOrange + LineEnding +
     1832    'text[PRELIGHT] = ' + GtkOrange + LineEnding +
     1833    'text[SELECTED] = ' + GtkWhite + LineEnding +
     1834    'text[ACTIVE] = ' + GtkOrange + LineEnding +
     1835
    18071836    '}' + LineEnding +
    18081837    'widget "*.your-edit" style "noengine"'));
     
    18571886  LoadPhrases;
    18581887  LoadFonts;
    1859   Templates := LoadGraphicSet('Templates.png', False);
     1888  Templates := LoadGraphicSet('Templates' + PngExt, False);
    18601889  with Templates do begin
    18611890    Logo := GetItem('Logo');
     
    18731902  end;
    18741903
    1875   LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
    1876   LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');
    1877   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);
    18781907end;
    18791908
     
    18981927  GrExt := TGraphicSets.Create;
    18991928
    1900   HGrSystem := LoadGraphicSet('System.png');
     1929  HGrSystem := LoadGraphicSet('System' + PngExt);
    19011930  with HGrSystem do begin
    19021931    CityMark1 := GetItem('CityMark1');
     
    19041933  end;
    19051934
    1906   HGrSystem2 := LoadGraphicSet('System2.png');
     1935  HGrSystem2 := LoadGraphicSet('System2' + PngExt);
    19071936  with HGrSystem2 do begin
    19081937    Ornament := GetItem('Ornament');
  • branches/zoom/Packages/CevoComponents/Texture.pas

    r471 r717  
    4747  FAge := AValue;
    4848  LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +
    49     'Texture' + IntToStr(Age + 1) + '.jpg');
     49    'Texture' + IntToStr(Age + 1) + JpgExt);
    5050  ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];
    5151  ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];
Note: See TracChangeset for help on using the changeset viewer.