Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add callbacks for reading/writing parameters #1326

Merged
merged 3 commits into from
Mar 14, 2021
Merged
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
10 changes: 10 additions & 0 deletions lua/core/paramset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function ParamSet.new(id, name)
ps.hidden = {}
ps.lookup = {}
ps.group = 0
ps.action_write = nil
ps.action_read = nil
ParamSet.sets[ps.id] = ps
return ps
end
Expand Down Expand Up @@ -379,6 +381,9 @@ function ParamSet:write(filename, name)
end
end
io.close(fd)
if self.action_write ~= nil then
self.action_write(filename,name)
end
else print("pset: BAD FILENAME") end
end

Expand Down Expand Up @@ -420,6 +425,9 @@ function ParamSet:read(filename, silent)
end
end
end
if self.action_read ~= nil then
self.action_read(filename,silent)
end
else
print("pset :: "..filename.." not read.")
end
Expand All @@ -445,6 +453,8 @@ function ParamSet:clear()
self.name = ""
self.params = {}
self.count = 0
self.action_read = nil
self.action_write = nil
end

return ParamSet