mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
new content menu (WIP)
This commit is contained in:
parent
690e3f54c9
commit
5915b811f2
27 changed files with 340 additions and 202 deletions
|
|
@ -232,6 +232,37 @@ function session.reset_entry(name)
|
|||
session.entries[name] = nil
|
||||
end
|
||||
|
||||
function timeit(func, ...)
|
||||
local tm = time.uptime()
|
||||
func(...)
|
||||
print("[time mcs]", (time.uptime()-tm) * 1000000)
|
||||
end
|
||||
|
||||
function table.has(t, x)
|
||||
for i,v in ipairs(t) do
|
||||
if v == x then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function table.index(t, x)
|
||||
for i,v in ipairs(t) do
|
||||
if v == x then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return -1
|
||||
end
|
||||
|
||||
function table.remove_value(t, x)
|
||||
local index = table.index(t, x)
|
||||
if index ~= -1 then
|
||||
table.remove(t, index)
|
||||
end
|
||||
end
|
||||
|
||||
-- Deprecated functions
|
||||
block_index = block.index
|
||||
block_name = block.name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue