Enable zooming by default
This commit is contained in:
parent
0d27248330
commit
7bbb105488
6 changed files with 29 additions and 0 deletions
6
mods/PLAYER/allow_zoom/README.md
Normal file
6
mods/PLAYER/allow_zoom/README.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Allows zooming by default for all players.
|
||||||
|
This is done by granting the zoom privilege when a player joins.
|
||||||
|
|
||||||
|
Works for Minetest 0.4.16.
|
||||||
|
|
||||||
|
License: WTFPL
|
1
mods/PLAYER/allow_zoom/description.txt
Normal file
1
mods/PLAYER/allow_zoom/description.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Allows zooming by default for all players.
|
12
mods/PLAYER/allow_zoom/init.lua
Normal file
12
mods/PLAYER/allow_zoom/init.lua
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
local priv = minetest.setting_getbool("allow_zoom")
|
||||||
|
if priv == nil then
|
||||||
|
priv = true
|
||||||
|
end
|
||||||
|
if priv then
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local privs = minetest.get_player_privs(name)
|
||||||
|
privs.zoom = true
|
||||||
|
minetest.set_player_privs(name, privs)
|
||||||
|
end
|
||||||
|
end)
|
1
mods/PLAYER/allow_zoom/mod.conf
Normal file
1
mods/PLAYER/allow_zoom/mod.conf
Normal file
|
@ -0,0 +1 @@
|
||||||
|
name = allow_zoom
|
4
mods/PLAYER/allow_zoom/settingtypes.txt
Normal file
4
mods/PLAYER/allow_zoom/settingtypes.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# This allows zooming by default for all players.
|
||||||
|
# More specifically, players get the zoom privilege automatically granted on
|
||||||
|
# when they join.
|
||||||
|
allow_zoom (Allow zooming) bool true
|
|
@ -44,6 +44,11 @@ enable_bed_respawn (Respawn at bed) bool true
|
||||||
# This setting is only read at startup.
|
# This setting is only read at startup.
|
||||||
enable_bed_night_skip (Skip night when sleeping) bool true
|
enable_bed_night_skip (Skip night when sleeping) bool true
|
||||||
|
|
||||||
|
# This allows zooming by default for all players.
|
||||||
|
# More specifically, players get the zoom privilege automatically granted on
|
||||||
|
# when they join.
|
||||||
|
allow_zoom (Allow zooming) bool true
|
||||||
|
|
||||||
# If enabled, the recipe book will only show recipes which require one
|
# If enabled, the recipe book will only show recipes which require one
|
||||||
# item which the player has currently in possession.
|
# item which the player has currently in possession.
|
||||||
# If disabled, the recipe book shows all crafting recipes.
|
# If disabled, the recipe book shows all crafting recipes.
|
||||||
|
|
Reference in a new issue