2023-12-15 22:44:25 +01:00
|
|
|
# (c) 2023-present Eroax
|
|
|
|
# (c) 2023-present Yagich
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
2023-11-22 05:26:11 +01:00
|
|
|
extends DeckNode
|
|
|
|
|
|
|
|
|
|
|
|
func _init() -> void:
|
|
|
|
node_type = "string_constant"
|
|
|
|
name = "String Constant"
|
2023-12-15 22:44:25 +01:00
|
|
|
description = "A String field."
|
2023-11-23 07:38:10 +01:00
|
|
|
|
2023-11-22 05:26:11 +01:00
|
|
|
add_output_port(
|
2023-11-26 23:07:15 +01:00
|
|
|
DeckType.Types.STRING,
|
2023-11-22 05:26:11 +01:00
|
|
|
"Text",
|
|
|
|
"field"
|
|
|
|
)
|
|
|
|
|
2023-12-15 22:44:25 +01:00
|
|
|
func _value_request(_from_port: int) -> Variant:
|
2023-11-22 05:26:11 +01:00
|
|
|
if ports[0].value_callback.get_object():
|
|
|
|
return ports[0].value_callback.call()
|
|
|
|
else:
|
|
|
|
return ports[0].value
|