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

Permadeath setting is remembered

git-svn-id: http://svn.net-core.org/repos/t-engine4@4124 51575b47-30f0-44d4-a5cc-537603b46e54
parent eaf69f01
No related branches found
No related tags found
No related merge requests found
......@@ -202,6 +202,7 @@ newBirthDescriptor{
name = "Exploration",
locked = function(birther) return birther:isDonator() or "hide" end,
locked_desc = "Exploration mode: Infinite lives (donator feature)",
selection_default = config.settings.tome.default_birth and config.settings.tome.default_birth.permadeath == "Exploration",
desc =
{
"#GOLD##{bold}#Exploration mode#WHITE#",
......@@ -214,11 +215,11 @@ newBirthDescriptor{
infinite_lifes = 1,
},
}
]]
--]]
newBirthDescriptor{
type = "permadeath",
name = "Adventure",
selection_default = true,
selection_default = config.settings.tome.default_birth and config.settings.tome.default_birth.permadeath == "Adventure",
desc =
{
"#GOLD##{bold}#Adventure mode#WHITE#",
......@@ -233,6 +234,7 @@ newBirthDescriptor{
newBirthDescriptor{
type = "permadeath",
name = "Roguelike",
selection_default = config.settings.tome.default_birth and config.settings.tome.default_birth.permadeath == "Roguelike",
desc =
{
"#GOLD##{bold}#Roguelike mode#WHITE#",
......
......@@ -194,6 +194,8 @@ function _M:atEnd(v)
self.actor.moddable_tile = nil
end
game:setPlayerName(self.c_name.text)
game:saveSettings("tome.default_birth", ("tome.default_birth = {permadeath = %q}\n"):format(self.actor.descriptor.permadeath))
self.at_end(false)
end)
elseif v == "loaded" then
......@@ -494,7 +496,7 @@ function _M:generateDifficulties()
if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
list[#list+1] = { name = tstring{d.display_name}:toString(), id=d.name, desc=desc }
if oldsel == d.name then oldsel = #list end
if d.selection_default then self.default_difficulty = d.name end
if util.getval(d.selection_default) then self.default_difficulty = d.name end
end
end
end
......@@ -526,7 +528,7 @@ function _M:generatePermadeaths()
if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
list[#list+1] = { name = tstring{d.display_name}:toString(), id=d.name, desc=desc }
if oldsel == d.name then oldsel = #list end
if d.selection_default then self.default_permadeath = d.name end
if util.getval(d.selection_default) then self.default_permadeath = d.name end
end
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