pandemonium_cms/game/addons/web_pages/editor/AddEntryPopup.gd

29 lines
843 B
GDScript3
Raw Normal View History

2022-08-25 10:56:43 +02:00
tool
extends AcceptDialog
signal on_entry_class_selected(entry_class)
2022-08-25 15:09:54 +02:00
var _init : bool = false
2022-08-25 10:56:43 +02:00
func _notification(what):
2022-08-25 15:09:54 +02:00
if what == NOTIFICATION_ENTER_TREE:
if !_init:
_init = true
get_ok().set_text("Close")
get_node("VBC/AddTitleTextButton").connect("pressed", self, "_add_title_text_button_pressed")
get_node("VBC/AddTextButton").connect("pressed", self, "_add_text_button_pressed")
get_node("VBC/AddimageButton").connect("pressed", self, "_add_image_button_pressed")
2022-08-25 10:56:43 +02:00
func _add_title_text_button_pressed() -> void:
emit_signal("on_entry_class_selected" , "WebPageEntryTitleText")
2022-08-25 15:09:54 +02:00
hide()
func _add_text_button_pressed() -> void:
emit_signal("on_entry_class_selected" , "WebPageEntryText")
hide()
func _add_image_button_pressed() -> void:
emit_signal("on_entry_class_selected" , "WebPageEntryImage")
hide()