Fix action wheel and implement page scrolling

This commit is contained in:
NullBite 2022-09-26 23:06:35 -04:00
parent 8f2b292689
commit b01c184314
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
2 changed files with 31 additions and 15 deletions

View File

@ -2,17 +2,18 @@
## General
- [ ] use matrix thing for UVManager (linear algebra is hard)
- [ ] Add action wheel icons
## Rewrite
- [ ] fix pings
- [ ] reimplement avatar settings
- [ ] fix action wheel
- [ ] fix sound
- [ ] fix Blockbench animations
- [ ] fix or disable custom commands (can probably use `/figura run`)
- [ ] fix armor, can't re-enable until cleanup
- [ ] fix armor, won't re-enable until cleanup
## Cleanup
- [ ] rework appropriate action wheel items as ToggleAction instead of ClickAction
- [ ] remove partial vanilla support, completely broken with inability to manipulate vanilla parts
- [ ] remove partial_vanilla stuff from PartsManager
- [ ] split off large snippets of code into separate files
@ -21,3 +22,6 @@
- [ ] utility functions
- [ ] cleanup tick functions, timers
- [ ] cleanup armor code to make less redundant
# Done
- [x] fix action wheel

View File

@ -835,19 +835,31 @@ end
-- Action Wheel & Pings -- {{{
-- TODO
-- action_wheel.SLOT_1.setTitle('test expression')
-- action_wheel.SLOT_1.setFunction(function() ping.expressionTest() end)
-- function ping.expressionTest()
-- changeExpression("hurt", 10)
-- end
-- action_wheel.SLOT_2.setTitle('log health')
-- action_wheel.SLOT_2.setFunction(function() print(player.getHealth()) end)
-- action_wheel.SLOT_3.setTitle('Toggle Armor')
-- action_wheel.SLOT_3.setFunction(function() setArmor() end)
-- action_wheel.SLOT_4.setTitle('T-Pose')
-- action_wheel.SLOT_4.setFunction(function() ping.tPose() end)
-- action_wheel.SLOT_5.setTitle('UwU')
-- action_wheel.SLOT_5.setFunction(function() ping.expr("owo") end)
do
wheel={}
local wheel_index=1
function wheelScroll(change)
wheel_index=((wheel_index-1)+change)%#wheel+1
action_wheel:setPage(wheel[wheel_index])
print("page: " .. wheel_index)
end
wheel[1]=action_wheel:createPage()
action_wheel:setPage(wheel[1])
action_wheel.scroll=wheelScroll
end
wheel[1]:newAction():title('test expression'):onLeftClick(function() ping.expressionTest() end)
function ping.expressionTest()
changeExpression("hurt", 10)
end
wheel[1]:newAction():title('log health'):onLeftClick(function() print(player:getHealth()) end)
wheel[1]:newAction():title('Toggle Armor'):onLeftClick(function() setArmor() end)
wheel[1]:newAction():title('T-Pose'):onLeftClick(function() ping.tPose() end)
wheel[1]:newAction():title('UwU'):onLeftClick(function() ping.expr("owo") end)
-- action_wheel.SLOT_8.setTitle('sssss...')
-- action_wheel.SLOT_8.setItem("minecraft:creeper_head")
-- action_wheel.SLOT_8.setFunction(function() switch_model('misc/Creeper') end)