extends Control

@onready var core_item_list = [
	$CoreItemFree/Up, $CoreItemFree/Left, $CoreItemFree/Down, $CoreItemFree/Right,
	$CoreItemLock/Up, $CoreItemLock/Left, $CoreItemLock/Down, $CoreItemLock/Right,
]
@onready var core_item_free = $CoreItemFree
@onready var core_item_lock = $CoreItemLock

func on_core_active_list_changed(core_list):
	for i in range(len(core_list)):
		var cfg = core_list[i]
		var item = core_item_list[i] as CoreItemSub
		if cfg:
			item.set_icon(cfg.get_icon())
		else:
			item.set_icon(null)
			
func on_is_switch_changed(value:bool):
	visible = value
	
func on_target_changed(value:int):
	var isLock = value != 0
	core_item_free.visible = !isLock
	core_item_lock.visible = isLock
	
