Merge pull request #374 from MihailRis/block-cracks
Block Cracks & update Player
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"atlases": [
|
||||
{"name": "cracks", "type": "separate"}
|
||||
],
|
||||
"sounds": [
|
||||
"blocks/door_open",
|
||||
"blocks/door_close",
|
||||
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
@@ -202,9 +202,8 @@ function on_open(mode)
|
||||
debug=document.s_debug
|
||||
}, function (mode)
|
||||
set_mode(mode)
|
||||
end, "console")
|
||||
end
|
||||
if mode then
|
||||
end, mode or "console")
|
||||
elseif mode then
|
||||
modes:set(mode)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -269,7 +269,7 @@ function _rules.clear()
|
||||
_rules.create("allow-cheats", true)
|
||||
end
|
||||
|
||||
function __vc_create_hud_rules()
|
||||
function __vc_on_hud_open()
|
||||
_rules.create("allow-content-access", hud._is_content_access(), function(value)
|
||||
hud._set_content_access(value)
|
||||
input.set_enabled("player.pick", value)
|
||||
@@ -295,6 +295,14 @@ function __vc_create_hud_rules()
|
||||
_rules.create("allow-debug-cheats", true, function(value)
|
||||
hud._set_debug_cheats(value)
|
||||
end)
|
||||
input.add_callback("devtools.console", function()
|
||||
if hud.is_paused() then
|
||||
return
|
||||
end
|
||||
time.post_runnable(function()
|
||||
hud.show_overlay("core:console", false, {"console"})
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
local RULES_FILE = "world:rules.toml"
|
||||
|
||||
@@ -292,6 +292,10 @@ function __load_script(path, nocache)
|
||||
end
|
||||
|
||||
function require(path)
|
||||
if not string.find(path, ':') then
|
||||
local prefix, _ = parse_path(debug.getinfo(2).source)
|
||||
return require(prefix..':'..path)
|
||||
end
|
||||
local prefix, file = parse_path(path)
|
||||
return __load_script(prefix..":modules/"..file..".lua")
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ uniform samplerCube u_cubemap;
|
||||
uniform vec3 u_fogColor;
|
||||
uniform float u_fogFactor;
|
||||
uniform float u_fogCurve;
|
||||
uniform bool u_alphaClip;
|
||||
|
||||
void main() {
|
||||
vec3 fogColor = texture(u_cubemap, a_dir).rgb;
|
||||
@@ -16,7 +17,7 @@ void main() {
|
||||
float depth = (a_distance/256.0);
|
||||
float alpha = a_color.a * tex_color.a;
|
||||
// anyway it's any alpha-test alternative required
|
||||
if (alpha < 0.5f)
|
||||
if (alpha < (u_alphaClip ? 0.5f : 0.2f))
|
||||
discard;
|
||||
f_color = mix(a_color * tex_color, vec4(fogColor,1.0),
|
||||
min(1.0, pow(depth*u_fogFactor, u_fogCurve)));
|
||||
|
||||