From fb5fde7687bc808f01096c51bf036853bf138c2b Mon Sep 17 00:00:00 2001 From: octacian Date: Fri, 30 Jun 2017 07:21:48 -0700 Subject: [PATCH] Improve Configuration * Replace `core` namespace with `minetest` * Use settingtypes.txt * Improve setting documentation --- README.md | 8 ++++++++ init.lua | 2 +- settingtypes.txt | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 settingtypes.txt diff --git a/README.md b/README.md index e34145e..84a5a4f 100644 --- a/README.md +++ b/README.md @@ -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. +### 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 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. diff --git a/init.lua b/init.lua index 63a26c2..823d6d3 100644 --- a/init.lua +++ b/init.lua @@ -210,7 +210,7 @@ function ranks.remove_rank(player) }) -- Update privileges 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) end end diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..ef008d7 --- /dev/null +++ b/settingtypes.txt @@ -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