Add a workaround for the set_stars bug, implement an option for scaling sun and moon in biome mode
parent
14502420a9
commit
fa9ab6baf5
50
biome.lua
50
biome.lua
|
@ -84,14 +84,23 @@ skygen.transition = function(player, base_colors, base_params, color_diffs, para
|
|||
sun_texture = "sun.png"
|
||||
moon_texture = "moon.png"
|
||||
end
|
||||
player:set_sun({
|
||||
texture = sun_texture,
|
||||
scale = ((heat/255) + 0.1)*2,
|
||||
})
|
||||
player:set_moon({
|
||||
texture = moon_texture,
|
||||
scale = ((heat/255) + 0.1)*4,
|
||||
})
|
||||
if (skygen.scale_sun_moon == "true") then
|
||||
player:set_sun({
|
||||
texture = sun_texture,
|
||||
scale = ((heat/255) + 0.1)*2,
|
||||
})
|
||||
player:set_moon({
|
||||
texture = moon_texture,
|
||||
scale = ((heat/255) + 0.1)*4,
|
||||
})
|
||||
else
|
||||
player:set_sun({
|
||||
texture = sun_texture,
|
||||
})
|
||||
player:set_moon({
|
||||
texture = moon_texture,
|
||||
})
|
||||
end
|
||||
if skygen.colorize_stars == true then
|
||||
player:set_stars({
|
||||
star_color = {r = sun[1], g = sun[2], b = sun[3]},
|
||||
|
@ -149,14 +158,23 @@ skygen.set_all = function(player, biome_name) -- For initial case
|
|||
sun_texture = "sun.png"
|
||||
moon_texture = "moon.png"
|
||||
end
|
||||
player:set_sun({
|
||||
texture = sun_texture,
|
||||
scale = ((heat/255) + 0.1)*2,
|
||||
})
|
||||
player:set_moon({
|
||||
texture = moon_texture,
|
||||
scale = ((heat/255) + 0.1)*4,
|
||||
})
|
||||
if (skygen.scale_sun_moon == "true") then
|
||||
player:set_sun({
|
||||
texture = sun_texture,
|
||||
scale = ((heat/255) + 0.1)*2,
|
||||
})
|
||||
player:set_moon({
|
||||
texture = moon_texture,
|
||||
scale = ((heat/255) + 0.1)*4,
|
||||
})
|
||||
else
|
||||
player:set_sun({
|
||||
texture = sun_texture,
|
||||
})
|
||||
player:set_moon({
|
||||
texture = moon_texture,
|
||||
})
|
||||
end
|
||||
if skygen.colorize_stars == true then
|
||||
player:set_stars({
|
||||
star_color = {r = sun[1], g = sun[2], b = sun[3]},
|
||||
|
|
10
init.lua
10
init.lua
|
@ -7,6 +7,7 @@ skygen.save_interval = 1000
|
|||
skygen.sky_state = {}
|
||||
skygen.active = true
|
||||
skygen.event = "none"
|
||||
skygen.scale_sun_moon = "true"
|
||||
|
||||
skygen.events = {"test"} -- Add event names here
|
||||
|
||||
|
@ -19,6 +20,13 @@ skygen.event_save_file = minetest.get_worldpath() .. "/skygen_event"
|
|||
|
||||
skygen.colorize_stars = true
|
||||
|
||||
skygen.default_star_params = {
|
||||
visible = "true",
|
||||
count = 1000,
|
||||
star_color = "#ebebff69",
|
||||
scale = 1,
|
||||
}
|
||||
|
||||
local path = minetest.get_modpath("skygen")
|
||||
local skybox_path = minetest.get_modpath("skygen") .. "/skyboxes"
|
||||
dofile(path.."/colors.lua")
|
||||
|
@ -183,7 +191,7 @@ skygen.deactivate = function(player)
|
|||
local player_obj = minetest.get_player_by_name(player)
|
||||
player_obj:set_sky()
|
||||
player_obj:set_sun()
|
||||
player_obj:set_stars()
|
||||
player_obj:set_stars(skygen.default_star_params)
|
||||
player_obj:set_moon()
|
||||
player_obj:set_clouds()
|
||||
player_obj:override_day_night_ratio(nil)
|
||||
|
|
|
@ -95,5 +95,5 @@ skygen.biome_mode = function(player)
|
|||
player_obj:override_day_night_ratio(nil)
|
||||
player_obj:set_sun()
|
||||
player_obj:set_moon()
|
||||
player_obj:set_stars()
|
||||
player_obj:set_stars(skygen.default_star_params)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue