mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-08-20 04:54:09 +02:00
Add support for wardrobe mod
This commit is contained in:
parent
2b0ce6f63e
commit
91602ed6f2
@ -88,6 +88,8 @@ elseif minetest.get_modpath("simple_skins") then
|
||||
skin_mod = "simple_skins"
|
||||
elseif minetest.get_modpath("u_skins") then
|
||||
skin_mod = "u_skins"
|
||||
elseif minetest.get_modpath("wardrobe") then
|
||||
skin_mod = "wardrobe"
|
||||
end
|
||||
|
||||
armor.def = {
|
||||
@ -246,6 +248,8 @@ armor.get_player_skin = function(self, name)
|
||||
skin = skins.skins[name]
|
||||
elseif skin_mod == "u_skins" then
|
||||
skin = u_skins.u_skins[name]
|
||||
elseif skin_mod == "wardrobe" then
|
||||
skin = string.gsub(wardrobe.playerSkins[name], '\.png$','')
|
||||
end
|
||||
return skin or armor.default_skin
|
||||
end
|
||||
@ -342,6 +346,7 @@ default.player_register_model("3d_armor_character.b3d", {
|
||||
-- Register Callbacks
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
local name = armor:get_valid_player(player, "[on_player_receive_fields]")
|
||||
if not name then
|
||||
return
|
||||
@ -444,6 +449,11 @@ minetest.register_on_joinplayer(function(player)
|
||||
if skin and u_skins.get_type(skin) == u_skins.type.MODEL then
|
||||
armor.textures[name].skin = skin..".png"
|
||||
end
|
||||
elseif skin_mod == "wardrobe" then
|
||||
local skin = wardrobe.playerSkins[name]
|
||||
if skin then
|
||||
armor.textures[name].skin = skin
|
||||
end
|
||||
end
|
||||
if minetest.get_modpath("player_textures") then
|
||||
local filename = minetest.get_modpath("player_textures").."/textures/player_"..name
|
||||
|
Loading…
Reference in New Issue
Block a user