only for test.
MultiCraft
Mrchiantos 2019-06-11 19:28:14 +02:00
parent 30314949a6
commit 5330b547b3
4 changed files with 57 additions and 16 deletions

View File

@ -1 +1,2 @@
default
character_creator

View File

@ -26,13 +26,26 @@ for i in ipairs(source_list) do
local green = source_list[i][5]
local blue = source_list[i][6]
if wieldskin == "white" then
wieldskin2 = "color_handwhite.png^(color_handwhite2.png^[colorize:#"..colour..":70)"
elseif wieldskin == "black" then
wieldskin2 = "color_handblack.png^(color_handwhite2.png^[colorize:#"..colour..":70)"
else
wieldskin2 = "color_handwhite.png^(color_handwhite2.png^[colorize:#"..colour..":70)"
end
minetest.register_node("color:" .. name, {
description = desc .. " color",
inventory_image = "blocks.png^[colorize:#"..colour..":70",
tiles = {"color_white.png^[colorize:#"..colour..":70"},
wield_image = "color_handwhite.png^(color_handwhite2.png^[colorize:#"..colour..":70)",
wield_image = wieldskin2,
wield_scale = {x=1,y=1,z=0.5},
is_ground_content = true,
groups = {snappy = 2, choppy = 2, wool = 2},

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -33,8 +33,8 @@ minetest.after(0, function()
skin = associative_to_array(skins.skin),
tshirt = associative_to_array(skins.tshirt),
shoes = associative_to_array(skins.shoes),
pants = associative_to_array(skins.pants),
face = associative_to_array(skins.face),
pants = associative_to_array(skins.pants),
face = associative_to_array(skins.face),
}
end)
@ -96,6 +96,7 @@ local function load_skin(player)
player:set_attribute("character_creator:height", skin_default.height)
local function load_data(data_name)
local key = player:get_attribute("character_creator:" .. data_name)
local index = table.indexof(skins_array[data_name], key)
if index == -1 then
@ -109,8 +110,8 @@ local function load_skin(player)
load_data("skin")
load_data("tshirt")
load_data("shoes")
load_data("pants")
load_data("face")
load_data("pants")
load_data("face")
end
@ -126,7 +127,7 @@ local function save_skin(player)
save_data("tshirt")
save_data("shoes")
save_data("pants")
save_data("face")
save_data("face")
end
@ -173,6 +174,22 @@ local function change_skin(player)
local name = player:get_player_name()
wieldskin3 = player:get_attribute("character_creator:skin")
if wieldskin3 == "skinwhite.png" then
wieldskin = "white"
elseif wieldskin3 == "skinblack.png" then
wieldskin = "black"
else
wieldskin = "white"
end
if minetest.get_modpath("multiskin") then
multiskin.layers[name].skin = texture
armor:set_player_armor(player)
@ -361,6 +378,16 @@ minetest.register_chatcommand("skin", {
end
})
minetest.register_chatcommand("say", {
params = "<text>",
description = "Send text to chat",
privs = {talk = true},
func = function( _ , text)
minetest.chat_send_all(text)
return true, "Text was sent successfully"
end,
})
if minetest.global_exists("unified_inventory") then
unified_inventory.register_button("character_creator", {
type = "image",