From da87496e26f4d4685fd2164cfdf799358ae90e0c Mon Sep 17 00:00:00 2001 From: luk3yx Date: Sun, 30 Jun 2024 21:32:35 +1200 Subject: [PATCH] Add listcolors to invisible_elems --- init.lua | 1 + test.lua | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/init.lua b/init.lua index d36a575..b27bdbe 100644 --- a/init.lua +++ b/init.lua @@ -230,6 +230,7 @@ end local invisible_elems = { style = true, listring = true, scrollbaroptions = true, tableoptions = true, tablecolumns = true, tooltip = true, style_type = true, set_focus = true, + listcolors = true } local DEFAULT_SPACING = 0.2 diff --git a/test.lua b/test.lua index 3c5d20a..85eeb32 100644 --- a/test.lua +++ b/test.lua @@ -368,6 +368,20 @@ describe("Flow", function() ]]) end) + it("keeps gui.Listcolors invisible", function() + test_render(gui.VBox{ + min_h = 5, + gui.Box{w = 1, h = 1, color = "red"}, + gui.Listcolors{slot_bg_normal = "red", slot_bg_hover = "blue"}, + gui.Box{w = 1, h = 1, color = "green"}, + }, [[ + size[1.6,5.6] + box[0.3,0.3;1,1;red] + listcolors[red;blue] + box[0.3,1.5;1,1;green] + ]]) + end) + it("registers inventory formspecs", function () local stupid_simple_inv_expected = "formspec_version[7]" ..