Index: os/macosx/plistgen.sh
===================================================================
--- os/macosx/plistgen.sh (revision 25755)
+++ os/macosx/plistgen.sh (working copy)
@@ -44,5 +44,81 @@
Copyright 2004-$date The OpenTTD team
NSPrincipalClass
NSApplication
+ UTExportedTypeDeclarations
+
+
+ UTTypeConformsTo
+
+ public.data
+
+ UTTypeIdentifier
+ org.openttd.savegame
+ UTTypeDescription
+ OpenTTD Save
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ sav
+
+
+
+
+ UTTypeConformsTo
+
+ public.data
+
+ UTTypeIdentifier
+ org.openttd.scenario
+ UTTypeDescription
+ OpenTTD Scenario
+ UTTypeTagSpecification
+
+ public.filename-extension
+
+ scn
+
+
+
+
+ CFBundleDocumentTypes
+
+
+ CFBundleTypeExtensions
+
+ sav
+
+ CFBundleTypeName
+ OpenTTD Save
+ LSHandlerRank
+ Owner
+ CFBundleTypeRole
+ Editor
+ LSTypeIsPackage
+
+ LSItemContentTypes
+
+ org.openttd.savegame
+
+
+
+ CFBundleTypeExtensions
+
+ scn
+
+ CFBundleTypeName
+ OpenTTD Scenario
+ LSHandlerRank
+ Owner
+ CFBundleTypeRole
+ Editor
+ LSTypeIsPackage
+
+ LSItemContentTypes
+
+ org.openttd.scenario
+
+
+
" > "$1"/Contents/Info.plist
Index: src/video/cocoa/cocoa_v.mm
===================================================================
--- src/video/cocoa/cocoa_v.mm (revision 25755)
+++ src/video/cocoa/cocoa_v.mm (working copy)
@@ -35,6 +35,8 @@
#include "../../gfx_func.h"
#include "../../window_func.h"
#include "../../window_gui.h"
+#include "../../saveload/saveload.h"
+#include "../../fios.h"
#import /* for MAXPATHLEN */
@@ -105,6 +107,19 @@
}
/**
+ * Called to open a document. Can be called before applicationDidFinishLaunching:
+ */
+- (BOOL) application: (NSApplication *)theApplication openFile:(NSString *)filename
+{
+ strecpy(_file_to_saveload.name, [ filename fileSystemRepresentation ], lastof(_file_to_saveload.name));
+ _switch_mode = SM_LOAD_GAME;
+ _file_to_saveload.mode = SL_LOAD;
+
+ return YES;
+}
+
+
+/**
* Display the in game quit confirmation dialog.
*/
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*) sender