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

21 lines
475 B
GDScript3
Raw Normal View History

2020-09-15 23:24:15 +00:00
extends ScrollContainer
class_name TileTab
2020-09-17 23:47:16 +00:00
const button_theme = preload("res://Scenes/Editor/ToolButtonTheme.tres")
2020-09-15 23:24:15 +00:00
signal tile_selected(id)
func add_entry(id: int, group: ButtonGroup, icon: Texture):
2020-09-17 23:47:16 +00:00
var node := ToolButton.new()
2020-09-15 23:24:15 +00:00
node.toggle_mode = true
node.icon = icon
node.group = group
2020-09-17 23:47:16 +00:00
node.flat = false
node.theme = button_theme
2020-09-15 23:24:15 +00:00
node.connect("pressed", self, "_pressed", [id])
$list.add_child(node)
func _pressed(id: int):
emit_signal("tile_selected", id)