forked from Sokomine/yl_speak_up
apply textures2skin for skins with wielded items
This commit is contained in:
parent
927adfb627
commit
57e8bc7352
@ -38,6 +38,8 @@ yl_speak_up.mesh_data["mobs_character.b3d"] = {
|
|||||||
can_show_wielded_items = false,
|
can_show_wielded_items = false,
|
||||||
-- which function can be used to draw the skin?
|
-- which function can be used to draw the skin?
|
||||||
skin_preview = yl_speak_up.skin_preview_normal,
|
skin_preview = yl_speak_up.skin_preview_normal,
|
||||||
|
-- textures are applied directly
|
||||||
|
textures_to_skin = false,
|
||||||
}
|
}
|
||||||
yl_speak_up.mesh_data["skinsdb_3d_armor_character_5.b3d"] = {
|
yl_speak_up.mesh_data["skinsdb_3d_armor_character_5.b3d"] = {
|
||||||
-- the second texture is the skin
|
-- the second texture is the skin
|
||||||
@ -46,6 +48,8 @@ yl_speak_up.mesh_data["skinsdb_3d_armor_character_5.b3d"] = {
|
|||||||
can_show_wielded_items = true,
|
can_show_wielded_items = true,
|
||||||
-- this model needs its own preview function
|
-- this model needs its own preview function
|
||||||
skin_preview = yl_speak_up.skin_preview_skinsdb_3d_armor_character_5,
|
skin_preview = yl_speak_up.skin_preview_skinsdb_3d_armor_character_5,
|
||||||
|
-- call textures2skin in order to convert the textures (wielded items)
|
||||||
|
textures_to_skin = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -392,6 +392,12 @@ yl_speak_up.input_fashion = function(player, formname, fields)
|
|||||||
-- actually make sure that the NPC updates its texture
|
-- actually make sure that the NPC updates its texture
|
||||||
local obj = yl_speak_up.speak_to[pname].obj
|
local obj = yl_speak_up.speak_to[pname].obj
|
||||||
if(obj) then
|
if(obj) then
|
||||||
|
-- the skins with wielded items need some conversion,
|
||||||
|
-- while simpler models may just apply the texture
|
||||||
|
local mesh = yl_speak_up.get_mesh(pname)
|
||||||
|
if(mesh and yl_speak_up.mesh_data[mesh].textures_to_skin) then
|
||||||
|
textures = textures2skin(textures)
|
||||||
|
end
|
||||||
obj:set_properties({ textures = textures })
|
obj:set_properties({ textures = textures })
|
||||||
end
|
end
|
||||||
-- scrolling through the diffrent skins updates the skin; avoid spam in the log
|
-- scrolling through the diffrent skins updates the skin; avoid spam in the log
|
||||||
|
Loading…
Reference in New Issue
Block a user