20 lines
475 B
GDScript
20 lines
475 B
GDScript
extends ScrollContainer
|
|
|
|
class_name TileTab
|
|
|
|
const button_theme = preload("res://Scenes/Editor/ToolButtonTheme.tres")
|
|
|
|
signal tile_selected(id)
|
|
|
|
func add_entry(id: int, group: ButtonGroup, icon: Texture):
|
|
var node := ToolButton.new()
|
|
node.toggle_mode = true
|
|
node.icon = icon
|
|
node.group = group
|
|
node.flat = false
|
|
node.theme = button_theme
|
|
node.connect("pressed", self, "_pressed", [id])
|
|
$list.add_child(node)
|
|
|
|
func _pressed(id: int):
|
|
emit_signal("tile_selected", id)
|