Is it possible to make a file explorer?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Is it possible to make a file explorer?
Hello, I would like to know if it is possible to make a file explorer of some kind so that players could, for example, change their avatar picture to a picture on their pc.
Re: Is it possible to make a file explorer?
This is not possible without hacking into C++ side of the engine (or hooking up external C++ libraries).
You can however load files and directories that user drops onto game window, accessible through appropriate callbacks.
You can however load files and directories that user drops onto game window, accessible through appropriate callbacks.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Is it possible to make a file explorer?
It is totally possible without touching the C++ side... but it's not simple.
There are a few ways to access the filesystem apart from the love.filesystem stuff (lua's own io which has quite some limitations, using luafilesystem which requires binaries, or using my soon to be released lib which cheats quite a bit and (ab)uses both PhysFS that love.filesystem uses and OS-specific utils at least on windows to use wide-char filesystem functions... on top of any of these can people make their own explorer classes.
There are a few ways to access the filesystem apart from the love.filesystem stuff (lua's own io which has quite some limitations, using luafilesystem which requires binaries, or using my soon to be released lib which cheats quite a bit and (ab)uses both PhysFS that love.filesystem uses and OS-specific utils at least on windows to use wide-char filesystem functions... on top of any of these can people make their own explorer classes.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Is it possible to make a file explorer?
So it's totally possible without touching the C++ side, by riding heavily on the C++ side.zorg wrote: ↑Sat Nov 23, 2019 5:07 am It is totally possible without touching the C++ side... but it's not simple.
There are a few ways to access the filesystem apart from the love.filesystem stuff (lua's own io which has quite some limitations, using luafilesystem which requires binaries, or using my soon to be released lib which cheats quite a bit and (ab)uses both PhysFS that love.filesystem uses and OS-specific utils at least on windows to use wide-char filesystem functions... on top of any of these can people make their own explorer classes.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Is it possible to make a file explorer?
You ain't touching the C++ side if someone else already done did it for ya
(man pointing to his head dot jpeg)
In any case, i would state that writing such things are very error prone, so for beginners i'd recommend against writing their own... hence the case i made for using others' stuff.
Apologies for no examples though, but mine's not yet complete, and the others have minute issues imo so i didn't want to link any.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Is it possible to make a file explorer?
Quite possible but for a random location (that is outside love's reach) you might need to use a lua library to get files in a folder.
Another option is calling system commands like find/ls/dir via popen and capturing their output.
Another option is calling system commands like find/ls/dir via popen and capturing their output.
Re: Is it possible to make a file explorer?
It's simple task using ffi-luafilesystem reimplementation like this: https://github.com/3scale/luafilesystem ... fs_ffi.lua.
No binaries, also it can read/write utf8-names instead of default lfs on windows, that can be very useful.
No binaries, also it can read/write utf8-names instead of default lfs on windows, that can be very useful.
Science and violence
Who is online
Users browsing this forum: Amazon [Bot], Google [Bot] and 9 guests