Revision 3675

Date:
2019-09-18 02:14:34
Author:
dsb
Revision Log:
- Have to write the config{} subtable to the files, idiot...
- I swear, I wish Lua would catch the self.method() vs. self:method() typo.
Files:

Legend:

 
Added
 
Removed
 
Modified
  • tome2/trunk/class/Automatizer.lua

     
    702 702 f:write('\nnewAutomatizerRule {\n')
    703 703 f:write((' name = %q,\n'):format(rule.name))
    704 704 f:write((" action = '%s',\n"):format(rule.action))
    705 if rule.inscription then
    705 if rule.inscription and rule.action == 'inscribe' then
    706 706 f:write((' inscription = %q,\n'):format(rule.inscription))
    707 707 end
    708 if rule.config and rule.action == 'configure' then
    709 f:write(' config = {\n')
    710 for tag, v in pairs(rule.config) do
    711 if v then f:write((' %s = true,\n'):format(tag)) end
    712 end
    713 f:write(' },\n')
    714 end
    708 715 f:write((' match = %s,\n'):format(write_match(rule.match, ' ')))
    709 716 -- Note that we don't write out the 'auto' or 'global' fields; those are
    710 717 -- determined by which definitions file they're loaded from (and in turn
     
    734 741 end
    735 742 f:close()
    736 743
    737 local filename, save_dir = self.playerFilename(true)
    744 local filename, save_dir = self:playerFilename(true)
    738 745 fs.mkdir(save_dir)
    739 746 f = fs.open(filename, 'w')
    740 747 f:write(hdr)