From b01c184314cf9ec36e2ab4357d78110d59194723 Mon Sep 17 00:00:00 2001 From: NullBite Date: Mon, 26 Sep 2022 23:06:35 -0400 Subject: [PATCH] Fix action wheel and implement page scrolling --- TODO.md | 8 ++++++-- script.lua | 38 +++++++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/TODO.md b/TODO.md index 69b6ada..73bca7d 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/script.lua b/script.lua index 292836d..ed4149a 100644 --- a/script.lua +++ b/script.lua @@ -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)