Merge branch 'skins' of /home/wuzzy/src/minetest/git/games/repixture into skins

This commit is contained in:
Wuzzy 2021-07-22 22:13:07 +02:00
commit f436f6f3cf
43 changed files with 36 additions and 12 deletions

View File

@ -13,10 +13,6 @@ player_skins = {}
player_skins.skin_names = {NS("male"), NS("female")}
player_skins.default_skins = {male=true, female=true}
if minetest.settings:get("player_skins_names") then
player_skins.skin_names = util.split(minetest.settings:get("player_skins_names"), ",")
end
player_skins.old_skins = {}
player_skins.skins = {}
@ -227,4 +223,40 @@ minetest.register_chatcommand(
end
})
local genders = { "male", "female" }
local cloth_colors = { "red", "redviolet", "magenta", "purple", "blue", "cyan", "green", "yellow", "orange" }
local band_colors = { "red", "redviolet", "magenta", "purple", "blue", "skyblue", "cyan", "green", "lime", "turquoise", "yellow", "orange" }
local hairs = { "male", "female" }
local eye_colors = { "green", "blue", "brown" }
minetest.register_chatcommand(
"random_skin",
{
params = get_chatparams(),
description = S("Set random player skin"),
privs = {},
func = function(name, param)
local player = minetest.get_player_by_name(name)
if not player then
return false
end
local scol = math.random(0,9)
local gender = genders[math.random(1, #genders)]
local ccol = cloth_colors[math.random(1, #cloth_colors)]
local bcol = band_colors[math.random(1, #band_colors)]
local hair = hairs[math.random(1, #hairs)]
local ecol = eye_colors[math.random(1, #eye_colors)]
default.player_set_textures(
player, {
"player_skins_skin_"..scol.."_male.png" .. "^" ..
"player_skins_eyes_"..ecol..".png" .. "^" ..
"player_skins_hair_"..hair..".png" .. "^" ..
"player_skins_clothes_"..ccol..".png" .. "^" ..
"player_skins_bands_"..bcol..".png"
})
return true
end
})
default.log("mod:player_skins", "loaded")

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

View File

@ -15,14 +15,6 @@ give_initial_enable (Enable initial items) bool false
# Comma-separated list of initial items to give to new players. You must use itemstrings as the item identifiers. This only works if give_initial_enable is active.
give_initial_items (Initial items) string default:pick_stone,default:torch_weak 10
# Here you can add your custom player skins. List each skin by name here, separated by commas.
# The player skin files are read from mods/player_skins/textures in the game's directory.
# Each skin requires two PNG files, where <name> is the skin name:
#
# * player_skins_<name>.png: Player skin
# * player_skins_icon_<name>.png: Player skin icon
player_skins_names (Player skin list) string male,female
[World]
# If enabled, the weather will change from time to time.
weather_enable (Enable dynamic weather) bool true