diff --git a/README.md b/README.md index 0eb3b56..c1ea6f5 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,12 @@ Climate API provides temperature and humidity values on a block-per-block basis that follow the seasons, day / night cycle and random changes. Make it rain, change the sky or poison the player - it's up to you. +## Assets +- Sun and moon textures: *CC BY-SA (3.0)* by Cap + ## Assets in screenshots -- All screenshots and editing by me: *CC BY-SA (4.0)* +- Screenshots and editing by me: *CC BY-SA (3.0)* +- Logos and artwork: *CC BY-SA (3.0)* by Cap - Lato Font (for the Logo): *OFL* by Ɓukasz Dziedzic from http://www.latofonts.com/lato-free-fonts/ - Liberation Fonts (for the text): *OFL*, see https://github.com/liberationfonts/liberation-fonts - Used texture pack: Polygonia (128px edition) *CC BY-SA (4.0)* by Lokrates. See https://forum.minetest.net/viewtopic.php?f=4&t=19043 \ No newline at end of file diff --git a/ROADMAP.md b/ROADMAP.md index f65ba33..05e1c26 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,6 @@ ## Required for Beta - Write helpful README -- Rework Moon Phases mod to be compatible and to include varying sky brightness ## Planned for first release - Improve value structures of particle effects diff --git a/ca_effects/hud_overlay.lua b/ca_effects/hud_overlay.lua index c9a2292..f2cd2cf 100644 --- a/ca_effects/hud_overlay.lua +++ b/ca_effects/hud_overlay.lua @@ -4,9 +4,25 @@ local EFFECT_NAME = "climate_api:hud_overlay" local handles = {} local function apply_hud(pname, weather, hud) - if handles[pname] == nil then handles[pname] = {} end - if handles[pname][weather] ~= nil then return end local player = minetest.get_player_by_name(pname) + if handles[pname] == nil then handles[pname] = {} end + if handles[pname][weather] ~= nil then + player:hud_remove(handles[pname][weather]) + end + + local file + if hud.color_correction then + local pos = vector.add(player:get_pos(), {x = 0, y = 1, z = 0}) + local light = math.floor(math.max(minetest.env:get_node_light(pos) / 15, 0.2) * 256) + local shadow = 256 - light + + local dark_file = hud.file .. "^[multiply:#000000ff^[opacity:" .. shadow + local light_file = hud.file .. "^[opacity:" .. light + file = "(" .. light_file .. ")^(" .. dark_file .. ")" + else + file = hud.file + end + local handle = player:hud_add({ name = weather, hud_elem_type = "image", @@ -14,7 +30,7 @@ local function apply_hud(pname, weather, hud) alignment = {x = 1, y = 1}, scale = { x = -100, y = -100}, z_index = hud.z_index, - text = hud.file, + text = file, offset = {x = 0, y = 0} }) handles[pname][weather] = handle @@ -39,7 +55,12 @@ end local function handle_effect(player_data, prev_data) for playername, data in pairs(player_data) do for weather, value in pairs(data) do - if prev_data[playername][weather] == nil then + if prev_data[playername][weather] == nil + or value.color_correction == true + or prev_data[playername][weather].color_correction == true + or value.file ~= prev_data[playername][weather].file + or value.z_index ~= prev_data[playername][weather].z_index + then apply_hud(playername, weather, value) end end diff --git a/lib/skybox_merger.lua b/lib/skybox_merger.lua index 4da1afd..d617895 100644 --- a/lib/skybox_merger.lua +++ b/lib/skybox_merger.lua @@ -25,7 +25,7 @@ local default_sky = { }, sun_data = { visible = true, - texture = "", + texture = "sun.png", tonemap = "sun_tonemap.png", sunrise = "sunrisebg.png", sunrise_visible = true, @@ -33,7 +33,7 @@ local default_sky = { }, moon_data = { visible = true, - texture = "", + texture = "moon.png", tonemap = "moon_tonemap.png", scale = 1 }, diff --git a/mod.conf b/mod.conf index 8a28d6b..55cb318 100644 --- a/mod.conf +++ b/mod.conf @@ -1,7 +1,7 @@ name = climate_api title = Climate API author = TestificateMods -release = 1 +release = 2 optional_depends = skylayer, player_monoids, playerphysics description = """ A powerful engine for weather presets and visual effects. diff --git a/screenshot.png b/screenshot.png index dc9a6cd..1c85712 100644 Binary files a/screenshot.png and b/screenshot.png differ diff --git a/textures/moon.png b/textures/moon.png new file mode 100644 index 0000000..5b3b70e Binary files /dev/null and b/textures/moon.png differ diff --git a/textures/sun.png b/textures/sun.png new file mode 100644 index 0000000..8477968 Binary files /dev/null and b/textures/sun.png differ