From 41127694e1eccac1a178e81d8539d1de5d5538de Mon Sep 17 00:00:00 2001 From: Lena Date: Fri, 1 Aug 2014 20:30:28 +0400 Subject: [PATCH] Add glon functions --- lua/helpers/luadata.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/helpers/luadata.lua b/lua/helpers/luadata.lua index 14216ac..aff9ea2 100644 --- a/lua/helpers/luadata.lua +++ b/lua/helpers/luadata.lua @@ -23,6 +23,8 @@ ]] luadata = luadata or {} local s = luadata +if not file.IsDir(luadata_options, "DATA") then file.CreateDir(luadata_options) end + luadata.EscapeSequences = { [("\a"):byte()] = [[\a]], [("\b"):byte()] = [[\b]], @@ -199,7 +201,14 @@ do -- option extension encode = util.TableToJSON MsgN("[luadata] reverting to json since glon cannot be found") - end + else + + + + -- oh ye! + + decode = glon.decode + + encode = glon.encode + + + +-- MsgN("[luadata] glon was found") + + end function luadata.AccessorFunc(tbl, func_name, var_name, nw, def) tbl["Set" .. func_name] = function(self, val) @@ -266,4 +275,4 @@ do -- option extension return type(value) == "string" and decode(value) or def end -end \ No newline at end of file +end