File dialogs in Love2D?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
sarako
Prole
Posts: 14
Joined: Sat Jan 24, 2015 3:12 pm

Re: File dialogs in Love2D?

Post by sarako »

Fixed it by search-replacing "wchar_t" with "char" in nativefs.lua.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: File dialogs in Love2D?

Post by pgimeno »

What do you need from nativefs that lovefs doesn't have? Yes, nativefs has pretty much the same API as love.filesystem, which is a plus, but I'm not sure it has any extended functionality with respect to lovefs. Using both sounds a bit like, for example, using two different JSON libraries to load two JSON files.
sarako
Prole
Posts: 14
Joined: Sat Jan 24, 2015 3:12 pm

Re: File dialogs in Love2D?

Post by sarako »

I don't see any way to read/write files using lovefs besides sounds, fonts, and images. I'm using custom filetypes.

I'm also running into an issue where if I load a file after I've already loaded one, the program just closes without providing any errors. Any ideas why that might happen?

Here's what I have so far: https://github.com/zenzoa/roomie
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: File dialogs in Love2D?

Post by pgimeno »

You can use the Lua io library for reading and writing files.

I have tried to load something but I can't reproduce the problem that you're having. Maybe provide a datafile that makes the program close?
sarako
Prole
Posts: 14
Joined: Sat Jan 24, 2015 3:12 pm

Re: File dialogs in Love2D?

Post by sarako »

Added test files to the repro. The steps to get it to crash: 1) create a new files, 2) open test.cos, 3) create a new file again, 4) open test.cos again. Thanks for checking!

In the meantime I'm converting my nativefs stuff to the lua io library. Totally forgot about that one. Thanks again!
sarako
Prole
Posts: 14
Joined: Sat Jan 24, 2015 3:12 pm

Re: File dialogs in Love2D?

Post by sarako »

Actually, after converting things to the lua io library, the crash has stopped happening. Not sure what made the difference, but seems to be working smoothly!
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 51 guests