Skip to content

Commit

Permalink
Update touchscreen.lua
Browse files Browse the repository at this point in the history
Co-authored-by: OgelGames <[email protected]>
  • Loading branch information
Infi-power and OgelGames authored Nov 13, 2023
1 parent 9f89209 commit f667c28
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions touchscreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,18 @@ local function create_formspec(meta, data)
if focus then
fs = fs.."set_focus["..focus.."]"
end

local data_size = 0
for idx, val in pairs(data) do
if idx > data_size then
data_size = idx
for i in pairs(data) do
if i > data_size then
data_size = i
end
end

local formspec_result = fs
for i = 1, data_size, 1 do
for i=1, data_size do
if data[i] then
formspec_result = formspec_result..data[i]
fs = fs..data[i]
end
end

return formspec_result
return fs
end

local function update_formspec(pos, meta, data)
Expand Down

0 comments on commit f667c28

Please sign in to comment.