Add command support and several debug commands
This commit is contained in:
parent
60b5cb495c
commit
e5eb735858
49
script.lua
49
script.lua
@ -1,3 +1,4 @@
|
||||
--- Initial definitions ---
|
||||
-- Texture dimensions --
|
||||
size = 128
|
||||
factor = size / 64
|
||||
@ -9,6 +10,7 @@ step_v_face=16
|
||||
offset_u_face=64
|
||||
offset_v_face=0
|
||||
armor_enabled=true
|
||||
vanilla_enabled=true
|
||||
|
||||
-- initialize values --
|
||||
function player_init()
|
||||
@ -18,12 +20,7 @@ expr_cooldown=0
|
||||
|
||||
-- Parts --
|
||||
HEAD=model.Head.Head
|
||||
|
||||
-- Initial configuration --
|
||||
for key, value in pairs(vanilla_model) do
|
||||
value.setEnabled(false)
|
||||
end
|
||||
vanilla_model.CAPE.setEnabled(true)
|
||||
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 }
|
||||
|
||||
-- Expression change --
|
||||
function getExprUV(damage, expression)
|
||||
@ -54,6 +51,16 @@ function resetExpression()
|
||||
HEAD.setUV(getExprUV(face_damage,face_expr))
|
||||
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.SLOT_1.setTitle('test expression')
|
||||
action_wheel.SLOT_1.setFunction(function() ping.expressionTest() end)
|
||||
@ -91,6 +98,16 @@ function ping.setArmor(enabled)
|
||||
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()
|
||||
function onDamage(amount, source)
|
||||
@ -125,3 +142,23 @@ function tick()
|
||||
old_health=player.getHealth()
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user