Changeset 309 for trunk/UCore.pas


Ignore:
Timestamp:
Aug 18, 2021, 12:37:33 PM (3 years ago)
Author:
chronos
Message:
  • Added: Snapcraft definition file for creation of Ubuntu snap packages.
  • Added: Screenshot images.
  • Modified: Detect language files independent of executable location.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r308 r309  
    130130
    131131uses
    132   UFormMain, UFormNew, UFormSettings, UFormAbout, UClientAI, UFormKeyShortcuts,
     132  UFormMain, UFormNew, UFormSettings, UClientAI, UFormKeyShortcuts,
    133133  UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats, UClientGUI;
    134134
     
    475475
    476476procedure TCore.DataModuleCreate(Sender: TObject);
    477 begin
    478   GameSystems := TGameSystems.Create;
     477const
     478  LinuxLanguagesDir = '/usr/share/xtactics/languages';
     479begin
     480  {$IFDEF Linux}
     481  // If installed in Linux system then use installation directory for po files
     482  if not DirectoryExists(CoolTranslator1.POFilesFolder) and DirectoryExists(LinuxLanguagesDir) then
     483    CoolTranslator1.POFilesFolder := LinuxLanguagesDir;
     484  {$ENDIF}
     485 
     486    GameSystems := TGameSystems.Create;
    479487  Server := TServer.Create;
    480488  LocalClients := TClients.Create;
     
    493501  FormClients := TFPGObjectList<TFormClient>.Create;
    494502  ServerList := TServerList.Create;
    495 
    496   {$IFDEF Linux}
    497   // If installed in Linux system then use installation directory for po files
    498   if Application.ExeName = '/usr/bin/xtactics' then
    499     CoolTranslator1.POFilesFolder := '/usr/share/xtactics/languages';
    500   {$ENDIF}
    501503end;
    502504
Note: See TracChangeset for help on using the changeset viewer.