diff --git a/Makefile b/Makefile index 2608652128..d8418cdf5c 100644 --- a/Makefile +++ b/Makefile @@ -391,6 +391,13 @@ install-linux-desktop: @$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications" @$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications" +install-linux-mime: + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/mime/packages/" + @$(INSTALL_DATA) packaging/linux/openra-mimeinfo.xml "$(DESTDIR)$(datadir)/mime/packages/openra.xml" + + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DATA) packaging/linux/openra-replays.desktop "$(DESTDIR)$(datadir)/applications" + install-linux-scripts: @echo "#!/bin/sh" > openra @echo 'cd "$(gameinstalldir)"' >> openra @@ -426,6 +433,7 @@ uninstall: @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra-editor.png" @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/openra.png" @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/mime/packages/openra.xml" help: @echo to compile, run: diff --git a/OpenRA.Game/FileFormats/ReplayMetadata.cs b/OpenRA.Game/FileFormats/ReplayMetadata.cs index bdbbb8b411..d8e0be7449 100644 --- a/OpenRA.Game/FileFormats/ReplayMetadata.cs +++ b/OpenRA.Game/FileFormats/ReplayMetadata.cs @@ -71,7 +71,7 @@ namespace OpenRA.FileFormats public void RenameFile(string newFilenameWithoutExtension) { - var newPath = Path.Combine(Path.GetDirectoryName(FilePath), newFilenameWithoutExtension) + ".rep"; + var newPath = Path.Combine(Path.GetDirectoryName(FilePath), newFilenameWithoutExtension) + ".orarep"; File.Move(FilePath, newPath); FilePath = newPath; } diff --git a/OpenRA.Game/Network/ReplayRecorderConnection.cs b/OpenRA.Game/Network/ReplayRecorderConnection.cs index 104c282f4d..b42f07404e 100644 --- a/OpenRA.Game/Network/ReplayRecorderConnection.cs +++ b/OpenRA.Game/Network/ReplayRecorderConnection.cs @@ -57,7 +57,7 @@ namespace OpenRA.Network var id = -1; while (file == null) { - var fullFilename = Path.Combine(dir, id < 0 ? "{0}.rep".F(filename) : "{0}-{1}.rep".F(filename, id)); + var fullFilename = Path.Combine(dir, id < 0 ? "{0}.orarep".F(filename) : "{0}-{1}.orarep".F(filename, id)); id++; try { diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index 0dfe2ee152..876158aa12 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic using (new Support.PerfTimer("Load replays")) { replays = Directory - .GetFiles(dir, "*.rep") + .GetFiles(dir, "*.orarep") .Select(ReplayMetadata.Read) .Where(r => r != null) .OrderByDescending(r => r.GameInfo.StartTimeUtc) diff --git a/launch-replay.sh b/launch-replay.sh index 6c1af06098..2190b61bb6 100755 --- a/launch-replay.sh +++ b/launch-replay.sh @@ -1,4 +1,3 @@ #!/bin/bash -# TODO choose the correct Game.Mod instead of crashing cd ${0%/*} exec mono OpenRA.Game.exe Launch.Replay="$@" \ No newline at end of file diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 112a0380cf..944e4fb754 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -22,6 +22,7 @@ make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" # Install startup scripts, desktop files and icons make install-linux-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" +make install-linux-mime prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" # Documentation mkdir -p $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/ diff --git a/packaging/linux/openra-mimeinfo.xml b/packaging/linux/openra-mimeinfo.xml new file mode 100644 index 0000000000..9a5fba69a1 --- /dev/null +++ b/packaging/linux/openra-mimeinfo.xml @@ -0,0 +1,11 @@ + + + + + + + OpenRA Replay + + + + diff --git a/packaging/linux/openra-replays.desktop b/packaging/linux/openra-replays.desktop new file mode 100755 index 0000000000..58e8d9f637 --- /dev/null +++ b/packaging/linux/openra-replays.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=OpenRA +GenericName=Real Time Strategy Game +Comment=Reimagining of early Westwood Games +Icon=openra +Exec=openra Launch.Replay=%f +Terminal=false +NoDisplay=true +Categories=Game;StrategyGame; +MimeType=application/x-openra-replay; \ No newline at end of file