Modified (stripped down) skybox mod. No priv or chat command, hard coded 0 is default (off) skybox. Store by numerical value in box meta.
50 lines
1.0 KiB
Lua
50 lines
1.0 KiB
Lua
|
|
--[[
|
|
|
|
Copyright (C) 2017 - Auke Kok <sofar@foo-projects.org>
|
|
|
|
"skybox" is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as
|
|
published by the Free Software Foundation; either version 2.1
|
|
of the license, or (at your option) any later version.
|
|
|
|
--]]
|
|
|
|
--
|
|
-- Builtin sky box textures and color/shadings
|
|
--
|
|
|
|
local skies = {
|
|
{"DarkStormy", "#1f2226", 0.5},
|
|
{"CloudyLightRays", "#5f5f5e", 0.9},
|
|
{"FullMoon", "#24292c", 0.2},
|
|
{"SunSet", "#72624d", 0.4},
|
|
{"ThickCloudsWater", "#a57850", 0.8},
|
|
{"TropicalSunnyDay", "#f1f4ee", 1.0},
|
|
}
|
|
|
|
--
|
|
-- API
|
|
--
|
|
|
|
skybox = {}
|
|
|
|
skybox.set = function(player, number)
|
|
if number == 0 then
|
|
player:override_day_night_ratio(nil)
|
|
player:set_sky("white", "regular")
|
|
else
|
|
local sky = skies[number]
|
|
player:override_day_night_ratio(sky[3])
|
|
player:set_sky(sky[2], "skybox", {
|
|
sky[1] .. "Up.jpg",
|
|
sky[1] .. "Down.jpg",
|
|
sky[1] .. "Front.jpg",
|
|
sky[1] .. "Back.jpg",
|
|
sky[1] .. "Left.jpg",
|
|
sky[1] .. "Right.jpg",
|
|
})
|
|
end
|
|
end
|
|
|