mirror of
https://github.com/t-affeldt/climate_api.git
synced 2024-12-22 17:00:36 +01:00
Implement support for lighting_monoid
This commit is contained in:
parent
79233a2cb1
commit
5448e04d85
@ -1,3 +1,5 @@
|
|||||||
|
local mod_lighting_monoid = minetest.get_modpath("lighting_monoid") ~= nil
|
||||||
|
|
||||||
local default_sky = {
|
local default_sky = {
|
||||||
sky_data = {
|
sky_data = {
|
||||||
base_color = nil,
|
base_color = nil,
|
||||||
@ -74,11 +76,15 @@ local function set_skybox(playername, sky)
|
|||||||
player:set_moon(sky.moon_data)
|
player:set_moon(sky.moon_data)
|
||||||
player:set_sun(sky.sun_data)
|
player:set_sun(sky.sun_data)
|
||||||
player:set_stars(sky.star_data)
|
player:set_stars(sky.star_data)
|
||||||
if player.set_lighting then
|
local lighting = {
|
||||||
player:set_lighting({
|
|
||||||
shadows = { intensity = sky.light_data.shadow_intensity },
|
shadows = { intensity = sky.light_data.shadow_intensity },
|
||||||
saturation = sky.light_data.saturation
|
saturation = sky.light_data.saturation
|
||||||
})
|
}
|
||||||
|
if mod_lighting_monoid then
|
||||||
|
lighting_monoid:add_change(player, lighting, "climate_api:merged_lighting")
|
||||||
|
lighting_monoid.del_change(player, "lighting_monoid:base_shadow")
|
||||||
|
elseif player.set_lighting then
|
||||||
|
player:set_lighting(lighting)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,7 +1,7 @@
|
|||||||
name = climate_api
|
name = climate_api
|
||||||
title = Climate API
|
title = Climate API
|
||||||
author = TestificateMods
|
author = TestificateMods
|
||||||
optional_depends = player_monoids, playerphysics, pova
|
optional_depends = player_monoids, playerphysics, pova, lighting_monoid
|
||||||
description = """
|
description = """
|
||||||
A powerful engine for weather presets and visual effects.
|
A powerful engine for weather presets and visual effects.
|
||||||
Use the regional climate to set up different effects for different regions.
|
Use the regional climate to set up different effects for different regions.
|
||||||
|
Loading…
Reference in New Issue
Block a user