Use mod.conf for dependencies, and description (#3)

This commit is contained in:
David Leal 2019-10-17 14:13:46 -05:00 committed by SmallJoker
parent 26e9a32006
commit b51cd0326c
4 changed files with 11 additions and 11 deletions

View File

@ -1,2 +0,0 @@
default
player_monoids?

View File

@ -1 +0,0 @@
Adds sitting down, and lying down player animations.

View File

@ -9,7 +9,7 @@ local function freeze(player)
else
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
end
default.player_attached[player_name] = true
player_api.player_attached[player_name] = true
end
local function unfreeze(player)
@ -21,8 +21,8 @@ local function unfreeze(player)
else
player:set_physics_override({speed = 1, jump = 1, gravity = 1})
end
default.player_attached[player_name] = nil
default.player_set_animation(player, "stand", 30)
player_api.player_attached[player_name] = nil
player_api.set_animation(player, "stand", 30)
player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
end
@ -32,7 +32,7 @@ minetest.register_globalstep(function(dtime)
local player = players[i]
local name = player:get_player_name()
local control = player:get_player_control()
if default.player_attached[name] and not player:get_attach() and (
if player_api.player_attached[name] and not player:get_attach() and (
control.up == true or
control.down == true or
control.left == true or
@ -48,11 +48,11 @@ minetest.register_chatcommand("sit", {
description = "Sit down",
func = function(name)
local player = minetest.get_player_by_name(name)
if default.player_attached[name] then
if player_api.player_attached[name] then
unfreeze(player)
else
freeze(player)
default.player_set_animation(player, "sit", 30)
player_api.set_animation(player, "sit", 30)
player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0})
end
end
@ -62,11 +62,11 @@ minetest.register_chatcommand("lay", {
description = "Lay down",
func = function(name)
local player = minetest.get_player_by_name(name)
if default.player_attached[name] then
if player_api.player_attached[name] then
unfreeze(player)
else
freeze(player)
default.player_set_animation(player, "lay", 0)
player_api.set_animation(player, "lay", 0)
player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0})
end
end

View File

@ -1 +1,4 @@
name = cozy
depends = default, player_api
optional_depends = player_monoids
description = Adds sitting down, and lying down player animations.