Remove enable-shadows submodule
parent
d6b689ae81
commit
895d043044
|
@ -1 +0,0 @@
|
|||
Subproject commit c8c53ddda15c32b951be4ebca5639e22de6a13de
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2022 ROllerozxa
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,2 @@
|
|||
# enable_shadows
|
||||
Since recent versions of Minetest 5.6.0-dev the dynamic shadow feature has been disabled by default, being required to enable by the game or modset you're using. This is a small mod that is compatible with any game and that can reenable shadows and control its intensity per-world.
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
local S = minetest.get_translator('enable_shadows')
|
||||
local storage = minetest.get_mod_storage()
|
||||
|
||||
local default_intensity = tonumber(minetest.settings:get("enable_shadows_default_intensity") or 0.33)
|
||||
local intensity = tonumber(storage:get("intensity") or default_intensity)
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
player:set_lighting({
|
||||
shadows = { intensity = intensity }
|
||||
})
|
||||
end)
|
||||
|
||||
core.register_chatcommand("shadow_intensity", {
|
||||
params = "<shadow_intensity>",
|
||||
description = S("Set shadow intensity for the current world."),
|
||||
func = function(name, param)
|
||||
local new_intensity
|
||||
if param ~= "" then
|
||||
new_intensity = tonumber(param) or nil
|
||||
else
|
||||
new_intensity = tonumber(default_intensity) or nil
|
||||
end
|
||||
|
||||
if new_intensity < 0 or new_intensity > 1 or new_intensity == nil then
|
||||
minetest.chat_send_player(name, minetest.colorize("#ff0000", S("Invalid intensity.")))
|
||||
return true
|
||||
end
|
||||
|
||||
if new_intensity ~= default_intensity then
|
||||
minetest.chat_send_player(name, S("Set intensity to @1.", new_intensity))
|
||||
storage:set_float("intensity", new_intensity)
|
||||
else
|
||||
minetest.chat_send_player(name, S("Set intensity to default value (@1).", default_intensity))
|
||||
storage:set_string("intensity", "")
|
||||
end
|
||||
|
||||
intensity = new_intensity
|
||||
for _,player in pairs(minetest.get_connected_players()) do
|
||||
player:set_lighting({
|
||||
shadows = { intensity = new_intensity }
|
||||
})
|
||||
end
|
||||
end
|
||||
})
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: enable_shadows
|
||||
|
||||
Set shadow intensity for the current world.=Ställ in skuggintensitet för nuvarande värld.
|
||||
Invalid intensity.=Ogiltig intensitet
|
||||
Set intensity to @1.=Ställde intensiteten till @1.
|
||||
Set intensity to default value (@1).=Ställde intensiteten till standardvärde (@1).
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: enable_shadows
|
||||
|
||||
Set shadow intensity for the current world.=
|
||||
Invalid intensity.=
|
||||
Set intensity to @1.=
|
||||
Set intensity to default value (@1).=
|
|
@ -0,0 +1,3 @@
|
|||
title = Enable Shadows
|
||||
name = enable_shadows
|
||||
description = Enable shadows for Minetest 5.6.0-dev.
|
|
@ -0,0 +1,2 @@
|
|||
# Default shadow intensity when no other has been set.
|
||||
enable_shadows_default_intensity (Default shadow intensity) float 0.33 0 1
|
Loading…
Reference in New Issue