Add command support and several debug commands

This commit is contained in:
NullBite 2022-03-14 22:09:18 -04:00
parent 60b5cb495c
commit e5eb735858
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -1,3 +1,4 @@
--- Initial definitions ---
-- Texture dimensions -- -- Texture dimensions --
size = 128 size = 128
factor = size / 64 factor = size / 64
@ -9,6 +10,7 @@ step_v_face=16
offset_u_face=64 offset_u_face=64
offset_v_face=0 offset_v_face=0
armor_enabled=true armor_enabled=true
vanilla_enabled=true
-- initialize values -- -- initialize values --
function player_init() function player_init()
@ -18,12 +20,7 @@ expr_cooldown=0
-- Parts -- -- Parts --
HEAD=model.Head.Head HEAD=model.Head.Head
VANILLA_OUTER={ vanilla_model.HAT, vanilla_model.JACKET, vanilla_model.LEFT_SLEEVE, vanilla_model.RIGHT_SLEEVE, vanilla_model.LEFT_PANTS_LEG, vanilla_model.RIGHT_PANTS_LEG }
-- Initial configuration --
for key, value in pairs(vanilla_model) do
value.setEnabled(false)
end
vanilla_model.CAPE.setEnabled(true)
-- Expression change -- -- Expression change --
function getExprUV(damage, expression) function getExprUV(damage, expression)
@ -54,6 +51,16 @@ function resetExpression()
HEAD.setUV(getExprUV(face_damage,face_expr)) HEAD.setUV(getExprUV(face_damage,face_expr))
end end
function setVanilla(state)
end
-- Initial configuration --
for key, value in pairs(vanilla_model) do
value.setEnabled(false)
end
vanilla_model.CAPE.setEnabled(true)
-- Action Wheel -- -- Action Wheel --
action_wheel.SLOT_1.setTitle('test expression') action_wheel.SLOT_1.setTitle('test expression')
action_wheel.SLOT_1.setFunction(function() ping.expressionTest() end) action_wheel.SLOT_1.setFunction(function() ping.expressionTest() end)
@ -91,6 +98,16 @@ function ping.setArmor(enabled)
end end
end end
--- Toggle Vanilla ---
function ping.setVanilla(state)
if state == nil then
vanilla_enabled=not vanilla_enabled
else
vanilla_enabled=state
end
end
-- does not work on multiplayer, use ping.oof() -- does not work on multiplayer, use ping.oof()
function onDamage(amount, source) function onDamage(amount, source)
@ -125,3 +142,23 @@ function tick()
old_health=player.getHealth() old_health=player.getHealth()
end end
-- Enable commands --
chat_prefix="./"
chat.setFiguraCommandPrefix(chat_prefix)
function onCommand(input)
if input == chat_prefix .. "vanilla" then
ping.setVanilla()
print("Toggled vanilla skin")
end
if input == chat_prefix .. "toggle_custom" then
for key, value in pairs(model) do
value.setEnabled(not value.getEnabled())
end
end
if input == chat_prefix .. "toggle_outer" then
for k, v in pairs(VANILLA_OUTER) do
v.setEnabled(not v.getEnabled())
end
end
end