Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions lua/helpers/luadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]],
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -266,4 +275,4 @@ do -- option extension

return type(value) == "string" and decode(value) or def
end
end
end