Config, readme.

This commit is contained in:
Aaron Suen 2020-03-18 22:18:00 -04:00
parent 463b3c20e1
commit f9ae7aecc9
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,25 @@
------------------------------------------------------------------------
This mod adds a per-player-configurable beep sound for incoming messages
in the in-game chat stream, to allow players on low-traffic servers not
to miss interesting goings-on in chat.
Players can use the /szutil_chatsounds command to rewrite their own
chat configuration. Sound configuration is in the form of "gain" or
"gain:pitch" (where pitch is a multiplier, 1 is the default 440Hz tone)
for each of the message levels:
- DMs
- public chat
- emotes
- player join/part
- server messages
- other
If there is no config for a message level then the last config will be
used. Setting the last config to 0 mutes all remaining message levels.
Setting the entire config to 0 mutes EVERYTHING.
The default sound level can be configured server-wide. The built-in
default if not overridden at the server/player level is:
0.5:1.2 0.25 0.25 0.25:0.8 0
------------------------------------------------------------------------

View File

@ -25,7 +25,8 @@ local function parsespec(param)
return config
end
local default = parsespec("0.5:1.2 0.25 0.25 0.25:0.8 0")
local default = parsespec(minetest.settings:get(modname)
or "0.5:1.2 0.25 0.25 0.25:0.8 0")
local function dosound(player, pname, msgtype)
local config = player:get_meta():get_string(modname) or ""