Add options to disable vignette
This commit is contained in:
parent
9ea78879ad
commit
3ac8edbcc5
@ -110,6 +110,10 @@ ambiance_disable_birds = false
|
|||||||
ambiance_disable_crickets = false
|
ambiance_disable_crickets = false
|
||||||
ambiance_disable_flowing_water = false
|
ambiance_disable_flowing_water = false
|
||||||
|
|
||||||
|
# Vignette (more of a personal preference thing, but may reduce performance)
|
||||||
|
|
||||||
|
vignette_enable = true
|
||||||
|
|
||||||
# Server (user stuff)
|
# Server (user stuff)
|
||||||
|
|
||||||
max_users = 16
|
max_users = 16
|
||||||
|
@ -3,22 +3,26 @@
|
|||||||
-- By KaadmY, for Pixture
|
-- By KaadmY, for Pixture
|
||||||
--
|
--
|
||||||
|
|
||||||
local vignette_definition = {
|
local enable_vignette = minetest.settings:get_bool("vignette_enable")
|
||||||
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 enable_vignette then
|
||||||
if not player:is_player() then
|
local vignette_definition = {
|
||||||
return
|
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
|
end
|
||||||
|
|
||||||
player:hud_add(vignette_definition)
|
minetest.register_on_joinplayer(on_joinplayer)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_joinplayer(on_joinplayer)
|
|
||||||
|
|
||||||
default.log("mod:vignette", "loaded")
|
default.log("mod:vignette", "loaded")
|
||||||
|
Loading…
Reference in New Issue
Block a user