Changeset 371 for trunk/Core.pas
- Timestamp:
- Jan 2, 2025, 9:02:57 PM (4 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.pas
r370 r371 74 74 GameLoaded: Boolean; 75 75 FormNewTabIndex: Integer; 76 GameFilesDir: string;76 BaseDir: string; 77 77 procedure LoadRecentExecute(Sender: TObject); 78 78 procedure StartNewGame; … … 518 518 519 519 procedure TCore.DataModuleCreate(Sender: TObject); 520 {$IFDEF Linux}520 {$IFDEF UNIX} 521 521 const 522 LinuxGameFilesDir = '/usr/share/xtactics'; 523 LinuxLanguagesDir = LinuxGameFilesDir + '/Languages'; 522 LinuxBaseDir = '/usr/share/xtactics'; 523 LinuxLanguagesDir = LinuxBaseDir + '/Languages'; 524 LinuxBaseDir2 = '/app/share/xtactics'; 525 LinuxLanguagesDir2 = LinuxBaseDir2 + '/Languages'; 524 526 {$ENDIF} 525 527 begin 526 GameFilesDir := ExtractFilePath(ParamStr(0)); 527 {$IFDEF Linux} 528 BaseDir := ExtractFilePath(ParamStr(0)); 529 Translator1.POFilesFolder := BaseDir + DirectorySeparator + 'Languages'; 530 531 {$IFDEF UNIX} 528 532 // If installed in Linux system then use installation shared game directory for data files 529 if DirectoryExists(LinuxGameFilesDir) then 530 GameFilesDir := LinuxGameFilesDir; 533 if not DirectoryExists(BaseDir) and DirectoryExists(LinuxBaseDir) then 534 BaseDir := LinuxBaseDir; 535 536 if not DirectoryExists(BaseDir) and DirectoryExists(LinuxBaseDir2) then 537 BaseDir := LinuxBaseDir2; 538 531 539 // If installed in Linux system then use installation directory for po files 532 540 if not DirectoryExists(Translator1.POFilesFolder) and DirectoryExists(LinuxLanguagesDir) then 533 541 Translator1.POFilesFolder := LinuxLanguagesDir; 542 if not DirectoryExists(Translator1.POFilesFolder) and DirectoryExists(LinuxLanguagesDir2) then 543 Translator1.POFilesFolder := LinuxLanguagesDir2; 534 544 {$ENDIF} 535 545 … … 544 554 Game.OnNewTurn := GameNewTurnExecute; 545 555 Game.OnPlayerChange := DoPlayerChange; 546 Game.MapImageFileName := CombinePaths( GameFilesDir, 'Images' + DirectorySeparator + 'Maps' + DirectorySeparator + 'WorldMap.png');556 Game.MapImageFileName := CombinePaths(BaseDir, 'Images' + DirectorySeparator + 'Maps' + DirectorySeparator + 'WorldMap.png'); 547 557 Server.Game := Game; 548 558 LocalClients.Game := Game; … … 674 684 DefaultGameSystemName = 'Default'; 675 685 begin 676 if GameFilesDir <> '' then677 SystemsDir := GameFilesDir + DirectorySeparator + GameSystemsDirName686 if BaseDir <> '' then 687 SystemsDir := BaseDir + DirectorySeparator + GameSystemsDirName 678 688 else SystemsDir := ExpandFileName(GameSystemsDirName); 679 689 if DirectoryExists(SystemsDir) then begin
Note:
See TracChangeset
for help on using the changeset viewer.