2024-01-11 18:19:16 +00:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
var content = null
|
2024-07-28 18:48:24 +00:00
|
|
|
@onready var custom_theme: Theme = get_tree().current_scene.custom_theme
|
2024-08-15 20:34:11 +00:00
|
|
|
#@onready var button_off = get_node(current_scene.%l1_button)# .current_scene.l1_button
|
|
|
|
@onready var lbhide: TextureButton = get_tree().current_scene.get_node("%l1_button")
|
|
|
|
@onready var rbhide: TextureButton = get_tree().current_scene.get_node("%r1_button")
|
2024-01-11 18:19:16 +00:00
|
|
|
|
|
|
|
func _ready():
|
2024-08-15 20:34:11 +00:00
|
|
|
lbhide.visible=false
|
|
|
|
rbhide.visible=false
|
2024-07-28 18:48:24 +00:00
|
|
|
$".".theme = custom_theme
|
2024-01-11 18:19:16 +00:00
|
|
|
if (content != null):
|
2024-03-25 10:22:36 +00:00
|
|
|
$Panel/MarginContainer/VBoxContainer/ContentContainer/MarginContainer.add_child(content)
|
2024-08-15 20:34:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
if Input.is_action_pressed("back_button"):
|
|
|
|
lbhide.visible=true
|
|
|
|
rbhide.visible=true
|
|
|
|
queue_free()
|
2024-01-11 18:19:16 +00:00
|
|
|
|
|
|
|
func set_content(new_content):
|
|
|
|
content = load(new_content).instantiate()
|
2024-03-25 10:22:36 +00:00
|
|
|
func set_title(new_title):
|
|
|
|
$Panel/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer/Label.text = new_title
|
2024-08-04 18:45:51 +00:00
|
|
|
func set_display_text(new_display_text):
|
|
|
|
$Panel/MarginContainer/VBoxContainer/ContentContainer/MarginContainer/RichTextLabel.text=new_display_text
|
2024-01-11 18:19:16 +00:00
|
|
|
func _on_back_pressed():
|
|
|
|
queue_free()
|