Improve Configuration

* Replace `core` namespace with `minetest`
* Use settingtypes.txt
* Improve setting documentation
This commit is contained in:
octacian 2017-06-30 07:21:48 -07:00
parent 30f788b52a
commit fb5fde7687
3 changed files with 16 additions and 1 deletions

View File

@ -16,6 +16,14 @@ Displaying the rank prefix on a player's nametag can be disabled by setting `ran
Ranks also attempts to make privilege updates easier by allowing you to assign a set of privileges to each rank allowing a strict set of privileges for that rank, automatically granting missing privileges, and automatically revoking extra privileges (configurable per-rank). This means that when a player is given a rank with privilege definitions, they will automatically inherit the privileges specified. Whenever `/grant`, `/grantme`, or `/revoke` is called on a player, their privileges are updated according to rank and a warning is sent to the player who called the chatcommand if privileges are modified further. Ranks also attempts to make privilege updates easier by allowing you to assign a set of privileges to each rank allowing a strict set of privileges for that rank, automatically granting missing privileges, and automatically revoking extra privileges (configurable per-rank). This means that when a player is given a rank with privilege definitions, they will automatically inherit the privileges specified. Whenever `/grant`, `/grantme`, or `/revoke` is called on a player, their privileges are updated according to rank and a warning is sent to the player who called the chatcommand if privileges are modified further.
### Configuration
All of the features provided by ranks can be configured directly from the advanced settings menu in the ranks subsection of the top-level Mods section. You can also configure ranks directly from `minetest.conf` with the settings listed below.
| Name | Type | Default | Description |
| -------------------- | ---- | ------- | ----------------------- |
| ranks.prefix_chat | bool | true | Prefix chat messages |
| ranks.prefix_nametag | bool | true | Prefix nametags |
### Packaged Ranks ### Packaged Ranks
By default, four ranks are included with the ranks mod, however, they are only for decoration purposes and do not modify any privileges as they should be configured by each server owner. By default, four ranks are included with the ranks mod, however, they are only for decoration purposes and do not modify any privileges as they should be configured by each server owner.

View File

@ -210,7 +210,7 @@ function ranks.remove_rank(player)
}) })
-- Update privileges -- Update privileges
local basic_privs = local basic_privs =
core.string_to_privs(core.settings:get("basic_privs") or "interact,shout") minetest.string_to_privs(minetest.settings:get("basic_privs") or "interact,shout")
minetest.set_player_privs(name, basic_privs) minetest.set_player_privs(name, basic_privs)
end end
end end

7
settingtypes.txt Normal file
View File

@ -0,0 +1,7 @@
# If this is enabled, chat send by a player with a rank including a defined
# prefix is prefixed with the rank prefix.
ranks.prefix_chat (Prefix Chat) bool true
# If this is enabled, player with a rank that has a prefix will have this
# prefix shown in their nametags.
ranks.prefix_nametag (Prefix Nametag) bool true