4 Commits

Author SHA1 Message Date
c23277284a Fix incorrect call to player_monoids 2023-04-02 12:41:26 +02:00
5448e04d85 Implement support for lighting_monoid 2023-04-02 10:57:55 +02:00
79233a2cb1 Fix broken translation call 2023-04-02 10:57:26 +02:00
f3f0eaac2a Add missing warning translation 2023-04-02 10:54:55 +02:00
5 changed files with 19 additions and 10 deletions

View File

@ -44,15 +44,16 @@ climate_mod.settings = {
ceiling_checks = get_setting_number("ceiling_checks", 10)
}
climate_mod.i18n = minetest.get_translator("climate_api")
-- warn about clouds being overriden by MTG weather
if climate_mod.settings.skybox and minetest.get_modpath("weather") and minetest.settings:get_bool("enable_weather") then
minetest.log("warning", "[Regional Weather] " ..
S("Disable MTG weather for the best experience. Check the forum for more information."))
minetest.settings:set_bool("enable_weather", false) -- try to disable MTG weather. may or may not work depending on load order
climate_mod.i18n("Disable MTG weather for the best experience. Check the forum for more information."))
-- try to disable MTG weather. may or may not work depending on load order
minetest.settings:set_bool("enable_weather", false)
end
climate_mod.i18n = minetest.get_translator("climate_api")
-- initialize empty registers
climate_mod.weathers = {}
climate_mod.effects = {}

View File

@ -1,3 +1,5 @@
local mod_lighting_monoid = minetest.get_modpath("lighting_monoid") ~= nil
local default_sky = {
sky_data = {
base_color = nil,
@ -74,11 +76,15 @@ local function set_skybox(playername, sky)
player:set_moon(sky.moon_data)
player:set_sun(sky.sun_data)
player:set_stars(sky.star_data)
if player.set_lighting then
player:set_lighting({
shadows = { intensity = sky.light_data.shadow_intensity },
saturation = sky.light_data.saturation
})
local lighting = {
shadows = { intensity = sky.light_data.shadow_intensity },
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

View File

@ -1,4 +1,5 @@
# textdomain:climate_api
Disable MTG weather for the best experience. Check the forum for more information.=Deaktiviere MTG weather für die beste Spielerfahrung. Mehr Informationen im Forum.
Make changes to the current weather=Ändere das aktuelle Wetter
Display weather information=Betrachte Informationen zum Wetter
The following weather presets are active for you:=Die folgenden Wetterklassen sind gerade aktiv

View File

@ -1,4 +1,5 @@
# textdomain:climate_api
Disable MTG weather for the best experience=
Make changes to the current weather=
Display weather information=
The following weather presets are active for you:=

View File

@ -1,7 +1,7 @@
name = climate_api
title = Climate API
author = TestificateMods
optional_depends = player_monoids, playerphysics, pova
optional_depends = player_monoids, playerphysics, pova, lighting_monoid
description = """
A powerful engine for weather presets and visual effects.
Use the regional climate to set up different effects for different regions.