+end
+
+-- Called when a player's appearance needs to be updated
+function default.player_set_model(player, model_name)
+ local name = player:get_player_name()
+ local model = models[model_name]
+ if model then
+ if player_model[name] == model_name then
+ return
+ end
+ player:set_properties({
+ mesh = model_name,
+ textures = player_textures[name] or model.textures,
+ visual = "mesh",
+ visual_size = model.visual_size or {x=1, y=1},
+ })
+ default.player_set_animation(player, "stand")
+ else
+ player:set_properties({
+ textures = { "player.png", "player_back.png", },
+ visual = "upright_sprite",
+ })
+ end
+ player_model[name] = model_name
+end
+
+function default.player_set_textures(player, textures)
+ local name = player:get_player_name()
+ player_textures[name] = textures
+ player:set_properties({textures = textures,})
+end
+
+function default.player_set_animation(player, anim_name, speed)
+ local name = player:get_player_name()
+ if player_anim[name] == anim_name then
+ return
+ end
+ local model = player_model[name] and models[player_model[name]]
+ if not (model and model.animations[anim_name]) then
+ return
+ end
+ local anim = model.animations[anim_name]
+ player_anim[name] = anim_name
+ player:set_animation(anim, speed or model.animation_speed, animation_blend)