Changeset 375
- Timestamp:
- Jan 3, 2025, 2:43:39 PM (3 days ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.pas
r372 r375 74 74 GameLoaded: Boolean; 75 75 FormNewTabIndex: Integer; 76 BaseDir: string; 76 MapImagesDir: string; 77 GameSystemsDir: string; 77 78 procedure LoadRecentExecute(Sender: TObject); 78 79 procedure StartNewGame; … … 135 136 const 136 137 DefaultRegKey = '\Software\Chronosoft\xTactics'; 138 AutoSaveFileName = 'AutoSave' + GameFileExt; 139 GameSystemsDirName = 'Systems'; 140 LanguagesDirName = 'Languages'; 141 MapImagesDirName = 'Images' + DirectorySeparator + 'Maps'; 142 DefaultGameSystemName = 'Default'; 137 143 138 144 resourcestring … … 293 299 AGameEnd.Enabled := Game.Running; 294 300 AFullscreen.Checked := FormMain.FullScreen; 295 {$ ifdefDEBUG}301 {$IFDEF DEBUG} 296 302 ATests.Visible := True; 297 303 ATests.Enabled := True; 298 {$ else}304 {$ELSE} 299 305 ATests.Visible := False; 300 306 ATests.Enabled := False; 301 {$ endif}307 {$ENDIF} 302 308 end; 303 309 … … 518 524 519 525 procedure TCore.DataModuleCreate(Sender: TObject); 526 var 527 BaseDir: string; 520 528 {$IFDEF UNIX} 521 529 const 522 LanguagesDir = 'Languages'; 523 LinuxBaseDir = '/usr/share/xtactics'; 524 LinuxLanguagesDir = LinuxBaseDir + DirectorySeparator + LanguagesDir; 525 LinuxBaseDir2 = '/app/share/xtactics'; 526 LinuxLanguagesDir2 = LinuxBaseDir2 + DirectorySeparator + LanguagesDir; 530 LinuxRelativeDir = '../share/xtactics'; 531 var 532 NewDir: string; 527 533 {$ENDIF} 528 534 begin 529 BaseDir := ExtractFilePath(ParamStr(0)); 530 Translator1.POFilesFolder := BaseDir + DirectorySeparator + LanguagesDir; 535 BaseDir := ExcludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0))); 536 GameSystemsDir := CombinePaths(BaseDir, GameSystemsDirName); 537 MapImagesDir := CombinePaths(BaseDir, MapImagesDirName); 538 Translator1.POFilesFolder := CombinePaths(BaseDir, LanguagesDirName); 531 539 532 540 {$IFDEF UNIX} 533 // If installed in Linux system then use installation shared game directory for data files 534 if not DirectoryExists(BaseDir) and DirectoryExists(LinuxBaseDir) then 535 BaseDir := LinuxBaseDir; 536 537 if not DirectoryExists(BaseDir) and DirectoryExists(LinuxBaseDir2) then 538 BaseDir := LinuxBaseDir2; 541 // If installed in Linux system then use installation shared game directory for game systems 542 if not DirectoryExists(GameSystemsDir) then begin 543 NewDir := ExpandFileName(BaseDir + DirectorySeparator + LinuxRelativeDir + 544 DirectorySeparator + GameSystemsDirName); 545 if DirectoryExists(NewDir) then GameSystemsDir := NewDir; 546 end; 547 548 // If installed in Linux system then use installation shared game directory for map images 549 if not DirectoryExists(GameSystemsDir) then begin 550 NewDir := ExpandFileName(BaseDir + DirectorySeparator + LinuxRelativeDir + 551 DirectorySeparator + MapImagesDirName); 552 if DirectoryExists(NewDir) then MapImagesDir := NewDir; 553 end; 539 554 540 555 // If installed in Linux system then use installation directory for po files 541 if not DirectoryExists(Translator1.POFilesFolder) and DirectoryExists(LinuxLanguagesDir) then 542 Translator1.POFilesFolder := LinuxLanguagesDir; 543 if not DirectoryExists(Translator1.POFilesFolder) and DirectoryExists(LinuxLanguagesDir2) then 544 Translator1.POFilesFolder := LinuxLanguagesDir2; 556 if not DirectoryExists(Translator1.POFilesFolder) then begin 557 NewDir := ExpandFileName(BaseDir + DirectorySeparator + LinuxRelativeDir + 558 DirectorySeparator + LanguagesDirName); 559 if DirectoryExists(NewDir) then Translator1.POFilesFolder := NewDir; 560 end; 545 561 {$ENDIF} 546 562 … … 555 571 Game.OnNewTurn := GameNewTurnExecute; 556 572 Game.OnPlayerChange := DoPlayerChange; 557 Game.MapImageFileName := CombinePaths(BaseDir, 'Images' + DirectorySeparator + 'Maps' + DirectorySeparator + 'WorldMap.png');573 Game.MapImageFileName := MapImagesDir + DirectorySeparator + 'WorldMap.png'; 558 574 Server.Game := Game; 559 575 LocalClients.Game := Game; … … 680 696 NewGameSystem: TGameSystem; 681 697 NewUnitKind: TUnitKind; 682 SystemsDir: string; 683 const 684 GameSystemsDirName = 'Systems'; 685 DefaultGameSystemName = 'Default'; 686 begin 687 if BaseDir <> '' then 688 SystemsDir := BaseDir + DirectorySeparator + GameSystemsDirName 689 else SystemsDir := ExpandFileName(GameSystemsDirName); 690 if DirectoryExists(SystemsDir) then begin 691 GameSystems.LoadFromDir(SystemsDir); 698 begin 699 if DirectoryExists(GameSystemsDir) then begin 700 GameSystems.LoadFromDir(GameSystemsDir); 692 701 end else begin 693 702 // Create default game system if the directory with definitions was not found … … 696 705 NewUnitKind := TUnitKind.Create; 697 706 NewUnitKind.Name := 'Unit'; 707 NewUnitKind.Moves := 1; 708 NewUnitKind.Power := 99; 698 709 NewGameSystem.UnitKinds.Add(NewUnitKind); 699 710 GameSystems.Add(NewGameSystem); … … 707 718 function TCore.GetAutoSaveFileName: string; 708 719 begin 709 Result := GetAppConfigDir(False) + 'AutoSave' + GameFileExt;720 Result := GetAppConfigDir(False) + AutoSaveFileName; 710 721 end; 711 722 -
trunk/Forms/FormClient.pas
r333 r375 427 427 procedure TFormClient.FormCreate(Sender: TObject); 428 428 begin 429 {$IFDEF Linux}429 {$IFDEF UNIX} 430 430 //PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque]; 431 431 {$ENDIF} -
trunk/Install/deb/debian/rules
r372 r375 14 14 15 15 override_dh_auto_install: 16 install -d -m 755 $(ROOT)/usr/bin 17 install -s -m 755 xtactics $(ROOT)/usr/bin 18 install -d -m 755 $(ROOT)/usr/share/xtactics/Languages 19 install -m 644 Languages/*.po $(ROOT)/usr/share/xtactics/Languages 20 install -m 644 Packages/Common/Languages/*.po $(ROOT)/usr/share/xtactics/Languages 21 install -m 644 Packages/CoolStreaming/Languages/*.po $(ROOT)/usr/share/xtactics/Languages 22 install -d -m 755 $(ROOT)/usr/share/xtactics/images/maps 23 install -m 644 Images/Maps/Europe.png $(ROOT)/usr/share/xtactics/images/maps 24 install -m 644 Images/Maps/WorldMap.png $(ROOT)/usr/share/xtactics/images/maps 25 install -d -m 755 $(ROOT)/usr/share/applications 26 install -m 644 Install/deb/xtactics.desktop $(ROOT)/usr/share/applications 27 install -d -m 755 $(ROOT)/usr/share/mime/packages 28 install -m 644 Install/deb/xtactics.xml $(ROOT)/usr/share/mime/packages 29 install -d -m 755 $(ROOT)/usr/share/pixmaps 30 install -m 644 Images/128x128/xtactics.png $(ROOT)/usr/share/pixmaps 31 install -m 644 Images/128x128/xtactics.png $(ROOT)/usr/share/pixmaps/application-xtg.png 32 install -m 644 Images/128x128/xtactics.png $(ROOT)/usr/share/pixmaps/application-xts.png 16 install -Dm755 xtactics -t $(ROOT)/usr/bin 17 install -Dm644 Languages/*.po -t $(ROOT)/usr/share/xtactics/Languages 18 install -Dm644 Packages/Common/Languages/*.po -t $(ROOT)/usr/share/xtactics/Languages 19 install -Dm644 Packages/CoolStreaming/Languages/*.po -t $(ROOT)/usr/share/xtactics/Languages 20 install -Dm644 Images/Maps/*.png -t $(ROOT)/usr/share/xtactics/Images/Maps 21 install -Dm644 Systems/*.xts -t $(ROOT)/usr/share/xtactics/Systems 22 install -Dm644 Install/deb/xtactics.desktop -t $(ROOT)/usr/share/applications 23 install -Dm644 Install/deb/xtactics.xml -t $(ROOT)/usr/share/mime/packages 24 install -Dm644 Images/128x128/xtactics.png -t $(ROOT)/usr/share/pixmaps 25 install -Dm644 Images/128x128/xtactics.png $(ROOT)/usr/share/pixmaps/application-xtg.png 26 install -Dm644 Images/128x128/xtactics.png $(ROOT)/usr/share/pixmaps/application-xts.png 33 27 34 28 %: -
trunk/Install/flatpak/net.zdechov.app.xTactics.yml
r374 r375 27 27 - type: svn 28 28 url: https://svn.zdechov.net/xtactics/trunk 29 revision: r37 429 revision: r375 30 30 buildsystem: simple 31 31 build-commands: … … 34 34 lazbuild --build-mode=Release --ws=qt5 xtactics.lpi 35 35 - install -Dm755 xtactics -t $FLATPAK_DEST/bin 36 - install -Dm644 Install/deb/xtactics.desktop -t $FLATPAK_DEST/share/applications37 - install -Dm644 Install/deb/xtactics.xml $FLATPAK_DEST/share/mime/packages/$FLAPTAK_ID.xml38 36 - install -Dm644 Languages/*.po -t $FLATPAK_DEST/share/xtactics/Languages 39 37 - install -Dm644 Packages/Common/Languages/*.po -t $FLATPAK_DEST/share/xtactics/Languages 40 38 - install -Dm644 Packages/CoolStreaming/Languages/*.po -t $FLATPAK_DEST/share/xtactics/Languages 41 - cp -r Systems $FLATPAK_DEST/share/xtactics 42 - install -d -m 755 $FLATPAK_DEST/share/xtactics/Images 43 - cp -r Images/Maps $FLATPAK_DEST/share/xtactics/Images 39 - install -Dm644 Images/Maps/*.png -t $FLATPAK_DEST/share/xtactics/Images/Maps 40 - install -Dm644 Systems/*.xts -t $FLATPAK_DEST/share/xtactics/Systems 41 - install -Dm644 Install/deb/xtactics.desktop -t $FLATPAK_DEST/share/applications 42 - install -Dm644 Install/deb/xtactics.xml $FLATPAK_DEST/share/mime/packages/$FLAPTAK_ID.xml 44 43 - install -Dm644 Images/128x128/xtactics.png -t $FLATPAK_DEST/share/icons/hicolor/128x128/apps 44 - install -Dm644 Images/128x128/xtactics.png $FLATPAK_DEST/share/pixmaps/application-xtg.png 45 - install -Dm644 Images/128x128/xtactics.png $FLATPAK_DEST/share/pixmaps/application-xts.png 45 46 - install -Dm644 Install/flatpak/${FLATPAK_ID}.metainfo.xml -t $FLATPAK_DEST/share/metainfo -
trunk/Install/rpm/xtactics.spec
r372 r375 26 26 %install 27 27 rm -rf $RPM_BUILD_ROOT 28 install -d -m 755 $RPM_BUILD_ROOT/usr/bin 29 install -s -m 755 xtactics $RPM_BUILD_ROOT/usr/bin 28 install -Dm755 xtactics -t $RPM_BUILD_ROOT/usr/bin 30 29 install -Dm644 Languages/*.po -t $RPM_BUILD_ROOT/usr/share/xtactics/Languages 31 install -Dm644 Packages/Common/Languages/*.po -t $(ROOT)/usr/share/xtactics/Languages 32 install -Dm644 Packages/CoolStreaming/Languages/*.po -t $(ROOT)/usr/share/xtactics/Languages 33 install -d -m 755 $RPM_BUILD_ROOT/usr/share/xtactics/images/maps 34 install -Dm644 Images/Maps/Europe.png -t $RPM_BUILD_ROOT/usr/share/xtactics/Images/Maps 35 install -Dm644 Images/Maps/WorldMap.png -t $RPM_BUILD_ROOT/usr/share/xtactics/Images/Maps 30 install -Dm644 Packages/Common/Languages/*.po -t $RPM_BUILD_ROOT/usr/share/xtactics/Languages 31 install -Dm644 Packages/CoolStreaming/Languages/*.po -t $RPM_BUILD_ROOT/usr/share/xtactics/Languages 32 install -Dm644 Images/Maps/*.png -t $RPM_BUILD_ROOT/usr/share/xtactics/Images/Maps 33 install -Dm644 Systems/*.xts -t $RPM_BUILD_ROOT/usr/share/xtactics/Systems 36 34 install -Dm644 Install/deb/xtactics.desktop -t $RPM_BUILD_ROOT/usr/share/applications 35 install -Dm644 Install/deb/xtactics.xml -t $RPM_BUILD_ROOT/usr/share/mime/packages 37 36 install -Dm644 Images/128x128/xtactics.png -t $RPM_BUILD_ROOT/usr/share/pixmaps 37 install -Dm644 Images/128x128/xtactics.png $RPM_BUILD_ROOT/usr/share/pixmaps/application-xtg.png 38 install -Dm644 Images/128x128/xtactics.png $RPM_BUILD_ROOT/usr/share/pixmaps/application-xts.png 38 39 39 40 %clean -
trunk/Install/snap/snapcraft.yaml
r372 r375 50 50 snapcraftctl build 51 51 lazbuild --build-mode=Release xtactics.lpi 52 install - d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin53 install - s -m 755 xtactics $SNAPCRAFT_PART_INSTALL/usr/bin/xtactics54 install - d -m 755$SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Languages55 install -Dm644 Languages/*.po$SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Languages56 install -Dm644 Packages/Common/Languages/*.po $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Languages57 install -Dm644 Packages/CoolStreaming/Languages/*.po $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Languages52 install -Dm755 xtactics -t $SNAPCRAFT_PART_INSTALL/usr/bin/xtactics 53 install -Dm644 Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Languages 54 install -Dm644 Packages/Common/Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Languages 55 install -Dm644 Packages/CoolStreaming/Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Languages 56 install -Dm644 Images/Maps/*.png -t $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Images/Maps 57 install -Dm644 Systems/*.xts -t $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Systems 58 58 install -Dm644 Install/deb/xtactics.desktop -t $SNAPCRAFT_PART_INSTALL/usr/share/applications 59 59 install -Dm644 Install/deb/xtactics.xml -t $SNAPCRAFT_PART_INSTALL/usr/share/mime/packages 60 60 install -Dm644 Images/128x128/xtactics.png -t $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps 61 install -Dm644 Images/128x128/xtactics.png -t $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/application-xtg.png 62 install -Dm644 Images/128x128/xtactics.png -t $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/application-xts.png 63 cp -r Systems $SNAPCRAFT_PART_INSTALL/usr/share/xtactics 64 install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Images 65 cp -r Images/Maps $SNAPCRAFT_PART_INSTALL/usr/share/xtactics/Images 61 install -Dm644 Images/128x128/xtactics.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/application-xtg.png 62 install -Dm644 Images/128x128/xtactics.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/application-xts.png 66 63 after: 67 64 - desktop-gtk2 -
trunk/Units.pas
r353 r375 169 169 OldValue := TCell(FMapCell); 170 170 FMapCell := nil; 171 if Assigned(OldValue) then TCell(OldValue).OneUnit := nil;171 if Assigned(OldValue) then OldValue.OneUnit := nil; 172 172 FMapCell := AValue; 173 173 if Assigned(FMapCell) then TCell(FMapCell).OneUnit := Self; -
trunk/xtactics.lpi
r374 r375 26 26 <MinorVersionNr Value="4"/> 27 27 </VersionInfo> 28 <MacroValues Count="1">29 <Macro1 Name="LCLWidgetType" Value="qt5"/>30 </MacroValues>31 28 <BuildModes Count="2"> 32 29 <Item1 Name="Debug" Default="True"/>
Note:
See TracChangeset
for help on using the changeset viewer.