You've already forked ComfyFactorio
							
							
				mirror of
				https://github.com/ComfyFactory/ComfyFactorio.git
				synced 2025-10-30 23:47:41 +02:00 
			
		
		
		
	close button tab
This commit is contained in:
		| @@ -58,9 +58,18 @@ local function main_frame(player) | ||||
| 		end | ||||
| 	end | ||||
| 	 | ||||
| 	comfy_panel_refresh_active_tab(player) | ||||
| 	local tab = tabbed_pane.add({type = "tab", name = "comfy_panel_close", caption = "X"}) | ||||
| 	tab.style.maximal_width = 32 | ||||
| 	local frame = tabbed_pane.add({type = "frame", name = name, direction = "vertical"}) | ||||
| 	tabbed_pane.add_tab(tab, frame) | ||||
| 	 | ||||
| 	return tabs | ||||
| 	for _, child in pairs(tabbed_pane.children) do | ||||
| 		child.style.padding = 8 | ||||
| 		child.style.left_padding = 2 | ||||
| 		child.style.right_padding = 2 | ||||
| 	end | ||||
| 	 | ||||
| 	comfy_panel_refresh_active_tab(player) | ||||
| end | ||||
|  | ||||
| function comfy_panel_call_tab(player, name) | ||||
| @@ -93,6 +102,11 @@ local function on_gui_click(event) | ||||
| 		end	 | ||||
| 	end | ||||
| 	 | ||||
| 	if event.element.caption == "X" and event.element.name == "comfy_panel_close" then | ||||
| 		player.gui.left.comfy_panel.destroy() | ||||
| 		return | ||||
| 	end | ||||
| 	 | ||||
| 	if not event.element.caption then return end | ||||
| 	if event.element.type ~= "tab" then return end | ||||
| 	comfy_panel_refresh_active_tab(player) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user