gd: added input addon

This commit is contained in:
2025-05-27 19:20:46 +02:00
parent d8a1604af9
commit c8d8c7ec25
683 changed files with 21608 additions and 2 deletions

View File

@ -0,0 +1,39 @@
@tool
extends RichTextLabel
signal clicked()
var _formatter:GUIDEInputFormatter = GUIDEInputFormatter.new(64)
var input:GUIDEInput:
set(value):
if value == input:
return
if is_instance_valid(input):
input.changed.disconnect(_refresh)
input = value
if is_instance_valid(input):
input.changed.connect(_refresh)
_refresh()
func _refresh():
if not is_instance_valid(input):
parse_bbcode("[center][i]<not bound>[/i][/center]")
tooltip_text = ""
return
var text := await _formatter.input_as_richtext_async(input, false)
parse_bbcode("[center]" + text + "[/center]")
tooltip_text = _formatter.input_as_text(input)
func _gui_input(event):
if event is InputEventMouseButton:
if event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
clicked.emit()

View File

@ -0,0 +1 @@
uid://cgf2qrodwja32

View File

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://dsv7s6tfmnsrs"]
[ext_resource type="Script" path="res://addons/guide/editor/input_display/input_display.gd" id="1_ne6sd"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0bp65"]
[node name="InputDisplay" type="RichTextLabel"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/normal = SubResource("StyleBoxEmpty_0bp65")
bbcode_enabled = true
fit_content = true
script = ExtResource("1_ne6sd")