LoveFS

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Positive07
Party member
Posts: 1006
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: LoveFS

Post by Positive07 » Sun Nov 09, 2014 5:45 am

Thank you! That is nice :3 I'll host it and let you know about it.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

User avatar
Linkpy
Party member
Posts: 102
Joined: Fri Aug 29, 2014 6:05 pm
Location: France
Contact:

Re: LoveFS

Post by Linkpy » Thu Feb 19, 2015 9:27 am

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:
Founder of NeoShadow Studio. Currently working on the project "Sirami".
github / linkpy

User avatar
raingloom
Prole
Posts: 36
Joined: Wed Apr 22, 2015 12:35 am
Location: Always elsewhere

Re: LoveFS

Post by raingloom » Thu Apr 30, 2015 1:26 am

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'

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: LoveFS

Post by linux-man » Thu Apr 30, 2015 12:00 pm

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.

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: LoveFS

Post by linux-man » Mon Nov 07, 2016 11:15 pm

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)

User avatar
pgimeno
Party member
Posts: 2484
Joined: Sun Oct 18, 2015 2:58 pm

Re: LoveFS

Post by pgimeno » Tue Nov 08, 2016 2:44 am

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?

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: LoveFS

Post by linux-man » Tue Nov 08, 2016 12:29 pm

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.

User avatar
pgimeno
Party member
Posts: 2484
Joined: Sun Oct 18, 2015 2:58 pm

Re: LoveFS

Post by pgimeno » Tue Nov 08, 2016 1:18 pm

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?

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: LoveFS

Post by linux-man » Tue Nov 08, 2016 2:43 pm

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).

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: LoveFS

Post by linux-man » Sun Nov 13, 2016 9:24 pm

Another update, now with a LoveFrames dialog based on a modified LoveFrames (https://github.com/linux-man/LoveFrames).
Any suggestion for other GUI?

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests