Changeset 116 for trunk/UCore.pas


Ignore:
Timestamp:
Aug 18, 2021, 5:50:18 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Updated Common package files.
  • Fixed: Translation of About dialog.
  • Added: Snap package definition file.
  • Modified: Detect different data dir on Linux.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r115 r116  
    3131    procedure ScaleDPI;
    3232  public
     33    DataDir: string;
    3334    Project: TProject;
    3435    Targets: TTargetList;
     
    6465
    6566procedure TCore.DataModuleCreate(Sender: TObject);
    66 begin
     67const
     68  LinuxDataDir = '/usr/share/LazFuck';
     69  LinuxLanguagesDir = LinuxDataDir + '/Languages';
     70begin
     71  DataDir := '';
     72  {$IFDEF Linux}
     73  // If installed in Linux system then use installation shared game directory for data files
     74  if DirectoryExists(LinuxDataDir) then
     75    DataDir := LinuxDataDir;
     76  // If installed in Linux system then use installation directory for po files
     77  if not DirectoryExists(Translator.POFilesFolder) and DirectoryExists(LinuxLanguagesDir) then
     78    Translator.POFilesFolder := LinuxLanguagesDir;
     79  {$ENDIF}
     80
    6781  Project := TProject.Create;
    6882  Targets := TTargetList.Create;
     
    7993  Targets.Add(TTargetCSharp.Create);
    8094  Targets.Add(TTargetJavascript.Create);
    81 
    82   {$IFDEF Linux}
    83   // If installed in Linux system then use installation directory for po files
    84   if Application.ExeName = '/usr/bin/' + ExtractFileNameOnly(Application.ExeName) then
    85     Translator.POFilesFolder := '/usr/share/' + ExtractFileNameOnly(Application.ExeName) + '/languages';
    86   {$ENDIF}
    8795
    8896  LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext);
Note: See TracChangeset for help on using the changeset viewer.