Added an interval configuration.
parent
83b71abf1c
commit
7f640a7a65
4
README
4
README
|
@ -56,6 +56,10 @@ The system can be configured by adding settings to the `minetest.conf`:
|
|||
# to 15.
|
||||
playermodel_frame_speed_sneaking = 15
|
||||
|
||||
# The interval in which the animation is updated, in seconds, defaults
|
||||
# to 0.066 seconds.
|
||||
playermodel_interval = 0.066
|
||||
|
||||
# The parameters that follow are the start and end frame (both inclusive)
|
||||
# of the animation, and optionally the frame speed for normal and sneaking.
|
||||
# Like this: playermodel_animation_laying = 5, 89, 30, 15
|
||||
|
|
|
@ -63,6 +63,9 @@ playermodel = {
|
|||
-- Defaults to 15.
|
||||
frame_speed_sneaking = settings.get_number("playermodel_frame_speed_sneaking", 15),
|
||||
|
||||
--- The interval in which the animation is updated. Defaults to 0.066.
|
||||
interval = settings.get_number("playermodel_interval", 0.066),
|
||||
|
||||
--- The name of the model that will be used. Defaults to "character.x".
|
||||
model = settings.get_string("playermodel_model_name", "character.x"),
|
||||
|
||||
|
@ -89,7 +92,12 @@ function playermodel.activate_internal()
|
|||
if not playermodel.active then
|
||||
playermodel.animation_providers:add(playermodel.default_animation_provider)
|
||||
|
||||
minetest.register_globalstep(playermodel.perform_animation_updates)
|
||||
scheduler.schedule(
|
||||
"playermodel",
|
||||
playermodel.interval,
|
||||
playermodel.perform_animation_updates,
|
||||
scheduler.OVERSHOOT_POLICY_RUN_ONCE)
|
||||
|
||||
minetest.register_on_joinplayer(playermodel.activate_model_on_player)
|
||||
|
||||
playermodel.active = true
|
||||
|
|
Loading…
Reference in New Issue