Difference between revisions of "Talk:TLTools"
m (File reading bug) |
Aaronwizard (talk | contribs) (→File reading bug) |
||
Line 6: | Line 6: | ||
What specifically is the bug? is it on the tracker? --[[User:Elvashi|Elvashi]] 13:34, 22 June 2011 (BST) | What specifically is the bug? is it on the tracker? --[[User:Elvashi|Elvashi]] 13:34, 22 June 2011 (BST) | ||
+ | |||
+ | == No booleans == | ||
+ | |||
+ | I tried to save a table with a boolean value in it using TSerial, but it didn't appear in the file. | ||
+ | |||
+ | The code: | ||
+ | <source lang="lua"> | ||
+ | local DEFAULTS = { | ||
+ | screen_width = 1024, | ||
+ | screen_height = 1640, | ||
+ | fullscreen = true | ||
+ | } | ||
+ | |||
+ | local file = love.filesystem.newFile('settings') | ||
+ | file:open('w') | ||
+ | file:write( TSerial.pack(DEFAULTS) ) | ||
+ | file:close() | ||
+ | </source> | ||
+ | |||
+ | The resulting file: | ||
+ | <source lang="text"> | ||
+ | {["screen_width"]=1024,fullscreen=true,["screen_height"]=640,} | ||
+ | </source> | ||
+ | --[[User:Aaronwizard|Aaronwizard]] 03:57, 23 May 2012 (BST) |
Revision as of 02:57, 23 May 2012
File reading bug
The page says:
- "Please note: Do not write compressed strings to a file, since they can't be read correctly by Love 0.7.0 due to a file-reading bug."
What specifically is the bug? is it on the tracker? --Elvashi 13:34, 22 June 2011 (BST)
No booleans
I tried to save a table with a boolean value in it using TSerial, but it didn't appear in the file.
The code:
local DEFAULTS = {
screen_width = 1024,
screen_height = 1640,
fullscreen = true
}
local file = love.filesystem.newFile('settings')
file:open('w')
file:write( TSerial.pack(DEFAULTS) )
file:close()
The resulting file:
{["screen_width"]=1024,fullscreen=true,["screen_height"]=640,}
--Aaronwizard 03:57, 23 May 2012 (BST)