3D hand! Fix wool sounds, HUD fix for Mobile, remove unused textures

This commit is contained in:
MoNTE48 2019-05-28 02:54:16 +02:00
parent aef06c30dc
commit 459a54cb9b
28 changed files with 61 additions and 62 deletions

View File

@ -1,10 +1,10 @@
3D Armor - Visible Player Armor 3D Armor - Visible Player Armor
=============================== ===============================
Default Item Textures (C) Cisoun - WTFPL License Source Code: Copyright (C) 2013-2018 Stuart Jones - LGPL v3.0+
Armor Textures: Copyright (C) 2013 Ryan Jones - CC-BY-SA Textures:
Copyright (C) 2013 Vattic
Source Code: Copyright (C) 2013 Stuart Jones - LGPL Copyright (C) 2017-2019 Maksim Gamarnik [MoNTE48] MoNTE48@mail.ua & MultiCraft Developement Team
Special credit to Jordach and MirceaKitsune for providing the default 3d character model. Special credit to Jordach and MirceaKitsune for providing the default 3d character model.

View File

@ -90,7 +90,7 @@ armor.set_player_armor = function(self, player)
minetest.log("error", "Failed to read player inventory") minetest.log("error", "Failed to read player inventory")
return return
end end
local armor_texture = "3d_armor_trans.png" local armor_texture = "blank.png"
local armor_level = 0 local armor_level = 0
local armor_heal = 0 local armor_heal = 0
local state = 0 local state = 0
@ -390,8 +390,8 @@ minetest.register_on_joinplayer(function(player)
} }
armor.textures[name] = { armor.textures[name] = {
skin = armor.default_skin..".png", skin = armor.default_skin..".png",
armor = "3d_armor_trans.png", armor = "blank.png",
wielditem = "3d_armor_trans.png", wielditem = "blank.png",
preview = armor.default_skin.."_preview.png", preview = armor.default_skin.."_preview.png",
} }
if minetest.get_modpath("skins") then if minetest.get_modpath("skins") then

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 B

View File

