load to prefs added

This commit is contained in:
p.kosyh 2010-07-24 11:50:56 +00:00
parent d6f6f013c0
commit 148d3cf631

View file

@ -1,12 +1,15 @@
prefs = obj { prefs = obj {
nam = 'preferences', nam = 'preferences',
system_type = true, system_type = true,
ini = function(s) load = function(s)
local name = get_savepath() .. '/prefs'; local name = get_savepath() .. '/prefs';
local f, err = loadfile(name); local f, err = loadfile(name);
if not f then return nil end if not f then return nil end
f(); f();
end, end,
ini = function(s)
return s:load()
end,
store = function(s) store = function(s)
local name = get_savepath() .. '/prefs'; local name = get_savepath() .. '/prefs';
local h = stead.io.open(name,"w"); local h = stead.io.open(name,"w");