This repository has been archived on 2020-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
odyssey-old/Scenes/Editor/TileTab.gd
2020-09-18 01:47:16 +02:00

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)