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

Setting log/chat fade time to 0 makes it never fade out

git-svn-id: http://svn.net-core.org/repos/t-engine4@3850 51575b47-30f0-44d4-a5cc-537603b46e54
parent dd7cf621
No related branches found
No related tags found
No related merge requests found
......@@ -173,7 +173,7 @@ function _M:toScreen()
local item = self.dlist[i].item
local fade = 1
if self.fading then
if self.fading and self.fading > 0 then
fade = now - self.dlist[i].date
if fade < self.fading * 1000 then fade = 1
elseif fade < self.fading * 2000 then fade = (self.fading * 2000 - fade) / (self.fading * 1000)
......
......@@ -196,10 +196,10 @@ function _M:achievement(name)
end
--- Request a line to send
function _M:talkBox()
function _M:talkBox(on_end)
if not profile.auth then return end
local Talkbox = require "engine.dialogs.Talkbox"
local d = Talkbox.new(self)
local d = Talkbox.new(self, on_end)
game:registerDialog(d)
self:updateChanList()
......@@ -443,7 +443,7 @@ function _M:toScreen()
local item = self.dlist[i].item
local fade = 1
if self.fading then
if self.fading and self.fading > 0 then
fade = now - self.dlist[i].date
if fade < self.fading * 1000 then fade = 1
elseif fade < self.fading * 2000 then fade = (self.fading * 2000 - fade) / (self.fading * 1000)
......
......@@ -27,7 +27,8 @@ local Textzone = require "engine.ui.Textzone"
module(..., package.seeall, class.inherit(Dialog))
function _M:init(chat)
function _M:init(chat, on_end)
self.on_end = on_end
self.chat = chat
self.min = 2
self.max = 300
......@@ -120,6 +121,8 @@ function _M:okclick()
elseif type == "whisper" then
self.chat:whisper(name, text)
end
if self.on_end then self.on_end() end
end
end
......
......@@ -187,18 +187,18 @@ function _M:generateList()
end, 2))
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"How many seconds before log and chat lines begin to fade away.."}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"How many seconds before log and chat lines begin to fade away.\nIf set to 0 the logs will never fade away."}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Log fate time#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.log_fade or 3)
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 or 3, 20, function(qty)
qty = util.bound(qty, 1, 20)
game:registerDialog(GetQuantity.new("Fade time (in seconds)", "From 2 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
game.logdisplay:enableFading(config.settings.tome.log_fade or 3)
profile.chat:enableFading(config.settings.tome.log_fade or 3)
game.logdisplay:enableFading(config.settings.tome.log_fade)
profile.chat:enableFading(config.settings.tome.log_fade)
self.c_list:drawItem(item)
end, 1))
end, 0))
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Configure the chat filters to select what kind of messages to see.#WHITE#"}
......
......@@ -63,6 +63,7 @@ if type(config.settings.tome.chat_log) == "nil" then config.settings.tome.chat_l
if not config.settings.tome.fonts then config.settings.tome.fonts = {type="fantasy", size="normal"} end
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
Map.smooth_scroll = config.settings.tome.smooth_move
Map.faction_danger_check = function(self, e) return e.rank > 3 end
......
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