Skip to content

Commit

Permalink
Clear batch
Browse files Browse the repository at this point in the history
  • Loading branch information
subsoap committed Jan 4, 2018
1 parent 7f05660 commit 334551d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions defquest/defquest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ function M.clear_all()
M.defsave.set(M.defsave_filename, "defquest", M.quests )
end

function M.clear_batch(quest_ids)
for key, value in pairs(quest_ids) do
M.quests[value] = nil
end
M.defsave.set(M.defsave_filename, "defquest", M.quests )
end

function M.sync_ntp()
if not pcall(M.ntp.update_time) then
print("DefQuest: Warning cannot sync with NTP servers")
Expand Down
3 changes: 2 additions & 1 deletion example/main.gui_script
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ function on_input(self, action_id, action)
if action_id == hash("key_t") and action.released then
--pprint(defquest.get_tagged("defold", defquest.ACTIVE))
--pprint(defquest.get_active())
defquest.shift_end_time(defquest.get_active(), -10)
--defquest.shift_end_time(defquest.get_active(), -10)
defquest.clear_batch(defquest.get_active())
end
end

Expand Down

0 comments on commit 334551d

Please sign in to comment.