Skip to content
Snippets Groups Projects
Commit 57508be9 authored by DarkGod's avatar DarkGod
Browse files

When the game refuses to load a savefile due to the stone warden addons being...

When the game refuses to load a savefile due to the stone warden addons being offline, it will let you force it to load -- at your own risk
parent c06fd563
No related branches found
No related tags found
No related merge requests found
......@@ -416,16 +416,22 @@ function _M:loadAddons(mod, saveuse)
local data = profile:getDLCD(add.for_module.."-"..add.short_name, ("%d.%d.%d"):format(add.version[1],add.version[2],add.version[3]), name:gsub("%.", "/")..".lua")
if data and data ~= '' then
profile.dlc_files.classes[name] = data
else
elseif not __module_extra_info.ignore_addons_not_loading then
print("Removing addon "..add.short_name..": DLC class not received")
table.remove(adds, i) removed = true
if saveuse then
-- The savefile requires it, but we couldnt activate it, abord
core.game.setRebootMessage(([[The savefile requires the #YELLOW#%s#WHITE# addon.
Some of its features require being online and could not be enabled. To prevent damaging the savefile loading was aborded.]]):format(add.long_name))
util.showMainMenu()
Some of its features require being online and could not be enabled. To prevent damaging the savefile loading was aborded.
You may try to force loading if you are sure the savefile does not use that addon, at your own risk, by checking the "Ignore unloadable addons" checkbox on the load game screen..]]):format(add.long_name))
util.showMainMenu(nil, nil, nil, nil, nil, nil, "show_ignore_addons_not_loading=true")
end
break
else
add.dlc = "no"
print("Removing addon "..add.short_name..": dlc file required not found")
table.remove(adds, i) removed = true
end
end
end
......@@ -674,11 +680,11 @@ end
-- @param mod the module definition as given by Module:loadDefinition()
-- @param name the savefile name
-- @param new_game true if the game must be created (aka new character)
function _M:instanciate(mod, name, new_game, no_reboot)
function _M:instanciate(mod, name, new_game, no_reboot, extra_module_info)
if not no_reboot then
local eng_v = nil
if not mod.incompatible then eng_v = ("%d.%d.%d"):format(mod.engine[1], mod.engine[2], mod.engine[3]) end
util.showMainMenu(false, mod.engine[4], eng_v, mod.version_string, name, new_game)
util.showMainMenu(false, mod.engine[4], eng_v, mod.version_string, name, new_game, extra_module_info)
return
end
......
......@@ -33,6 +33,7 @@ function _M:init()
Dialog.init(self, "Load Game", game.w * 0.8, game.h * 0.8)
self.c_compat = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Show older versions", on_change=function() self:switch() end}
self.c_force_addons = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Ignore unloadable addons"}
self.c_play = Button.new{text=" Play! ", fct=function(text) self:playSave() end}
self.c_delete = Button.new{text="Delete", fct=function(text) self:deleteSave() end}
self.c_desc = Textzone.new{width=math.floor(self.iw / 3 * 2 - 10), height=self.ih - self.c_delete.h - 10, text=""}
......@@ -56,14 +57,20 @@ function _M:init()
}
local sep = Separator.new{dir="horizontal", size=self.ih - 10}
self:loadUI{
local uis = {
{left=0, top=0, ui=self.c_tree},
{left=self.c_tree.w+sep.w, top=0, ui=self.c_desc},
{right=0, bottom=0, ui=self.c_delete, hidden=true},
{left=0, bottom=0, ui=self.c_play, hidden=true},
{left=self.c_tree.w + 5, top=5, ui=sep},
{left=self.c_tree.w - self.c_compat.w, bottom=0, ui=self.c_compat},
}
if __module_extra_info.show_ignore_addons_not_loading then
uis[#uis+1] = {left=self.c_tree.w - self.c_compat.w, bottom=self.c_force_addons.h, ui=self.c_compat}
uis[#uis+1] = {left=self.c_tree.w - self.c_force_addons.w, bottom=0, ui=self.c_force_addons}
else
uis[#uis+1] = {left=self.c_tree.w - self.c_compat.w, bottom=0, ui=self.c_compat}
end
self:loadUI(uis)
self:setFocus(self.c_tree)
self:setupUI(false, true)
......@@ -167,7 +174,9 @@ function _M:playSave()
Module:instanciate(self.save_sel.mod, self.save_sel.base_name, false)
end end, "Cancel", "Load anyway", true)
else
Module:instanciate(self.save_sel.mod, self.save_sel.base_name, false)
local extra_info = nil
if self.c_force_addons.checked then extra_info = "ignore_addons_not_loading=true" end
Module:instanciate(self.save_sel.mod, self.save_sel.base_name, false, nil, extra_info)
end
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