From 9e64c75269cba97b950d3995e64dec11ea2ab355 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 19 Aug 2012 20:31:15 +0000
Subject: [PATCH] Sex choice is remembered

git-svn-id: http://svn.net-core.org/repos/t-engine4@5528 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/dialogs/Birther.lua | 7 ++++++-
 game/profile-thread/Client.lua        | 1 -
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/dialogs/Birther.lua b/game/modules/tome/dialogs/Birther.lua
index a0f44c83a4..9aad7ee7cd 100644
--- a/game/modules/tome/dialogs/Birther.lua
+++ b/game/modules/tome/dialogs/Birther.lua
@@ -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)
diff --git a/game/profile-thread/Client.lua b/game/profile-thread/Client.lua
index e96f02dfac..cc8d51ec33 100644
--- a/game/profile-thread/Client.lua
+++ b/game/profile-thread/Client.lua
@@ -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
 
-- 
GitLab