Page 4 of 5

Re: LoveFS

Posted: Sun Nov 09, 2014 5:45 am
by Positive07
Thank you! That is nice :3 I'll host it and let you know about it.

Re: LoveFS

Posted: Thu Feb 19, 2015 9:27 am
by Linkpy
Hello ! I see that, on Windows, you got some trouble with spamming cmd~...
You can use kernel32.dll functions directly in Love2D using FFI library : http://luajit.org/ext_ffi.html (Love2D use LuaJIT which include FFI). But you need to setup the C part with all C datatype (BOOL, LPCTSTR, , _FILETIME, etc, etc...)

Use it like this :
kernel32.lua

Code: Select all

ffi = require "ffi"

kernel32 = {}
kernel32._handle = ffi.load ("Kernel32")

ffi.cdef [[

DWORD GetFileAttributesA (LPCTSTR path);
// More code~

]]

function kernel32:get_file_attributes (path)
    return self._handle.GetFileAttributesA (path)
end

-- More code~

function file_exists (path)
    local res = kernel32:get_file_attributes (path)

    --if on W32 :
    return res ~= -1 -- (0xffffffffffffffff)
    -- if on W64 :
    return res ~= 4294967295 -- (0x00000000ffffffff) Thanks Microsoft... ~
end
And you just need to do this for what you need ! :awesome:
You can do it also for POSIX system. But I think you don't need any "ffi.load" call :crazy:
You done a great job, don't staph :)
Bye~

PS: I found this : https://github.com/stuta/Luajit-Tcp-Server Use "WTypes.lua" and "WinBase.lua" for all C types. But if you copy that, don't forget the credit :emo:

Re: LoveFS

Posted: Thu Apr 30, 2015 1:26 am
by raingloom
I get this error when running it on latest 64 bit Ubuntu with Löve from the official PPA:

Code: Select all

stack traceback:
	[C]: in function 'ipairs'
	lovefs/dialogs.lua:37: in function 'refresh'
	lovefs/dialogs.lua:174: in function 'loadDialog'
	main.lua:16: in function 'onclick'
	loveframes/objects/button.lua:195: in function 'mousereleased'
	loveframes/objects/base.lua:141: in function 'mousereleased'
	loveframes/init.lua:267: in function 'mousereleased'
	main.lua:76: in function <main.lua:75>
	[string "boot.lua"]:433: in function <[string "boot.lua"]:413>
	[C]: in function 'xpcall'

Re: LoveFS

Posted: Thu Apr 30, 2015 12:00 pm
by linux-man
It seems that os.execute() always return -1. This behaviour breaks the code since a successful execution should return 0.
This is probably due to the change to luajit and some compilation option in love 0.9.2. I would call it a bug.
I'll try to make lovefs work but right now I don't have any chance to test os.execute.

Re: LoveFS

Posted: Mon Nov 07, 2016 11:15 pm
by linux-man
At last 0.10.2 killed the os.execute() bug, BUT... since I've been away for so long, It was time to rewrite this library.
loveFS 1.0 drop console commands and embrace ffi, so it's now feasible to use it on Windows.
Also, the demo is made with Gspot.
Tested on Mint 64 bits and Windows 7 32 bits.
Thanks to Linkpy for showing me the way. You're the man!
(1st post updated with links)

Re: LoveFS

Posted: Tue Nov 08, 2016 2:44 am
by pgimeno
Very nice library! At last a good alternative to the binary LuaFileSystem. I've sent a pull request for a fix related to having more than one window open (which shouldn't be possible).

About this bit from the OP:
File Systems are the most boring subject I can find, but, since I started a game editor in love (yet to come) I had some revolutionary ideas like loading images from somewhere...
I'm interested in that. I've been considering working on one since I first saw LÖVE. Specifically, a ZZT/MZX-style editor, with several ZZT/MZX-like preset tiles and effects. So I have to ask, what kind of game editor is that and what's its current status?

Re: LoveFS

Posted: Tue Nov 08, 2016 12:29 pm
by linux-man
You're right. I think that a better fix (more inline with code style) would be

Code: Select all

if self.dialog then
    self:closeDialog(gspot)
end
The editor I was talking about was developed in loveframes 4 years ago. It's very very VERY incomplete and I must try it with the last loveframes version. Since the future of loveframes is uncertain, I don't know if the code is of any interest.

Re: LoveFS

Posted: Tue Nov 08, 2016 1:18 pm
by pgimeno
linux-man wrote:You're right. I think that a better fix (more inline with code style) would be

Code: Select all

if self.dialog then
    self:closeDialog(gspot)
end
That might use a different gspot instance to that the previous dialog was created with, and crash. That's why I used self.dialog.Gspot, which should use the same instance.
linux-man wrote:The editor I was talking about was developed in loveframes 4 years ago. It's very very VERY incomplete and I must try it with the last loveframes version. Since the future of loveframes is uncertain, I don't know if the code is of any interest.
Thanks. I'm still interested. I've seen a few ports of loveframes to LÖVE 0.10, so not all is lost. What kind of games was it for?

Re: LoveFS

Posted: Tue Nov 08, 2016 2:43 pm
by linux-man
Never thought of using several gspot instances. Pull accepted.
Give me some time to update the editor code (the game was named "Knights" and would be a "Lords of Midnight" clone).

Re: LoveFS

Posted: Sun Nov 13, 2016 9:24 pm
by linux-man
Another update, now with a LoveFrames dialog based on a modified LoveFrames (https://github.com/linux-man/LoveFrames).
Any suggestion for other GUI?