Compare commits

...

5 Commits

Author SHA1 Message Date
root 9df3ce21d1 fix:texture_alpha warnings 2021-12-12 12:30:41 +01:00
root 5a591790d8 sync with player_apiz 2021-08-18 01:03:10 +02:00
root e99764f48d new eye hair and skin colors 2021-08-07 02:04:00 +02:00
root 2b884e4897 vanity 2021-01-17 11:10:57 +01:00
root 4109e38567 vanity 2021-01-12 23:16:50 +01:00
19 changed files with 127 additions and 14 deletions

View File

@ -1,11 +1,13 @@
unused_args = false
allow_defined_top = true
allow_defined_top = false
globals = {
"minetest",
"player_api",
"armor",
"dye"
"dye",
"closet",
"vanity"
}
read_globals = {

83
ccloth/init.lua Normal file
View File

@ -0,0 +1,83 @@
--
-- ccloth
-- License:GPLv3
--
--
-- Cool Cloth
--
local S = minetest.get_translator("ccloth")
--Gray Hoodie
player_api.register_cloth("ccloth:gray_hoodie", {
description = S("Gray Hoodie"),
texture = "ccloth_gray_hoodie.png",
inventory_image = "ccloth_gray_hoodie_inv.png",
wield_image = "ccloth_gray_hoodie_inv.png",
preview = "ccloth_gray_hoodie_preview.png",
gender = "unisex",
groups = {cloth = 2},
attach = "ccloth:gray_hoodie_hood",
})
player_api.register_cloth("ccloth:gray_hoodie_hood", {
attached = true,
texture = "ccloth_gray_hoodie_hood.png",
groups = {cloth = 1},
})
minetest.register_craft({
output = "ccloth:gray_hoodie",
type = "shaped",
recipe = {
{"fabric:grey", "", "fabric:grey"},
{"fabric:dark_grey", "fabric:white", "fabric:grey"},
{"fabric:dark_grey", "fabric:grey", "fabric:dark_grey"},
}
})
--Blue Jeans
player_api.register_cloth("ccloth:blue_jeans", {
description = S("Blue Jeans"),
texture = "ccloth_blue_jeans.png",
inventory_image = "ccloth_blue_jeans_inv.png",
wield_image = "ccloth_blue_jeans_inv.png",
preview = "ccloth_blue_jeans_preview.png",
gender = "unisex",
groups = {cloth = 3},
})
minetest.register_craft({
output = "ccloth:blue_jeans",
type = "shaped",
recipe = {
{"fabric:blue", "fabric:blue", "fabric:blue"},
{"fabric:white", "", "fabric:white"},
{"fabric:blue", "", "fabric:blue"},
}
})
--Black Sneakers
player_api.register_cloth("ccloth:black_sneakers", {
description = S("Black Sneakers"),
texture = "ccloth_black_sneakers.png",
inventory_image = "ccloth_black_sneakers_inv.png",
wield_image = "ccloth_black_sneakers_inv.png",
preview = "ccloth_black_sneakers_preview.png",
gender = "unisex",
groups = {cloth = 4},
})
minetest.register_craft({
output = "ccloth:black_sneakers",
type = "shaped",
recipe = {
{"farming:string", "", "farming:string"},
{"fabric:black", "", "fabric:black"},
{"", "", ""},
}
})

View File

@ -0,0 +1,4 @@
# textdomain: ccloth
Gray Hoodie=Sudadera gris con capucha
Blue Jeans=Pantalones vaqueros azules
Black Sneakers=Zapatillas deporte negras

3
ccloth/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = ccloth
description = More cool clothes
depends = player_api, fabric, farming

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -34,7 +34,8 @@ function closet.compose_preview(clicker, gender)
if not(underwear) then
lower = "cloth_lower_underwear_preview.png"
end
local base_texture = player_api.compose_base_texture(clicker, {
local _base_texture = player_api.get_base_texture_table(clicker)
local base_texture = player_api.compose_base_texture(_base_texture, {
canvas_size ="32x64",
skin_texture = "closet_player_preview.png",
eyebrowns_pos = "8,0",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -7,7 +7,8 @@ Hair=Color
Color=de pelo
Dark-haired=Moreno
Gray-haired=Canoso
Brown=Moreno
Light-Brown=Castaño claro
Brown=Castaño
Red-haired=Pelirrojo
Blonde=Rubio

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

View File

@ -3,7 +3,9 @@ local S = ...
function vanity.get_vanity_formspec(clicker)
--5.4--local model = player_api.get_gender_model(gender)
local face_preview = minetest.formspec_escape(player_api.compose_base_texture(clicker, {
local _base_texture = player_api.get_base_texture_table(clicker)
local face_preview = minetest.formspec_escape(player_api.compose_base_texture(_base_texture, {
canvas_size ="16x16",
skin_texture = "vanity_face_base.png",
eyebrowns_pos = "0,0",
@ -16,21 +18,24 @@ function vanity.get_vanity_formspec(clicker)
local formspec =
"formspec_version[4]"..
"size[8.75,8.25]"..
"size[10,8.25]"..
"image[0.5,0.5;4,4;".. face_preview .."]"..
--Skins
"label[6,0.5;"..S("Skin Tone")..":]"..
"image_button[4.75,0.75;1,1;player_normal_skin.png;btn_normal_skin;]"..
"image_button[6,0.75;1,1;player_brown_skin.png;btn_brown_skin;]"..
"image_button[7.25,0.75;1,1;player_black_skin.png;btn_black_skin;]"..
"image_button[6,0.75;1,1;player_light_brown_skin.png;btn_light_brown_skin;]"..
"image_button[7.25,0.75;1,1;player_brown_skin.png;btn_brown_skin;]"..
"image_button[8.5,0.75;1,1;player_black_skin.png;btn_black_skin;]"..
--Eyes
"label[6,2.25;"..S("Eyes Color")..":]"..
"image_button[4.75,2.5;1,1;player_blue_eye.png;btn_blue_eye;]"..
"image_button[6,2.5;1,1;player_brown_eye.png;btn_brown_eye;]"..
"image_button[7.25,2.5;1,1;player_green_eye.png;btn_green_eye;]"..
"image_button[8.5,2.5;1,1;player_black_eye.png;btn_black_eye;]"..
"image_button[4.75,3.75;1,1;player_gray_eye.png;btn_gray_eye;]"..
"image_button[6,3.75;1,1;player_hazel_eye.png;btn_hazel_eye;]"..
"image_button[7.25,3.75;1,1;player_violet_eye.png;btn_violet_eye;]"..
"image_button[8.5,3.75;1,1;player_pink_eye.png;btn_pink_eye;]"..
--Hairs
"label[0.5,5.25;"..S("Hair").."\n"..S("Color")..":]"..
"tooltip[btn_black_hair;"..S("Dark-haired").."]"..
@ -39,17 +44,20 @@ function vanity.get_vanity_formspec(clicker)
"tooltip[btn_gray_hair;"..S("Gray-haired").."]"..
"style[btn_gray_hair;bgcolor=lightgray]"..
"image_button[3.5,5;1,1;;btn_gray_hair;]"..
"tooltip[btn_light_brown_hair;"..S("Light-Brown").."]"..
"style[btn_light_brown_hair;bgcolor=sandybrown]"..
"image_button[4.75,5;1,1;;btn_light_brown_hair;]"..
"tooltip[btn_brown_hair;"..S("Brown").."]"..
"style[btn_brown_hair;bgcolor=brown]"..
"image_button[4.75,5;1,1;;btn_brown_hair;]"..
"style[btn_brown_hair;bgcolor=sienna]"..
"image_button[6,5;1,1;;btn_brown_hair;]"..
"tooltip[btn_red_hair;"..S("Red-haired").."]"..
"style[btn_red_hair;bgcolor=darkorange]"..
"image_button[6,5;1,1;;btn_red_hair;]"..
"style[btn_red_hair;bgcolor=orange]"..
"image_button[7.25,5;1,1;;btn_red_hair;]"..
"tooltip[btn_blonde_hair;"..S("Blonde").."]"..
"style[btn_blonde_hair;bgcolor=yellow]"..
"image_button[7.25,5;1,1;;btn_blonde_hair;]"..
"image_button[8.5,5;1,1;;btn_blonde_hair;]"..
"style_type[button_exit;bgcolor=#006699;textcolor=white]"..
"button_exit[4,6.5;1,1;btn_close;"..S("Close").."]"
"button_exit[4.75,6.5;1,1;btn_close;"..S("Close").."]"
return formspec
end
@ -74,8 +82,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
base_texture["eye"] = "player_hazel_eye.png"
elseif fields.btn_violet_eye then
base_texture["eye"] = "player_violet_eye.png"
elseif fields.btn_black_eye then
base_texture["eye"] = "player_black_eye.png"
elseif fields.btn_pink_eye then
base_texture["eye"] = "player_pink_eye.png"
elseif fields.btn_normal_skin then
base_texture["skin"].color = "normal"
elseif fields.btn_light_brown_skin then
base_texture["skin"].color = "light_brown"
elseif fields.btn_brown_skin then
base_texture["skin"].color = "brown"
elseif fields.btn_black_skin then
@ -86,11 +100,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
elseif fields.btn_gray_hair then
base_texture["hair"].color = "gray"
base_texture["eyebrowns"].color = "gray"
elseif fields.btn_light_brown_hair then
base_texture["hair"].color = "light_brown"
base_texture["eyebrowns"].color = "light_brown"
elseif fields.btn_brown_hair then
base_texture["hair"].color = "brown"
base_texture["eyebrowns"].color = "brown"
elseif fields.btn_red_hair then
base_texture["hair"].color = "red"
base_texture["eyebrowns"].color = "red"
elseif fields.btn_blonde_hair then
base_texture["hair"].color = "blonde"
base_texture["eyebrowns"].color = "blonde"
@ -109,6 +127,7 @@ minetest.register_node("vanity:vanity", {
drawtype = "mesh",
mesh = "vanity_set.b3d",
tiles = {"vanity_vanity.png"},
use_texture_alpha = "clip",
paramtype2 = "facedir",
is_ground_content = false,
groups = {cracky=3, wood=1},