diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 7f93ea65b4d85c24dd9345ebff15a6180a436caa..2d376e64a6934c516c08f709a5c1e4a631d1d3c2 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -254,7 +254,7 @@ function _M:newGame() if __module_extra_info.birth_done_script then loadstring(__module_extra_info.birth_done_script)() end end, true) self:registerDialog(d) - if __module_extra_info.no_birth_popup then d.key:triggerVirtual("ACCEPT") end + if __module_extra_info.no_birth_popup then d.key:triggerVirtual("EXIT") end end if self.player.no_birth_levelup or __module_extra_info.no_birth_popup then birthend() diff --git a/game/modules/tome/dialogs/Birther.lua b/game/modules/tome/dialogs/Birther.lua index ef651fe716681d8d8b40fbaf90ebec4acb091529..1b48c384df07522946da3a560ef1f2b904541734 100644 --- a/game/modules/tome/dialogs/Birther.lua +++ b/game/modules/tome/dialogs/Birther.lua @@ -57,7 +57,9 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h) self.c_tile = Button.new{text="Select custom tile", fct=function() self:selectTile() end} self.c_cancel = Button.new{text="Cancel", fct=function() self:atEnd("quit") end} - self.c_name = Textbox.new{title="Name: ", text=game.player_name, chars=30, max_len=50, fct=function() end, on_change=function() self:setDescriptor() end} + self.c_name = Textbox.new{title="Name: ", text=game.player_name, chars=30, max_len=50, fct=function() + if config.settings.cheat then self:makeDefault() end + end, on_change=function() self:setDescriptor() end} self.c_female = Checkbox.new{title="Female", default=true, fct=function() end, @@ -181,6 +183,19 @@ function _M:atEnd(v) end end +--- Make a default character when using cheat mode, for easier testing +function _M:makeDefault() + self:setDescriptor("sex", "Female") + self:setDescriptor("world", "Maj'Eyal") + self:setDescriptor("difficulty", "Normal") + self:setDescriptor("race", "Human") + self:setDescriptor("subrace", "Higher") + self:setDescriptor("class", "Warrior") + self:setDescriptor("subclass", "Fighter") + __module_extra_info.no_birth_popup = true + self:atEnd("created") +end + function _M:randomBirth() -- Random sex local sex = rng.percent(50)