Muting/banning player ingame - Page 2

Muting/banning player ingame

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Muting/banning player ingame

Post by very_bad_soldier »

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>"
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: Muting/banning player ingame

Post by Pako »

This is best done by fixing the widgethandler and returning false from AddConsoleLine for muted chat. -> No need to edit all the chat widgets.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Muting/banning player ingame

Post by knorke »

good idea..
is that the widgets\widgets.lua file?
because ba has some bawidgets.lua so it would require change to mod..?
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: Muting/banning player ingame

Post by Pako »

I did it for the new widget handler.

Code: Select all

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: Select all

function widgetHandler:AddConsoleLine(msg, priority)
  for _,w in ipairs(self.AddConsoleLineList) do
    w:AddConsoleLine(msg, priority)
  end
  return
end
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: Muting/banning player ingame

Post by Pako »

mute widget
Attachments
cmd_mute.lua
(2.2 KiB) Downloaded 122 times
Post Reply

Return to “General Discussion”