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

Sex choice is remembered

git-svn-id: http://svn.net-core.org/repos/t-engine4@5528 51575b47-30f0-44d4-a5cc-537603b46e54
parent 8974f7c3
No related branches found
No related tags found
No related merge requests found
......@@ -163,6 +163,11 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h)
for i, item in ipairs(self.c_campaign.c_list.list) do if self.default_campaign == item.id then self.c_campaign.c_list.sel = i break end end
for i, item in ipairs(self.c_difficulty.c_list.list) do if self.default_difficulty == item.id then self.c_difficulty.c_list.sel = i break end end
for i, item in ipairs(self.c_permadeath.c_list.list) do if self.default_permadeath == item.id then self.c_permadeath.c_list.sel = i break end end
if config.settings.tome.default_birth and config.settings.tome.default_birth.sex then
self.c_female.checked = config.settings.tome.default_birth.sex == "Female"
self.c_male.checked = config.settings.tome.default_birth.sex ~= "Female"
self:setDescriptor("sex", self.c_female.checked and "Female" or "Male")
end
self:setFocus(self.c_campaign)
self:setFocus(self.c_name)
......@@ -277,7 +282,7 @@ function _M:atEnd(v)
save:delete()
save:close()
game:saveSettings("tome.default_birth", ("tome.default_birth = {permadeath = %q}\n"):format(self.actor.descriptor.permadeath))
game:saveSettings("tome.default_birth", ("tome.default_birth = {permadeath=%q, sex=%q}\n"):format(self.actor.descriptor.permadeath, self.actor.descriptor.sex))
self.at_end(false)
end)
......
......@@ -206,7 +206,6 @@ end
function _M:handleOrder(o)
o = o:unserialize()
if not self.sock and o.o ~= "Login" and o.o ~= "CurrentCharacter" and o.o ~= "CheckModuleHash" and o.o ~= "CheckAddonHash" then return end -- Dont do stuff without a connection, unless we try to auth
print("===order", o.o)
if self["order"..o.o] then self["order"..o.o](self, o) 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