From 78f729fa202c528e714503de97ca48c3f39deef0 Mon Sep 17 00:00:00 2001 From: Cruor Date: Mon, 12 Aug 2024 17:40:42 +0200 Subject: [PATCH] Fixed material list not updating in room tool updateLayerList now sends the actual tool along instead of undefined variable --- src/ui/windows/tools.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ui/windows/tools.lua b/src/ui/windows/tools.lua index 98ac573..c548939 100644 --- a/src/ui/windows/tools.lua +++ b/src/ui/windows/tools.lua @@ -434,6 +434,10 @@ local function updateLayerList(toolName, tool) else toolWindow.layerPanel:removeSelf() + + -- Always update material list if the layer list is invisible + -- Layer item callback will never happen and the material list will be stuck + toolWindow.materialList:updateItems(getMaterialItems("fake_layer_name")) end toolWindow.layerPanelVisible = newVisible @@ -553,7 +557,7 @@ local function toolCallback(list, toolName) toolWindow.eventStates.material = nil toolHandler.selectTool(toolName) - updateLayerList(toolName, tool) + updateLayerList(toolName, toolHandler.tools[toolName]) end end