PK ’¯Öô´´hooks/load.lualocal KeyBind = require "engine.KeyBind" local Dialog = require "engine.ui.Dialog" -- Reload the current character's last save. Deliberately does NOT save first: -- the game's own autosaves decide what the last save contains. local function quickLoad() if not game or not game.save_name or not game.__mod_info then return end Dialog:yesnoPopup("Quick Load", "Reload your last save? Progress since then will be lost.", function(ok) if not ok then return end print("[QUICK_LOAD] Reloading save:", game.save_name) util.showMainMenu(false, nil, nil, game.__mod_info.short_name, game.save_name, false) end, "Load", "Cancel") end class:bindHook("ToME:load", function(self, data) KeyBind:defineAction { default = { "sym:_l:true:true:false:false" }, -- Ctrl+Shift+L type = "QUICK_LOAD", group = "actions", name = _t"Quick load last save", } end) -- Bind the key once the game's input is set up class:bindHook("ToME:runDone", function(self, data) if game and game.key and game.key.addBinds then game.key:addBinds { QUICK_LOAD = quickLoad } end end) class:bindHook("Game:alterGameMenu", function(self, data) for _, item in ipairs(data.menu) do if type(item) == "table" and item[1] == "Quick Load" then return end end table.insert(data.menu, math.min(#data.menu, 5), {"Quick Load", function() data.unregister() quickLoad() end}) end) PK ÎüLLinit.lualong_name = "Quick Load" short_name = "quick-load" for_module = "tome" version = {1, 7, 6} addon_version = {1, 0, 0} weight = 5 author = { 'CS' } homepage = 'http://te4.org/users/cshigaki' description = [[Easy save scumming]] tags = {'save', 'scumming', 'ui'} overload = true superload = false hooks = true data = falsePK ’¯Öô´´hooks/load.luaPK ÎüLLàinit.luaPKrR