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

Whispers should appear instantly on the chat log

Can right click a player in the chat log to whisper


git-svn-id: http://svn.net-core.org/repos/t-engine4@6296 51575b47-30f0-44d4-a5cc-537603b46e54
parent 1fbffdea
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,7 @@ function _M:event(e)
if type(game) == "table" and game.logChat then
game.logChat("#GOLD#<Whisper from %s> %s", e.name, e.msg)
end
e.channel = self.cur_channel
elseif e.se == "Achievement" then
e.msg = e.msg:removeColorCodes()
local color = colors.WHITE
......@@ -253,6 +254,7 @@ function _M:whisper(to, msg)
self:addMessage("whisper", self.cur_channel, to, to, "#GOLD#<whisper to "..to.."> #LAST#"..msg)
if type(game) == "table" and game.logChat then game.logChat("#GOLD#<Whisper to %s> %s", to, msg) end
for fct, _ in pairs(self.on_event) do fct{channel=self.cur_channel, se="JustUpdate"} end
end
function _M:reportUser(to, msg)
......
......@@ -169,7 +169,7 @@ function _M:mouseEvent(button, x, y, xrel, yrel, bx, by, event)
if citem and citem.login then
local data = profile.chat:getUserInfo(citem.login)
if data then
local list = {{name="Show infos", ui="show"}, {name="Open profile(in browser)", ui="profile"}, {name="Report for bad behavior", ui="report"}}
local list = {{name="Show infos", ui="show"}, {name="Whisper", ui="whisper"}, {name="Open profile(in browser)", ui="profile"}, {name="Report for bad behavior", ui="report"}}
if data.char_link then table.insert(list, 3, {name="Open charsheet(in browser)", ui="charsheet"}) end
Dialog:listPopup("User: "..citem.login, "Action", list, 300, 200, function(sel)
if not sel or not sel.ui then return end
......@@ -180,6 +180,9 @@ function _M:mouseEvent(button, x, y, xrel, yrel, bx, by, event)
util.browserOpenUrl(data.profile)
elseif sel.ui == "charsheet" then
util.browserOpenUrl(data.char_link)
elseif sel.ui == "whisper" then
profile.chat:setCurrentTarget(false, citem.login)
profile.chat:talkBox()
elseif sel.ui == "report" then
game:registerDialog(require('engine.dialogs.GetText').new("Reason to report: "..citem.login, "Reason", 4, 500, function(text)
profile.chat:reportUser(citem.login, text)
......
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