mirror of
https://github.com/t-affeldt/climate_api.git
synced 2024-12-22 00:40:37 +01:00
Improve HUD shading, skybox merging, add new artwork
This commit is contained in:
parent
e24b0340e5
commit
1057342ac6
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
},
|
||||
|
2
mod.conf
2
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.
|
||||
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.6 MiB |
BIN
textures/moon.png
Normal file
BIN
textures/moon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
BIN
textures/sun.png
Normal file
BIN
textures/sun.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue
Block a user