-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5991475
commit 96ec58b
Showing
10 changed files
with
117 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name = super_sam_level | ||
depends = super_sam, super_sam_highscore | ||
depends = super_sam, super_sam_highscore, super_sam_skybox | ||
optional_depends = worldedit, mapsync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
-- name -> def | ||
local skyboxes = {} | ||
|
||
function super_sam_skybox.register(name, def) | ||
skyboxes[name] = def | ||
end | ||
|
||
function super_sam_skybox.get(name) | ||
return skyboxes[name] | ||
end | ||
|
||
function super_sam_skybox.get_all() | ||
return skyboxes | ||
end | ||
|
||
function super_sam_skybox.get_names() | ||
local names = {} | ||
for name in pairs(skyboxes) do | ||
table.insert(names, name) | ||
end | ||
return names | ||
end | ||
|
||
function super_sam_skybox.reset_skybox(player) | ||
super_sam_skybox.set_skybox("default", player) | ||
end | ||
|
||
function super_sam_skybox.set_skybox(name, player) | ||
local skybox = super_sam_skybox.get(name) | ||
if not skybox then | ||
return false | ||
end | ||
|
||
player:set_clouds({ density=0 }) | ||
|
||
skybox.color = skybox.color or {r=0, g=0, b=0} | ||
|
||
if player.set_sun then | ||
-- new format | ||
player:set_sun({ | ||
visible = false, | ||
sunrise_visible = false | ||
}) | ||
player:set_moon({ | ||
visible = false | ||
}) | ||
player:set_sky({ | ||
base_color = skybox.color, | ||
clouds = false, | ||
type = "skybox", | ||
textures = skybox.textures | ||
}) | ||
else | ||
-- legacy format | ||
player:set_sky(skybox.color, "skybox", skybox.textures) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,8 @@ | ||
-- namespace | ||
super_sam_skybox = {} | ||
|
||
minetest.register_on_joinplayer(function(player) | ||
-- skybox / clouds | ||
player:set_clouds({ density=0 }) | ||
local MP = minetest.get_modpath(minetest.get_current_modname()) | ||
|
||
if player.set_sun then | ||
-- new format | ||
player:set_sun({ | ||
visible = false, | ||
sunrise_visible = false | ||
}) | ||
player:set_moon({ | ||
visible = false | ||
}) | ||
player:set_sky({ | ||
base_color = "#000000", | ||
clouds = false, | ||
type = "skybox", | ||
textures = { | ||
"arid2_up.jpg^[transformR270", | ||
"arid2_dn.jpg^[transformR90", | ||
"arid2_ft.jpg", | ||
"arid2_bk.jpg", | ||
"arid2_lf.jpg", | ||
"arid2_rt.jpg" | ||
} | ||
}) | ||
else | ||
-- legacy format | ||
player:set_sky({r=0, g=0, b=0}, "skybox", { | ||
"arid2_up.jpg^[transformR270", | ||
"arid2_dn.jpg^[transformR90", | ||
"arid2_ft.jpg", | ||
"arid2_bk.jpg", | ||
"arid2_lf.jpg", | ||
"arid2_rt.jpg" | ||
}) | ||
end | ||
|
||
end) | ||
dofile(MP .. "/api.lua") | ||
dofile(MP .. "/register.lua") | ||
dofile(MP .. "/join.lua") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
minetest.register_on_joinplayer(function(player) | ||
super_sam_skybox.set_skybox("default", player) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
super_sam_skybox.register("default", { | ||
textures = { | ||
"arid2_up.jpg^[transformR270", | ||
"arid2_dn.jpg^[transformR90", | ||
"arid2_ft.jpg", | ||
"arid2_bk.jpg", | ||
"arid2_lf.jpg", | ||
"arid2_rt.jpg" | ||
} | ||
}) | ||
|
||
super_sam_skybox.register("black", { | ||
textures = {}, | ||
color = {r=0, g=0, b=0} | ||
}) |