diff --git a/game/engines/default/engine/UserChat.lua b/game/engines/default/engine/UserChat.lua index f8cac16d67adc6c89665cbbd93a1b63815bb9f78..d646700dff24cbb2b2184dc4837bab6cb8e2b159 100644 --- a/game/engines/default/engine/UserChat.lua +++ b/game/engines/default/engine/UserChat.lua @@ -69,16 +69,16 @@ function _M:event(e) self.channels[e.channel] = self.channels[e.channel] or {users={}, log={}} self:addMessage(e.channel, e.login, e.name, e.msg) - if type(game) == "table" and game.logNoNotify then - game.logNoNotify("#YELLOW#<%s> %s", e.name, e.msg) + if type(game) == "table" and game.logChat then + game.logChat("#YELLOW#<%s> %s", e.name, e.msg) end elseif e.se == "Join" then self.channels[e.channel] = self.channels[e.channel] or {users={}, log={}} self.channels[e.channel].users[e.login] = {name=e.name, login=e.login} self.channels_changed = true self:addMessage(e.channel, e.login, e.name, "#{italic}##FIREBRICK#has joined the channel#{normal}#") - if type(game) == "table" and game.logNoNotify and e.channel == self.cur_channel then - game.logNoNotify("#{italic}##FIREBRICK#%s has joined channel %s (press space to talk).#{normal}#", e.login, e.channel) + if type(game) == "table" and game.logChat and e.channel == self.cur_channel then + game.logChat("#{italic}##FIREBRICK#%s has joined channel %s (press space to talk).#{normal}#", e.login, e.channel) end self:updateChanList() elseif e.se == "Part" then @@ -86,8 +86,8 @@ function _M:event(e) self.channels[e.channel].users[e.login] = nil self.channels_changed = true self:addMessage(e.channel, e.login, e.name, "#{italic}##FIREBRICK#has left the channel#{normal}#") - if type(game) == "table" and game.logNoNotify and e.channel == self.cur_channel then - game.logNoNotify("#{italic}##FIREBRICK#%s has left channel %s.#{normal}#", e.login, e.channel) + if type(game) == "table" and game.logChat and e.channel == self.cur_channel then + game.logChat("#{italic}##FIREBRICK#%s has left channel %s.#{normal}#", e.login, e.channel) end self:updateChanList() elseif e.se == "UserInfo" then diff --git a/game/engines/default/engine/interface/ActorLevel.lua b/game/engines/default/engine/interface/ActorLevel.lua index e9044695e0f4521b599d9bebd71adba2eba2e6c3..b09cf92a9ff60c0acaff426cf832709a2de0d2a6 100644 --- a/game/engines/default/engine/interface/ActorLevel.lua +++ b/game/engines/default/engine/interface/ActorLevel.lua @@ -40,6 +40,8 @@ function _M:init(t) self.exp = t.exp or 0 self.exp_mod = t.exp_mod or 1 self.exp_worth = t.exp_worth or 1 + self.level = self.level or 1 + self.start_level = self.start_level or 1 if not t.level_range or self._actor_level_init then return end diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 67b8ed341b886a0f43c33537f257de1b1be4e14d..bf34854a89a79ab35fd6afe6e31de516ff34c255 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -97,7 +97,9 @@ function _M:run() self:createSeparators() self.log = function(style, ...) if type(style) == "number" then self.logdisplay(...) self.flash(style, ...) else self.logdisplay(style, ...) self.flash(self.flash.NEUTRAL, style, ...) end end - self.logNoNotify = function(style, ...) if type(style) == "number" then + self.logChat = function(style, ...) + if not config.settings.tome.chat_log then return end + if type(style) == "number" then local old = self.logdisplay.changed self.logdisplay(...) self.flash(style, ...) else self.logdisplay(style, ...) self.flash(self.flash.NEUTRAL, style, ...) end if self.show_userchat then self.logdisplay.changed = old end diff --git a/game/modules/tome/dialogs/GameOptions.lua b/game/modules/tome/dialogs/GameOptions.lua index ced055a1cfe610e06d6988a876870e23641733ed..524b5b5bc61d0a163e00ed5bf1385801c3a83482 100644 --- a/game/modules/tome/dialogs/GameOptions.lua +++ b/game/modules/tome/dialogs/GameOptions.lua @@ -128,5 +128,23 @@ function _M:generateList() self.c_list:drawItem(item) end,} + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Enables smooth fog-of-war.\nDisabling it will make the fog of war look 'blocky' but might gain a slight performance increase.#WHITE#"} + list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Smooth fog of war#WHITE##{normal}#", status=function(item) + return tostring(config.settings.tome.smooth_fov and "enabled" or "disabled") + end, fct=function(item) + config.settings.tome.smooth_fov = not config.settings.tome.smooth_fov + game:saveSettings("tome.smooth_fov", ("tome.smooth_fov = %s\n"):format(tostring(config.settings.tome.smooth_fov))) + self.c_list:drawItem(item) + end,} + + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"If enabled the chats between players will also appear in the game log, in addition to the normal chat log.#WHITE#"} + list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Community chat appears in the game log#WHITE##{normal}#", status=function(item) + return tostring(config.settings.tome.chat_log and "enabled" or "disabled") + end, fct=function(item) + config.settings.tome.chat_log = not config.settings.tome.chat_log + game:saveSettings("tome.chat_log", ("tome.chat_log = %s\n"):format(tostring(config.settings.tome.chat_log))) + self.c_list:drawItem(item) + end,} + self.list = list end diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua index ac727484b938184978546791291c7d0bf892b7a4..c822677700f6ee67638d83de111a02b720c3fb1c 100644 --- a/game/modules/tome/load.lua +++ b/game/modules/tome/load.lua @@ -199,6 +199,7 @@ if not config.settings.tome.gfx then config.settings.tome.gfx = {size="32x32", t if type(config.settings.tome.weather_effects) == "nil" then config.settings.tome.weather_effects = true end if type(config.settings.tome.smooth_fov) == "nil" then config.settings.tome.smooth_fov = true end if type(config.settings.tome.daynight) == "nil" then config.settings.tome.daynight = true end +if type(config.settings.tome.chat_log) == "nil" then config.settings.tome.chat_log = true end Map.smooth_scroll = config.settings.tome.smooth_move return {require "mod.class.Game", require "mod.class.World"}