mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Support .demo and .map files being dragged into client
Only tested on macOS, but should work everywhere
This commit is contained in:
parent
bfe4ced662
commit
779b44fde5
|
@ -29,6 +29,29 @@
|
|||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>DDNet demo</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>DDNet demo viewer</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>dyn.ah62d4rv4ge80k3prr6</string>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>DDNet map</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>DDNet map editor</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>dyn.ah62d4rv4ge8042pu</string>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>NSPrefersDisplaySafeAreaCompatibilityMode</key>
|
||||
|
|
|
@ -3177,8 +3177,15 @@ void CClient::Run()
|
|||
}
|
||||
|
||||
char aFile[IO_MAX_PATH_LENGTH];
|
||||
if(Input()->GetDropFile(aFile, sizeof(aFile)) && str_startswith(aFile, CONNECTLINK_NO_SLASH))
|
||||
HandleConnectLink(aFile);
|
||||
if(Input()->GetDropFile(aFile, sizeof(aFile)))
|
||||
{
|
||||
if(str_startswith(aFile, CONNECTLINK_NO_SLASH))
|
||||
HandleConnectLink(aFile);
|
||||
else if(str_endswith(aFile, ".demo"))
|
||||
HandleDemoPath(aFile);
|
||||
else if(str_endswith(aFile, ".map"))
|
||||
HandleMapPath(aFile);
|
||||
}
|
||||
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
Updater()->Update();
|
||||
|
|
Loading…
Reference in a new issue