From ac4db102b2d99ce38c947a9f251e2a625330527f Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 25 Apr 2021 23:35:27 +0200 Subject: [PATCH] add basic temp function to get v4 itemslots --- mods/HUD/mcl_formspec/init.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mods/HUD/mcl_formspec/init.lua b/mods/HUD/mcl_formspec/init.lua index 7013fc0ee..6418a23fd 100644 --- a/mods/HUD/mcl_formspec/init.lua +++ b/mods/HUD/mcl_formspec/init.lua @@ -9,3 +9,15 @@ function mcl_formspec.get_itemslot_bg(x, y, w, h) end return out end + +--This function will replace mcl_formspec.get_itemslot_bg then every formspec will be upgrade to version 4 +function mcl_formspec.get_itemslot_bg_v4(x, y, w, h) + local out = "" + for i = 0, w - 1, 1 do + for j = 0, h - 1, 1 do + out = out .."image["..x+i+(i*0.25)..","..y+j+(j*0.25)..";1,1;mcl_formspec_itemslot.png]" + end + end + return out +end +