@ -40,9 +40,9 @@ end
minetest.register_node("bonusbox:chest", { minetest.register_node("bonusbox:chest", {
tiles = { tiles = {
"chest_top.png", "chest_top.png",
"chest_bottom.png", "chest_top.png^[transformFY",
"chest_right.png", "chest_side.png",
"chest_left.png", "chest_side.png^[transformFX",
"chest_back.png", "chest_back.png",
"chest_front.png" "chest_front.png"
}, },
@ -66,8 +66,8 @@ minetest.register_node("bonusbox:chest_open", {
tiles = { tiles = {
"chest_open_top.png", "chest_open_top.png",
"chest_open_bottom.png", "chest_open_bottom.png",
"chest_open_riqht.png", "chest_open_side.png",
"chest_open_left.png", "chest_open_side.png^[transformFX",
"chest_open_back.png", "chest_open_back.png",
"chest_open_front.png" "chest_open_front.png"
}, },
@ -92,8 +92,8 @@ minetest.register_node("bonusbox:chest_cap", {
tiles = { tiles = {
"chest_open_top.png", "chest_open_top.png",
"chest_open_bottom.png", "chest_open_bottom.png",
"chest_open_right_two.png", "chest_open_side_two.png",
"chest_open_left_two.png", "chest_open_side_two.png^[transformFX",
"chest_open_back_two.png", "chest_open_back_two.png",
"chest_open_front_two.png" "chest_open_front_two.png"
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

View File

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 436 B

View File

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

View File

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 432 B

View File

@ -20,8 +20,7 @@ if creative_mode_cache then
minetest.register_item(":", { minetest.register_item(":", {
type = "none", type = "none",
wield_image = "wieldhand.png", wield_image = "blank.png",
wield_scale = {x = 0.7, y = 2, z = 0},
range = 10, range = 10,
tool_capabilities = { tool_capabilities = {
full_punch_interval = 0.9, full_punch_interval = 0.9,

View File

@ -129,6 +129,18 @@ function default.node_sound_snow_defaults(table)
return table return table
end end
function default.node_wool_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "wool_coat_movement", gain = 0.4}
table.dig = table.dig or
{name = "wool_coat_movement", gain = 0.6}
table.dug = table.dug or
{name = "wool_coat_movement", gain = 0.6}
table.place = table.place or
{name = "default_place_node", gain = 1.0}
return table
end
-- --
-- Lavacooling -- Lavacooling

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -3,8 +3,7 @@
-- The hand -- The hand
minetest.register_item(":", { minetest.register_item(":", {
type = "none", type = "none",
wield_image = "wieldhand.png", wield_image = "blank.png",
wield_scale = {x=0.7,y=2,z=0.0001},
tool_capabilities = { tool_capabilities = {
full_punch_interval = 0.9, full_punch_interval = 0.9,
max_drop_level = 0, max_drop_level = 0,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

View File

@ -18,6 +18,17 @@ player_api.register_model("character.b3d", {
eye_height = 1.47, eye_height = 1.47,
}) })
minetest.register_node("player_api:hand", {
tiles = {"character.png"},
wield_scale = {x = 1, y = 1, z = 0.7},
paramtype = "light",
drawtype = "mesh",
mesh = "hand.b3d",
inventory_image = "blank.png",
drop = "",
node_placement_prediction = "",
})
-- Update appearance when the player joins -- Update appearance when the player joins
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
player_api.player_attached[player:get_player_name()] = false player_api.player_attached[player:get_player_name()] = false
@ -30,13 +41,9 @@ minetest.register_on_joinplayer(function(player)
30 30
) )
if PLATFORM == "Android" or PLATFORM == "iOS" then
player:hud_set_hotbar_image("gui_hotbar_touch.png")
player:hud_set_hotbar_itemcount(8)
else
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_itemcount(9) player:hud_set_hotbar_itemcount(9)
end player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
player:get_inventory():set_stack("hand", 1, "player_api:hand")
end) end)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

View File

@ -1,27 +1,12 @@
stairs = {} stairs = {}
stairs.mod = "redo" stairs.mod = "redo"
function default.node_sound_wool_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "wool_coat_movement", gain = 1.0}
table.dug = table.dug or
{name = "wool_coat_movement", gain = 0.25}
table.place = table.place or
{name = "default_place_node", gain = 1.0}
return table
end
stairs.wood = default.node_sound_wood_defaults() stairs.wood = default.node_sound_wood_defaults()
stairs.dirt = default.node_sound_dirt_defaults() stairs.dirt = default.node_sound_dirt_defaults()
stairs.stone = default.node_sound_stone_defaults() stairs.stone = default.node_sound_stone_defaults()
stairs.glass = default.node_sound_glass_defaults() stairs.glass = default.node_sound_glass_defaults()
stairs.leaves = default.node_sound_leaves_defaults() stairs.leaves = default.node_sound_leaves_defaults()
stairs.metal = default.node_sound_metal_defaults() stairs.metal = default.node_sound_metal_defaults()
stairs.wool = stairs.leaves
-- cache creative -- cache creative
local creative = minetest.settings:get_bool("creative_mode") local creative = minetest.settings:get_bool("creative_mode")
@ -534,11 +519,7 @@ stairs.register_all("snowblock", "default:snowblock",
{crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1}, {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
{"default_snow.png"}, {"default_snow.png"},
"Snow Block", "Snow Block",
default.node_sound_dirt_defaults({ default.node_sound_snow_defaults())
footstep = {name = "default_snow_footstep", gain = 0.15},
dug = {name = "default_snow_footstep", gain = 0.2},
dig = {name = "default_snow_footstep", gain = 0.2}
}))
stairs.register_all("ice", "default:ice", stairs.register_all("ice", "default:ice",
{cracky = 3, puts_out_fire = 1, cools_lava = 1}, {cracky = 3, puts_out_fire = 1, cools_lava = 1},
@ -611,7 +592,7 @@ stairs.register_all("wool_" .. colours[i][1], "wool:" .. colours[i][1],
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, flammable = 3}, {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, flammable = 3},
{"wool_" .. colours[i][1] .. ".png"}, {"wool_" .. colours[i][1] .. ".png"},
colours[i][2] .. " Wool", colours[i][2] .. " Wool",
stairs.wool) default.node_wool_defaults())
end end

View File

@ -16,19 +16,6 @@ local dyes = {
{"dark_green", "Dark Green"}, {"dark_green", "Dark Green"},
} }
function default.node_wool_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "wool_coat_movement", gain = 1.0}
table.dug = table.dug or
{name = "wool_coat_movement", gain = 0.25}
table.place = table.place or
{name = "default_place_node", gain = 1.0}
return table
end
local wool_sound = default.node_wool_defaults()
for i = 1, #dyes do for i = 1, #dyes do
local name, desc = unpack(dyes[i]) local name, desc = unpack(dyes[i])
@ -38,7 +25,7 @@ for i = 1, #dyes do
is_ground_content = false, is_ground_content = false,
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3,
flammable = 3, wool = 1}, flammable = 3, wool = 1},
sounds = wool_sound, sounds = default.node_wool_defaults(),
}) })
minetest.register_craft{ minetest.register_craft{

View File

@ -1164,10 +1164,20 @@ void Client::handleCommand_HudSetParam(NetworkPacket* pkt)
if (param == HUD_PARAM_HOTBAR_ITEMCOUNT && value.size() == 4) { if (param == HUD_PARAM_HOTBAR_ITEMCOUNT && value.size() == 4) {
s32 hotbar_itemcount = readS32((u8*) value.c_str()); s32 hotbar_itemcount = readS32((u8*) value.c_str());
if (hotbar_itemcount > 0 && hotbar_itemcount <= HUD_HOTBAR_ITEMCOUNT_MAX) if (hotbar_itemcount > 0 && hotbar_itemcount <= HUD_HOTBAR_ITEMCOUNT_MAX) {
player->hud_hotbar_itemcount = hotbar_itemcount; // Hotbar over 8 is not supported by touch controls. This is not a hack, but a quick fix
#if defined(__ANDROID__) || defined(__IOS__)
player->hud_hotbar_itemcount = 8;
#else
player->hud_hotbar_itemcount = hotbar_itemcount;
#endif
}
} }
else if (param == HUD_PARAM_HOTBAR_IMAGE) { else if (param == HUD_PARAM_HOTBAR_IMAGE) {
// Set the touch interface to fit the size
#if defined(__ANDROID__) || defined(__IOS__)
std::string value = "gui_hotbar_touch.png";
#endif
// If value not empty verify image exists in texture source // If value not empty verify image exists in texture source
if (value != "" && !getTextureSource()->isKnownSourceImage(value)) { if (value != "" && !getTextureSource()->isKnownSourceImage(value)) {
errorstream << "Server sent wrong Hud hotbar image (sent value: '" errorstream << "Server sent wrong Hud hotbar image (sent value: '"
@ -1177,6 +1187,10 @@ void Client::handleCommand_HudSetParam(NetworkPacket* pkt)
player->hotbar_image = value; player->hotbar_image = value;
} }
else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) { else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) {
// Selection texture too...
#if defined(__ANDROID__) || defined(__IOS__)
std::string value = "gui_hotbar_selected.png";
#endif
// If value not empty verify image exists in texture source // If value not empty verify image exists in texture source
if (value != "" && !getTextureSource()->isKnownSourceImage(value)) { if (value != "" && !getTextureSource()->isKnownSourceImage(value)) {
errorstream << "Server sent wrong Hud hotbar selected image (sent value: '" errorstream << "Server sent wrong Hud hotbar selected image (sent value: '"

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B