Skip to content
Snippets Groups Projects
Commit daf9da62 authored by dg's avatar dg
Browse files

grmf


git-svn-id: http://svn.net-core.org/repos/t-engine4@1628 51575b47-30f0-44d4-a5cc-537603b46e54
parent 6b311b06
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ function _M:init(class, max_before_wait)
self.saveclass = class or "engine.Savefile"
self.pipe = {}
self.max_before_wait = max_before_wait or 3
self.max_before_wait = max_before_wait or 4
self.co = nil
end
......@@ -47,6 +47,9 @@ end
-- @param object the object to save
-- @param class a class name, if different from the default one
function _M:push(savename, type, object, class)
print("<<<<", savename, type, object, class, "::", game.onSavefilePush) FIX ME
if game.onSavefilePush then game:onSavefilePush(savename, type, object, class) end
class = class or self.saveclass
local Savefile = require(class)
local id = Savefile["nameSave"..type:lower():capitalize()](Savefile, object)
......
......@@ -944,6 +944,13 @@ function _M:saveGame()
self.log("Saving game...")
end
--- When a zone or level is saved, also save the main game
function _M:onSavefilePush(savename, type, object, class)
print("=====", savename, type, object, class)
if type ~= "zone" or type ~= "level" then return end
self:saveGame()
end
function _M:setAllowedBuild(what, notify)
-- Do not unlock things in easy mode
--if self.difficulty == self.DIFFICULTY_EASY then return end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment