Add options to disable vignette

This commit is contained in:
KaadmY 2017-07-25 09:38:26 -07:00
parent 9ea78879ad
commit 3ac8edbcc5
2 changed files with 21 additions and 13 deletions

View File

@ -110,6 +110,10 @@ ambiance_disable_birds = false
ambiance_disable_crickets = false
ambiance_disable_flowing_water = false
# Vignette (more of a personal preference thing, but may reduce performance)
vignette_enable = true
# Server (user stuff)
max_users = 16

View File

@ -3,22 +3,26 @@
-- By KaadmY, for Pixture
--
local vignette_definition = {
hud_elem_type = "image",
position = {x = 0.5, y = 0.5},
scale = {x = -100, y = -100},
alignment = 0,
text = "vignette_vignette.png",
}
local enable_vignette = minetest.settings:get_bool("vignette_enable")
local function on_joinplayer(player)
if not player:is_player() then
return
if enable_vignette then
local vignette_definition = {
hud_elem_type = "image",
position = {x = 0.5, y = 0.5},
scale = {x = -100, y = -100},
alignment = 0,
text = "vignette_vignette.png",
}
local function on_joinplayer(player)
if not player:is_player() then
return
end
player:hud_add(vignette_definition)
end
player:hud_add(vignette_definition)
minetest.register_on_joinplayer(on_joinplayer)
end
minetest.register_on_joinplayer(on_joinplayer)
default.log("mod:vignette", "loaded")