wheels!!
This commit is contained in:
parent
73735995b7
commit
d9297245a7
3 changed files with 33 additions and 0 deletions
|
@ -3,4 +3,5 @@ events.ENTITY_INIT:register(function ()
|
||||||
require("scripts.nameplate")
|
require("scripts.nameplate")
|
||||||
require("scripts.soggy")
|
require("scripts.soggy")
|
||||||
require("scripts.physics")
|
require("scripts.physics")
|
||||||
|
require("scripts.wheels.main")
|
||||||
end)
|
end)
|
||||||
|
|
18
scripts/wheels/main.lua
Normal file
18
scripts/wheels/main.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
local toggles = require("scripts.wheels.toggles")
|
||||||
|
|
||||||
|
local wheels = {
|
||||||
|
toggles
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, v in pairs(wheels) do
|
||||||
|
if i == 1 then action_wheel:setPage(v) end
|
||||||
|
if #wheels ~= 1 then
|
||||||
|
v:newAction()
|
||||||
|
:title("to next page")
|
||||||
|
:item("minecraft:arrow")
|
||||||
|
:onLeftClick(function ()
|
||||||
|
local index = (i + 1) > #wheels and 1 or (i + 1)
|
||||||
|
action_wheel:setPage(wheels[index])
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
14
scripts/wheels/toggles.lua
Normal file
14
scripts/wheels/toggles.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
local toggles = action_wheel:newPage()
|
||||||
|
|
||||||
|
function pings.toggleArmor(state)
|
||||||
|
vanilla_model.ARMOR:setVisible(state)
|
||||||
|
end
|
||||||
|
|
||||||
|
local toggle_armor = toggles:newAction()
|
||||||
|
:setToggled(false)
|
||||||
|
:setOnToggle(pings.toggleArmor)
|
||||||
|
:title("toggle armor")
|
||||||
|
:item("red_wool")
|
||||||
|
:toggleItem("green_wool")
|
||||||
|
|
||||||
|
return toggles
|
Loading…
Add table
Add a link
Reference in a new issue