Files
TheGamesGame/addons/gdfxr/editor/EditorIconButton.gd
2026-07-01 20:31:41 +02:00

17 lines
323 B
GDScript

@tool
extends Button
@export var icon_name: String
var plugin: EditorPlugin # a hack to know if this is executing as plugin
func _notification(what: int):
if not plugin:
return
match what:
NOTIFICATION_ENTER_TREE, NOTIFICATION_THEME_CHANGED:
if icon_name:
icon = get_theme_icon(icon_name, "EditorIcons")