View topic - Muting/banning player ingame



All times are UTC + 1 hour


Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: 14 Apr 2012, 21:08 
Lua Coder
User avatar

Joined: 20 Feb 2007, 01:10
knorke wrote:
yup. Those are the sounds: http://springrts.com/wiki/Sounds.lua#Re ... SoundItems
Mods could set them to silent/empty, then use Lua. As player maybe put ui volume to silent in springsettings?

Thanks for pointing that out. Implemented and added to BA. That should fix the "Zan-issue".
Btw syntax is "/mute <playername>" and "/unmute <playername>"


Top
 Offline Profile  
 
PostPosted: 25 Apr 2012, 12:45 
Lua Coder

Joined: 12 Jul 2009, 17:57
This is best done by fixing the widgethandler and returning false from AddConsoleLine for muted chat. -> No need to edit all the chat widgets.


Top
 Offline Profile  
 
PostPosted: 25 Apr 2012, 13:29 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
good idea..
is that the widgets\widgets.lua file?
because ba has some bawidgets.lua so it would require change to mod..?


Top
 Offline Profile  
 
PostPosted: 25 Apr 2012, 13:37 
Lua Coder

Joined: 12 Jul 2009, 17:57
I did it for the new widget handler.
Code:
function hHookFuncs.AddConsoleLine(line, level)
     for _,f in hCallInLists.AddConsoleLine:iter() do
      if (f(line, level)) then
         return true
      end
   end

   return false
end

Old widgethandler, just add the if return.
BTW will work only for Luaui handled console drawing, because engine doesn't test the return value..
Code:
function widgetHandler:AddConsoleLine(msg, priority)
  for _,w in ipairs(self.AddConsoleLineList) do
    w:AddConsoleLine(msg, priority)
  end
  return
end


Top
 Offline Profile  
 
PostPosted: 25 Apr 2012, 13:56 
Lua Coder

Joined: 12 Jul 2009, 17:57
mute widget


Attachments:
cmd_mute.lua [2.2 KiB]
Downloaded 100 times
Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Tom Fyuri and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.