Compare commits
5 Commits
81d55338fa
...
e5a37543cc
Author | SHA1 | Date |
---|---|---|
Paramat | e5a37543cc | |
Ezhh | 6b102ce51f | |
ClobberXD | 657a3d1e05 | |
Paramat | 85b01eacd2 | |
HybridDog | 98ee08904b |
|
@ -106,28 +106,28 @@ core.register_chatcommand("privs", {
|
|||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("hasprivs", {
|
||||
core.register_chatcommand("haspriv", {
|
||||
params = "<privilege>",
|
||||
description = "Return list of all online players with privilege.",
|
||||
privs = {basic_privs = true},
|
||||
func = function(caller, param)
|
||||
param = param:trim()
|
||||
if param == "" then
|
||||
return false, "Invalid parameters (see /help hasprivs)"
|
||||
return false, "Invalid parameters (see /help haspriv)"
|
||||
end
|
||||
if not core.registered_privileges[param] then
|
||||
return false, "Unknown privilege!"
|
||||
end
|
||||
local privs = core.string_to_privs(param)
|
||||
local players_with_privs = {}
|
||||
local players_with_priv = {}
|
||||
for _, player in pairs(core.get_connected_players()) do
|
||||
local player_name = player:get_player_name()
|
||||
if core.check_player_privs(player_name, privs) then
|
||||
table.insert(players_with_privs, player_name)
|
||||
table.insert(players_with_priv, player_name)
|
||||
end
|
||||
end
|
||||
return true, "Players online with the \"" .. param .. "\" priv: " ..
|
||||
table.concat(players_with_privs, ", ")
|
||||
return true, "Players online with the \"" .. param .. "\" privilege: " ..
|
||||
table.concat(players_with_priv, ", ")
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -356,21 +356,29 @@ function store.get_formspec()
|
|||
cur_page = 1
|
||||
end
|
||||
|
||||
local formspec = {
|
||||
"size[12,7;true]",
|
||||
"position[0.5,0.55]",
|
||||
"field[0.2,0.1;7.8,1;search_string;;", core.formspec_escape(search_string), "]",
|
||||
"field_close_on_enter[search_string;false]",
|
||||
"button[7.7,-0.2;2,1;search;", fgettext("Search"), "]",
|
||||
"dropdown[9.7,-0.1;2.4;type;",
|
||||
table.concat(filter_types_titles, ","),
|
||||
";",
|
||||
filter_type,
|
||||
"]",
|
||||
-- "textlist[0,1;2.4,5.6;a;",
|
||||
-- table.concat(taglist, ","),
|
||||
-- "]"
|
||||
}
|
||||
local formspec
|
||||
if #store.packages ~= 0 then
|
||||
formspec = {
|
||||
"size[12,7;true]",
|
||||
"position[0.5,0.55]",
|
||||
"field[0.2,0.1;7.8,1;search_string;;",
|
||||
core.formspec_escape(search_string), "]",
|
||||
"field_close_on_enter[search_string;false]",
|
||||
"button[7.7,-0.2;2,1;search;",
|
||||
fgettext("Search"), "]",
|
||||
"dropdown[9.7,-0.1;2.4;type;",
|
||||
table.concat(filter_types_titles, ","),
|
||||
";", filter_type, "]",
|
||||
-- "textlist[0,1;2.4,5.6;a;",
|
||||
-- table.concat(taglist, ","), "]",
|
||||
}
|
||||
else
|
||||
formspec = {
|
||||
"size[12,7;true]",
|
||||
"position[0.5,0.55]",
|
||||
"label[4,3;No packages could be retrieved]",
|
||||
}
|
||||
end
|
||||
|
||||
local start_idx = (cur_page - 1) * num_per_page + 1
|
||||
for i=start_idx, math.min(#store.packages, start_idx+num_per_page-1) do
|
||||
|
@ -381,7 +389,7 @@ function store.get_formspec()
|
|||
|
||||
-- image
|
||||
formspec[#formspec + 1] = "image[-0.4,0;1.5,1;"
|
||||
formspec[#formspec + 1] = get_screenshot(package)
|
||||
formspec[#formspec + 1] = core.formspec_escape(get_screenshot(package))
|
||||
formspec[#formspec + 1] = "]"
|
||||
|
||||
-- title
|
||||
|
@ -404,7 +412,7 @@ function store.get_formspec()
|
|||
formspec[#formspec + 1] = fgettext("Install")
|
||||
formspec[#formspec + 1] = "]"
|
||||
elseif package.installed_release < package.release then
|
||||
formspec[#formspec + 1] = "button[8.4,0;1.5,1;install_"
|
||||
formspec[#formspec + 1] = "button[8.4,0;1.5,1;update_"
|
||||
formspec[#formspec + 1] = tostring(i)
|
||||
formspec[#formspec + 1] = ";"
|
||||
formspec[#formspec + 1] = fgettext("Update")
|
||||
|
|
|
@ -629,7 +629,7 @@ view_bobbing_amount (View bobbing factor) float 1.0
|
|||
|
||||
# Multiplier for fall bobbing.
|
||||
# For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double.
|
||||
fall_bobbing_amount (Fall bobbing factor) float 0.0
|
||||
fall_bobbing_amount (Fall bobbing factor) float 0.03
|
||||
|
||||
# 3D support.
|
||||
# Currently supported:
|
||||
|
|
|
@ -697,20 +697,12 @@ void MapblockMeshGenerator::drawGlasslikeFramedNode()
|
|||
for (int face = 0; face < 6; face++)
|
||||
getTile(g_6dirs[face], &tiles[face]);
|
||||
|
||||
if (!data->m_smooth_lighting)
|
||||
color = encode_light(light, f->light_source);
|
||||
|
||||
TileSpec glass_tiles[6];
|
||||
if (tiles[1].layers[0].texture &&
|
||||
tiles[2].layers[0].texture &&
|
||||
tiles[3].layers[0].texture) {
|
||||
glass_tiles[0] = tiles[4];
|
||||
glass_tiles[1] = tiles[2];
|
||||
glass_tiles[2] = tiles[4];
|
||||
glass_tiles[3] = tiles[4];
|
||||
glass_tiles[4] = tiles[3];
|
||||
glass_tiles[5] = tiles[4];
|
||||
} else {
|
||||
for (auto &glass_tile : glass_tiles)
|
||||
glass_tile = tiles[4];
|
||||
}
|
||||
for (auto &glass_tile : glass_tiles)
|
||||
glass_tile = tiles[4];
|
||||
|
||||
u8 param2 = n.getParam2();
|
||||
bool H_merge = !(param2 & 128);
|
||||
|
@ -735,14 +727,6 @@ void MapblockMeshGenerator::drawGlasslikeFramedNode()
|
|||
aabb3f(-a, -a, -a, a, -b, -b), // z-
|
||||
aabb3f(-a, b, -a, a, a, -b), // z-
|
||||
};
|
||||
static const aabb3f glass_faces[6] = {
|
||||
aabb3f(-g, -g, g, g, g, g), // z+
|
||||
aabb3f(-g, g, -g, g, g, g), // y+
|
||||
aabb3f( g, -g, -g, g, g, g), // x+
|
||||
aabb3f(-g, -g, -g, g, g, -g), // z-
|
||||
aabb3f(-g, -g, -g, g, -g, g), // y-
|
||||
aabb3f(-g, -g, -g, -g, g, g), // x-
|
||||
};
|
||||
|
||||
// tables of neighbour (connect if same type and merge allowed),
|
||||
// checked with g_26dirs
|
||||
|
@ -800,8 +784,34 @@ void MapblockMeshGenerator::drawGlasslikeFramedNode()
|
|||
for (int face = 0; face < 6; face++) {
|
||||
if (nb[face])
|
||||
continue;
|
||||
|
||||
tile = glass_tiles[face];
|
||||
drawAutoLightedCuboid(glass_faces[face]);
|
||||
// Face at Z-
|
||||
v3f vertices[4] = {
|
||||
v3f(-a, a, -g),
|
||||
v3f( a, a, -g),
|
||||
v3f( a, -a, -g),
|
||||
v3f(-a, -a, -g),
|
||||
};
|
||||
|
||||
for (v3f &vertex : vertices) {
|
||||
switch (face) {
|
||||
case D6D_ZP:
|
||||
vertex.rotateXZBy(180); break;
|
||||
case D6D_YP:
|
||||
vertex.rotateYZBy( 90); break;
|
||||
case D6D_XP:
|
||||
vertex.rotateXZBy( 90); break;
|
||||
case D6D_ZN:
|
||||
vertex.rotateXZBy( 0); break;
|
||||
case D6D_YN:
|
||||
vertex.rotateYZBy(-90); break;
|
||||
case D6D_XN:
|
||||
vertex.rotateXZBy(-90); break;
|
||||
}
|
||||
}
|
||||
v3s16 dir = g_6dirs[face];
|
||||
drawQuad(vertices, dir);
|
||||
}
|
||||
|
||||
// Optionally render internal liquid level defined by param2
|
||||
|
|
|
@ -176,7 +176,7 @@ void set_default_settings(Settings *settings)
|
|||
settings->setDefault("cinematic_camera_smoothing", "0.7");
|
||||
settings->setDefault("enable_clouds", "true");
|
||||
settings->setDefault("view_bobbing_amount", "1.0");
|
||||
settings->setDefault("fall_bobbing_amount", "0.0");
|
||||
settings->setDefault("fall_bobbing_amount", "0.03");
|
||||
settings->setDefault("enable_3d_clouds", "true");
|
||||
settings->setDefault("cloud_radius", "12");
|
||||
settings->setDefault("menu_clouds", "true");
|
||||
|
|
|
@ -610,9 +610,9 @@ void Sky::update(float time_of_day, float time_brightness,
|
|||
}
|
||||
|
||||
m_clouds_visible = true;
|
||||
float color_change_fraction = 0.98;
|
||||
float color_change_fraction = 0.98f;
|
||||
if (sunlight_seen) {
|
||||
if (is_dawn) { // Dawn
|
||||
if (is_dawn) { // Dawn
|
||||
m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated(
|
||||
bgcolor_bright_dawn_f, color_change_fraction);
|
||||
m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated(
|
||||
|
@ -620,12 +620,12 @@ void Sky::update(float time_of_day, float time_brightness,
|
|||
m_cloudcolor_bright_f = m_cloudcolor_bright_f.getInterpolated(
|
||||
cloudcolor_bright_dawn_f, color_change_fraction);
|
||||
} else {
|
||||
if (time_brightness < 0.07) { // Night
|
||||
if (time_brightness < 0.13f) { // Night
|
||||
m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated(
|
||||
bgcolor_bright_night_f, color_change_fraction);
|
||||
m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated(
|
||||
skycolor_bright_night_f, color_change_fraction);
|
||||
} else { // Day
|
||||
} else { // Day
|
||||
m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated(
|
||||
bgcolor_bright_normal_f, color_change_fraction);
|
||||
m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated(
|
||||
|
|
Loading…
Reference in New Issue