Skip to content
Snippets Groups Projects
Commit 342135dc authored by dg's avatar dg
Browse files

Added an option to not have chats appear in the game log

git-svn-id: http://svn.net-core.org/repos/t-engine4@2912 51575b47-30f0-44d4-a5cc-537603b46e54
parent 75da1a84
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -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"}
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