Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: File drop  (Read 56960 times)

0 Members and 1 Guest are viewing this topic.

GraphicsWhale

  • Full Member
  • ***
  • Posts: 131
    • View Profile
Re: File drop
« Reply #15 on: October 13, 2015, 01:35:45 am »
- Has to be implemented
- Has to be maintained
True for any other feature

Of course. But the SFML team consists of only a handful of people who spend their spare time maintaining the library, and they probably are mostly hobbyists (correct me if I'm wrong).

It's not as simple as just coming up with an idea. Some of these features may take days to implement and get running properly. And it'll have to be maintained for the lifetime of the library.

So it's important to consider whether or not the feature is really worth putting off bug fixes and useful features for.

- Moves away from the library being about mostly about game development
While true for the library usage, the purpose is not limited to game development and I personally have three SFML projects unrelated to games.

The library can very well be used for non-game applications, and there's no problems with that. However, most of the applications made with SFML are games.

- Introduces a feature that only works on certain platforms (doesn't work on mobile)
Not unheard of, since touch support is currently only available on mobile.

http://www.newegg.com/Touch-Screen-Monitors/SubCategory/ID-514

Input devices shouldn't count.
Controllers could be considered a "console-only" feature, but I use one for certain PC games sometimes.

I was more talking about OS-specific features. A mobile game shouldn't ask you to change your config file, and a desktop game shouldn't ask if you want to be taken to the app store (well, the latter used to be true). Same goes for drag & drop.
« Last Edit: October 13, 2015, 01:37:36 am by GraphicsWhale »

Turbine

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: File drop
« Reply #16 on: November 03, 2015, 12:26:51 am »
I wouldn't mind using this feature to easily upload skins for user's ship armour, or crawl a resource archive.

ratzlaff

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: File drop
« Reply #17 on: November 03, 2015, 09:27:52 pm »
I would use this feature to test out a lua script

GraphicsWhale

  • Full Member
  • ***
  • Posts: 131
    • View Profile
Re: File drop
« Reply #18 on: November 05, 2015, 05:34:06 am »
I would use this feature to test out a lua script

I get what you're saying, but couldn't you just use a certain reserved key or in-game command to do that for you? How would your game know where to use the script (assuming you're using more than a single script, which is usually)?

ratzlaff

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: File drop
« Reply #19 on: November 05, 2015, 04:04:32 pm »
I would use this feature to test out a lua script

I get what you're saying, but couldn't you just use a certain reserved key or in-game command to do that for you? How would your game know where to use the script (assuming you're using more than a single script, which is usually)?

You assume I only want to run a specific lua script. No this would be to test out and iterate on any script I want to run.

Think of it as an alternative to copy-paste into the console.

Could you do it other ways? certainly. Would they be as quick to use? They are not.
Disclaimer: we utilize drag and drop to test out our scripts like this on the software I maintain at work.
« Last Edit: November 05, 2015, 04:08:38 pm by ratzlaff »

GraphicsWhale

  • Full Member
  • ***
  • Posts: 131
    • View Profile
Re: File drop
« Reply #20 on: November 05, 2015, 11:26:25 pm »
I'm confused. You say you want to test out a specific script. But dropping a file into the window does not tell it what the script is for (i.e. a script for AI, a script for GUI, etc) . If you have 10 scripts running, and you want to test a new one by dropping it into the window, how does it know what the script is supposed to be used for?

And if you're just testing out Lua in general, why not use an IDE instead of trying to drop it into an application?

SpeCter

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: File drop
« Reply #21 on: November 06, 2015, 09:48:26 am »
Why should SFML care at all what should be done with the dropped file?
Just let SFML create an Event like FileDropEvent, attach the filepath to it and let the user handle the rest.

Satus

  • Guest
Re: File drop
« Reply #22 on: November 06, 2015, 09:53:39 am »
Why should SFML care at all what should be done with the dropped file?

Following this logic, you can request any feature to be added.

SpeCter

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: File drop
« Reply #23 on: November 06, 2015, 11:11:37 am »
Why should SFML care at all what should be done with the dropped file?

Following this logic, you can request any feature to be added.

Sorry, but I'm not quite sure what you want to say or how you came to that conclusion from what I said.

Satus

  • Guest
Re: File drop
« Reply #24 on: November 06, 2015, 02:00:50 pm »
Sorry, but I'm not quite sure what you want to say or how you came to that conclusion from what I said.

You said:
Why should SFML care at all what should be done with the dropped file?

But it is wrong. If you want a feature to be added to library, you have to provide a reason for that. That includes, what problems will this feature solve, how many users will benefit from this feature, what are typical use cases etc.

Though, I personally think that a multimedia library should have file drop support.

SpeCter

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: File drop
« Reply #25 on: November 06, 2015, 02:56:29 pm »
Sorry, but I'm not quite sure what you want to say or how you came to that conclusion from what I said.

You said:
Why should SFML care at all what should be done with the dropped file?

But it is wrong. If you want a feature to be added to library, you have to provide a reason for that. That includes, what problems will this feature solve, how many users will benefit from this feature, what are typical use cases etc.

Though, I personally think that a multimedia library should have file drop support.

I didn't say that I want this feature(Though I would like it). What I said is, that SFML should not be concerned with what kind of file was dragged onto the window.
If a feature like file drop was added, SFML should just notify the program that a file was dropped.

For example:

  • I drag the file awesomesong.mp3 from C:\my\path\to\awesome\music onto the sfml window.
  • SFML generates a new Event, for example: DropEvent
  • This Event contains the path, the file name and extension

From here on SFML's job should be done.
It should be the users responsibility to choose what has to be done with the awesomesong.mp3.
With the supplied information you have everything you need to open the file and in this example play music.

tl;dr
SFML itself shouldn't care what to do with the file itself. Just notify the program through an event that a file drop happened.
This is what I think what should be SFML's responsibility if this feature gets added.

I still fail to see how you come to your conclusion that by my logic every feature can be requested to be added.
I neither requested this feature, nor did I try to justify it. I even said that SFML should not care about what to do with the file as in that is not SFML's responsibility.

GraphicsWhale

  • Full Member
  • ***
  • Posts: 131
    • View Profile
Re: File drop
« Reply #26 on: November 08, 2015, 09:45:26 am »
Never did we suggest that SFML should decide on what to do depending on the type of file. The problem is that it's hard to implement and maintain features, so if you need to add one then it better be useful.

If you're referring to the Lua thing I was just saying that many applications that use scripts usually use more than one script, so dragging-and-dropping it into the window doesn't make a whole lot of sense since the application (which consists of more than just SFML) wouldn't know where to place that script since different scripts serve different purposes.

This applies to more than games, but for example: If your game has two scripts, one for GUI that has an onButtonClick function and one for AI that has an onPlayerSeen function, they're obviously not interchangeable, so how do you know which of the two purposes the script serves? You can't (at least not with drag-and-drop). And if you're just testing out a single Lua script that doesn't require any specific functions to be defined, why not use an actual Lua IDE or something instead? Let alone the fact that if you have a single script and version control, you could just have an "update script" hotkey and just modify the one file instead of dragging-and-dropping files into your window.

jdiamond

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: File drop
« Reply #27 on: January 29, 2016, 06:19:51 pm »
Well, I can imagine some use cases for this feature, for example image gallery or video/music player, or level editor.

While those are all valid uses for drag-and-drop, I'm not quite convinced the first two are the kind of applications one would make using SFML. Or why anybody would want to make them at all for that matter. Still support the feature, though, because the third one you stated is relevant and actually sounds pretty helpful.

I think this notion that SFML is just for games is completely misguided.  Any library that makes the creation of a graphical tool easier is priceless.  I am evaluating SFML for the creation of graphical utilities, because it's much simpler to use than OpenSDL.  And for utilities, drag an drop is a very handy way for people to locate directories, save or retrieve images, etc.

If it were so easy to use native GUI systems then none of these libraries would be popular.  But the fact is that few people have created graphical APIs with programmers in mind.  SFML is exactly the type of code that used to sell for $500 each to developers.


Phanoo

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: File drop
« Reply #28 on: August 11, 2016, 04:39:42 pm »
I suggest adding this functionnality, it's really needed for modern apps where you can drag-n-drop files instead of choosing them from the file explorer. But no problem it's probably too much work :)

Phanoo

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: File drop
« Reply #29 on: August 26, 2016, 05:05:27 pm »

 

anything