1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Asset - Extension File Dropper (for Windows and macOS)

Discussion in 'Marketplace' started by Samuel Venable, Apr 30, 2019.

  1. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,122
    [​IMG]

    [​IMG]

    [Made for GameMaker Studio 2]

    This extension is for Windows and macOS.


    Allows you to drag and drop files and folders to your game window.

    Returns the full path to every file dropped separated by a new line.

    The DLL's full source code included.

    Very big thanks to Josh Ventura, for writing the widen() and shorten() scripts, enabling UTF-8 support on Windows.

    ----------------------------------------------------

    Download Free

    No third party installers needed. Compatible with all modern versions of Windows, including Windows 10.

    Tested on macOS High Sierra. If anyone could verify it is compatible with other versions it is appreciated!



     
    Last edited: May 7, 2019
    hippyman likes this.
  2. hippyman

    hippyman Member

    Joined:
    Jun 20, 2016
    Posts:
    562
    Nice job with this. My file dropper extension isn't safe to use because of a bug and it's Windows only. You're the king of system-level extensions!
     
    Samuel Venable likes this.
  3. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,122
    Thank you! Yeah to be honest this might need a few people testing it to make sure it works consistently because there is one specific part of developing this extension I'm still not sure whether I took the best approach on it, so anyway, if it works for everyone and people could verify that as much as they can, that would be greatly appreciated!

    P.S. this is the second time you called me a king of something in regards to programming which i may not be the best programmer there is, I have a lot to learn, i still very much appreciate your words.
     
    Last edited: Apr 30, 2019
    hippyman likes this.
  4. hippyman

    hippyman Member

    Joined:
    Jun 20, 2016
    Posts:
    562
    Good chance I said the same thing then. I tend to do that. lol

    The only thing I would say to look out for is this weird bug on Windows, where after using the extension it wigs out the Windows explorer and you can't rename files and some other odd behavior that I can't specifically remember. I have no idea why it happens and I didn't even notice it until somebody emailed me pointing out the issue. My extension was super hacky and basically just enough to "work" so you may or may not run into this issue. Just something to keep your eye on.
     
    Samuel Venable likes this.
  5. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,122
    Thanks for the info! This was made for a client so it's important that it has no such issues before two weeks has elapsed. I'll try renaming and messing around with various files i drag and see whether it's an issue. The problem I was having when making this was trying to figure out how to add code to an existing window procudure's list of messages. I did look at some code online that did this and it helped quite a bit, which i was pretty lucky to find.
     
    hippyman likes this.
  6. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,122
    API changes to previous functions listed below:
    • file_dnd_get_enabled() -- return value gets whether file dropping is enabled.
    • file_dnd_set_enabled(enable) -- argument sets whether file/directory dropping is enabled.
    • file_dnd_get_files() -- return value gets the list of files that were previously dropped, separated by a new line. return value is an empty string whenever file/directory dropping is disabled or nothing was dropped.
    • file_dnd_set_files(pattern, allowfiles, allowdirs, allowmulti) -- filters out unwanted items from the list of previously dropped items. pattern is a string in the form of "*.ext1;*.ext2;*.ext3;..." similar to the filter argument of get_open_filename except it excludes the filter description and use of pipe character separators. allowfiles is whether to allow regular files. allowdirs is whether to allow directories, (and on macOS, this includes various bundle formats like *.app, *.bundle, *.framework, etc. even though they have an icon that makes them appear as though they are normal file formats and not folders--just try opening them on Windows--and you will notice they are actually folders with very specifically structured sub-directories and file contents). allowmulti is whether to allow multiple items. For convenience, using this function will also remove duplicates and listed files and directories that no longer exist. Sorts alphabetically.
    • file_dnd_add_files(files) -- adds files and directories to the list, (separated by a new line if multiple), if the files and directories used in the files argument happen to exist, (checked and added to the list individually).
    • file_dnd_remove_files(files) -- same as the previous function except the files argument lists files to be removed from the previously dropped list, as apposed to adding them, regardless of whether they exist.
     
    Last edited: May 2, 2019
  7. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    262
    Hello Samuel. I sent you a message, please check it :)
     
    Samuel Venable likes this.
  8. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,122
    Just did. :)
     
  9. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,122
    Version 0.1.0 Released!
    • [New Platform] Added support for macOS.
    • [All Platforms] Removed functions file_dnd_add_files() and file_dnd_remove_files(). Use a data structure list instead to achieve the same thing.
    New screenshot and video captured on macOS coming soon!

    Edit:

    New macOS screenshot and video added to the OP and MP page!
     
    Last edited: May 7, 2019

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice