1.72b
only for test
This commit is contained in:
parent
2ed1046572
commit
c03293b6f3
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
character_creator
|
@ -25,20 +25,33 @@ for i in ipairs(source_list) do
|
|||||||
local red = source_list[i][4]
|
local red = source_list[i][4]
|
||||||
local green = source_list[i][5]
|
local green = source_list[i][5]
|
||||||
local blue = source_list[i][6]
|
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, {
|
minetest.register_node("color:" .. name, {
|
||||||
|
|
||||||
description = desc .. " color",
|
description = desc .. " color",
|
||||||
|
inventory_image = "blocks.png^[colorize:#"..colour..":70",
|
||||||
inventory_image = "blocks.png^[colorize:#"..colour..":70",
|
|
||||||
tiles = {"color_white.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},
|
wield_scale = {x=1,y=1,z=0.5},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {snappy = 2, choppy = 2, wool = 2},
|
groups = {snappy = 2, choppy = 2, wool = 2},
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
oddly_breakable_by_hand = 1,
|
oddly_breakable_by_hand = 1,
|
||||||
dig_immediate = 3,
|
dig_immediate = 3,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
BIN
mods/Nodes/color/textures/color_handblack.png
Normal file
BIN
mods/Nodes/color/textures/color_handblack.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
@ -10,11 +10,11 @@ local skin_default = {
|
|||||||
gender = "Male",
|
gender = "Male",
|
||||||
height = 4,
|
height = 4,
|
||||||
width = 4,
|
width = 4,
|
||||||
face = "eyesblack.png",
|
face = "eyesblack.png",
|
||||||
skin = "skinwhite.png",
|
skin = "skinwhite.png",
|
||||||
tshirt = "shirtwhite.png",
|
tshirt = "shirtwhite.png",
|
||||||
shoes = "hairblack.png",
|
shoes = "hairblack.png",
|
||||||
pants = "pantsblue.png",
|
pants = "pantsblue.png",
|
||||||
}
|
}
|
||||||
|
|
||||||
local skins = character_creator.skins
|
local skins = character_creator.skins
|
||||||
@ -33,8 +33,8 @@ minetest.after(0, function()
|
|||||||
skin = associative_to_array(skins.skin),
|
skin = associative_to_array(skins.skin),
|
||||||
tshirt = associative_to_array(skins.tshirt),
|
tshirt = associative_to_array(skins.tshirt),
|
||||||
shoes = associative_to_array(skins.shoes),
|
shoes = associative_to_array(skins.shoes),
|
||||||
pants = associative_to_array(skins.pants),
|
pants = associative_to_array(skins.pants),
|
||||||
face = associative_to_array(skins.face),
|
face = associative_to_array(skins.face),
|
||||||
|
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
@ -96,6 +96,7 @@ local function load_skin(player)
|
|||||||
player:set_attribute("character_creator:height", skin_default.height)
|
player:set_attribute("character_creator:height", skin_default.height)
|
||||||
|
|
||||||
local function load_data(data_name)
|
local function load_data(data_name)
|
||||||
|
|
||||||
local key = player:get_attribute("character_creator:" .. data_name)
|
local key = player:get_attribute("character_creator:" .. data_name)
|
||||||
local index = table.indexof(skins_array[data_name], key)
|
local index = table.indexof(skins_array[data_name], key)
|
||||||
if index == -1 then
|
if index == -1 then
|
||||||
@ -109,8 +110,8 @@ local function load_skin(player)
|
|||||||
load_data("skin")
|
load_data("skin")
|
||||||
load_data("tshirt")
|
load_data("tshirt")
|
||||||
load_data("shoes")
|
load_data("shoes")
|
||||||
load_data("pants")
|
load_data("pants")
|
||||||
load_data("face")
|
load_data("face")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -125,8 +126,8 @@ local function save_skin(player)
|
|||||||
save_data("skin")
|
save_data("skin")
|
||||||
save_data("tshirt")
|
save_data("tshirt")
|
||||||
save_data("shoes")
|
save_data("shoes")
|
||||||
save_data("pants")
|
save_data("pants")
|
||||||
save_data("face")
|
save_data("face")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -143,11 +144,11 @@ local function get_texture(player)
|
|||||||
local tshirt = skins.tshirt[tshirt_key]
|
local tshirt = skins.tshirt[tshirt_key]
|
||||||
texture = texture .. "^" .. tshirt
|
texture = texture .. "^" .. tshirt
|
||||||
|
|
||||||
local pants_key = skins_array.pants[indexes.pants]
|
local pants_key = skins_array.pants[indexes.pants]
|
||||||
local pants = skins.pants[pants_key]
|
local pants = skins.pants[pants_key]
|
||||||
texture = texture .. "^" .. pants
|
texture = texture .. "^" .. pants
|
||||||
|
|
||||||
local shoes_key = skins_array.shoes[indexes.shoes]
|
local shoes_key = skins_array.shoes[indexes.shoes]
|
||||||
local shoes = skins.shoes[shoes_key]
|
local shoes = skins.shoes[shoes_key]
|
||||||
texture = texture .. "^" .. shoes
|
texture = texture .. "^" .. shoes
|
||||||
|
|
||||||
@ -172,6 +173,22 @@ local function change_skin(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
local name = player:get_player_name()
|
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
|
if minetest.get_modpath("multiskin") then
|
||||||
multiskin.layers[name].skin = texture
|
multiskin.layers[name].skin = texture
|
||||||
@ -361,6 +378,16 @@ minetest.register_chatcommand("skin", {
|
|||||||
end
|
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
|
if minetest.global_exists("unified_inventory") then
|
||||||
unified_inventory.register_button("character_creator", {
|
unified_inventory.register_button("character_creator", {
|
||||||
type = "image",
|
type = "image",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user