foxygit / doom Log in
commit c9d46e0c7c0a3390f862b1ddd69ac9b7e846e5dd
Author:     Jonathan Dowland <jon+github@alcopop.org>
AuthorDate: Thu Mar 10 22:29:25 2016 +0000
Commit:     Jonathan Dowland <jon+github@alcopop.org>
CommitDate: Thu Mar 10 22:30:56 2016 +0000

    Add support for .lmp file formats to Mac Launcher

    Once the app has been launched at least once, double-clicking upon
    an .lmp file should start the Chocolate Doom launcher and add
    appropriate "-playdemo" command-line arguments.

    Closes: #677.
---
 pkg/osx/AppController.m |  5 +++++
 pkg/osx/Info.plist.in   | 12 ++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/pkg/osx/AppController.m b/pkg/osx/AppController.m
index b3c03240..4d682ee5 100644
--- a/pkg/osx/AppController.m
+++ b/pkg/osx/AppController.m
@@ -101,6 +101,11 @@
         [self->launcherManager addFileToCommandLine: fileName
                                forArgument: @"-merge"];
     }
+    else if (![extension caseInsensitiveCompare: @"lmp"])
+    {
+        [self->launcherManager addFileToCommandLine: fileName
+                               forArgument: @"-playdemo"];
+    }
     else if (![extension caseInsensitiveCompare: @"deh"])
     {
         [self->launcherManager addFileToCommandLine: fileName
diff --git a/pkg/osx/Info.plist.in b/pkg/osx/Info.plist.in
index a648ed8b..a9ba568d 100644
--- a/pkg/osx/Info.plist.in
+++ b/pkg/osx/Info.plist.in
@@ -49,6 +49,18 @@ Licensed under the GNU GPL v2.</string>
                                 <string>wad</string>
                         </array>
                 </dict>
+                <dict>
+                        <key>CFBundleTypeName</key>
+                        <string>Doom demo recording</string>
+                        <key>CFBundleTypeIconFile</key>
+                        <string>wadfile.icns</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>CFBundleTypeExtensions</key>
+                        <array>
+                                <string>lmp</string>
+                        </array>
+                </dict>
                 <dict>
                         <key>CFBundleTypeName</key>
                         <string>Doom Dehacked patch</string>