@tool
extends Node3D

# Provides baked lighting configuration guidance in the editor output panel.
# LightmapGI baking is editor-only in Godot 4.7 — use the Bake button.
#
# To bake:
#   1. Open this scene in the Godot editor
#   2. Select the LightmapGI node in the Scene dock
#   3. Click "Bake Lightmap" in the Inspector toolbar (top of inspector)
#
# Or: Scene menu > Bake LightmapGI (Ctrl+Shift+B)

func _ready():
	if not Engine.is_editor_hint():
		return
	
	var lightmap = _find_lightmap_gi()
	if not lightmap:
		push_error("KitDemo: No LightmapGI node found in scene!")
		return
	
	if lightmap.light_data != null:
		print("KitDemo: Lightmap baked ✓")
		print("  To re-bake: Select LightmapGI → 'Bake Lightmap' button")
		return
	
	print("KitDemo: LightmapGI configured but not baked.")
	print("  To bake: Select LightmapGI → 'Bake Lightmap' in Inspector")
	print("  Or: Scene menu → Bake LightmapGI (Ctrl+Shift+B)")
	print("")
	match lightmap.quality:
		0: print("  Quality: Low")
		1: print("  Quality: Medium")
		2: print("  Quality: High")
		3: print("  Quality: Ultra")
	print("  Bounces: ", lightmap.bounces)
	print("  Texel Scale: ", lightmap.texel_scale)
	print("  Max Texture Size: ", lightmap.max_texture_size)
	print("  Interior: ", lightmap.interior)
	print("  Denoiser: ", lightmap.is_using_denoiser())


func _find_lightmap_gi() -> LightmapGI:
	for child in get_children():
		if child is LightmapGI:
			return child
	return null
