diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 70da42b36983e26d150907a27eceecf3805b2387..b217a38e0a49abe1ffd6633d55289c1ac0837b4c 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -172,7 +172,7 @@ function _M:move(x, y, force) local ox, oy = self.x, self.y local moved = mod.class.Actor.move(self, x, y, force) if moved then - game.level.map:moveViewSurround(self.x, self.y, 8, 8) + game.level.map:moveViewSurround(self.x, self.y, config.settings.tome.scroll_dist, config.settings.tome.scroll_dist) game.level.map.attrs(self.x, self.y, "walked", true) if self.describeFloor then self:describeFloor(self.x, self.y) end diff --git a/game/modules/tome/dialogs/GameOptions.lua b/game/modules/tome/dialogs/GameOptions.lua index 786a687995f67bf93ac9ec2c4c4c4f22188f94dc..754819170dbc28ee7053e439d9ebe5e89958c99b 100644 --- a/game/modules/tome/dialogs/GameOptions.lua +++ b/game/modules/tome/dialogs/GameOptions.lua @@ -62,6 +62,18 @@ function _M:generateList() local list = {} local i = 0 + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Defines the distance from the screen edge at which scrolling will start. If set high enough the game will always center on the player.#WHITE#"} + list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Scroll distance#WHITE##{normal}#", status=function(item) + return tostring(config.settings.tome.scroll_dist) + end, fct=function(item) + game:registerDialog(GetQuantity.new("Scroll distance", "From 1 to 20", config.settings.tome.scroll_dist, 20, function(qty) + qty = util.bound(qty, 1, 20) + game:saveSettings("tome.scroll_dist", ("tome.scroll_dist = %d\n"):format(qty)) + config.settings.tome.scroll_dist = qty + self.c_list:drawItem(item) + end, 1)) + end,} + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Saves in the background, allowing you to continue playing. If disabled you will have to wait until the saving is done, but it will be faster.#WHITE#"} list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Save in the background#WHITE##{normal}#", status=function(item) return tostring(config.settings.background_saves and "enabled" or "disabled") @@ -70,16 +82,7 @@ function _M:generateList() game:saveSettings("background_saves", ("background_saves = %s\n"):format(tostring(config.settings.background_saves))) self.c_list:drawItem(item) end,} ---[[ - local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Autosaves the whole game when switching zones. This is safer but can make playing a bit slower while it saves. Savefiles will also be somewhat bigger.#WHITE#"} - list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Autosave when leaving a zone#WHITE##{normal}#", status=function(item) - return tostring(config.settings.tome.autosave and "enabled" or "disabled") - end, fct=function(item) - config.settings.tome.autosave = not config.settings.tome.autosave - game:saveSettings("tome.autosave", ("tome.autosave = %s\n"):format(tostring(config.settings.tome.autosave))) - self.c_list:drawItem(item) - end,} -]] + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Forces the game to save each level instead of each zone.\nThis makes it save more often but the game will use less memory when deep in a dungeon.\n\n#LIGHT_RED#Changing this option will not affect already visited zones.#WHITE#"} list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Zone save per level#WHITE##{normal}#", status=function(item) return tostring(config.settings.tome.save_zone_levels and "enabled" or "disabled") @@ -191,7 +194,7 @@ function _M:generateList() list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Log fade time#WHITE##{normal}#", status=function(item) return tostring(config.settings.tome.log_fade) end, fct=function(item) - game:registerDialog(GetQuantity.new("Fade time (in seconds)", "From 2 to 20", config.settings.tome.log_fade, 20, function(qty) + game:registerDialog(GetQuantity.new("Fade time (in seconds)", "From 0 to 20", config.settings.tome.log_fade, 20, function(qty) qty = util.bound(qty, 0, 20) game:saveSettings("tome.log_fade", ("tome.log_fade = %d\n"):format(qty)) config.settings.tome.log_fade = qty diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua index 0ef73547ed89c4158ba739a968d004fda6b797f5..a373b0b2b1e8ec5e2d935a5c97410f1a1bb0a911 100644 --- a/game/modules/tome/load.lua +++ b/game/modules/tome/load.lua @@ -66,6 +66,7 @@ if not config.settings.tome.fonts then config.settings.tome.fonts = {type="fanta if not config.settings.tome.ui_theme then config.settings.tome.ui_theme = "stone" end if not config.settings.tome.log_lines then config.settings.tome.log_lines = 5 end if not config.settings.tome.log_fade then config.settings.tome.log_fade = 3 end +if not config.settings.tome.scroll_dist then config.settings.tome.scroll_dist = 8 end Map.smooth_scroll = config.settings.tome.smooth_move Map.faction_danger_check = function(self, e) return e.rank > 3 end