From 246536b89e33b4e5c4ca7fd100c94ef08cb64c47 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Wed, 8 May 2024 20:45:33 +0200 Subject: [PATCH] Update project --- godot/CORE | 2 +- godot/Init.gd | 4 ++-- godot/Test.gd | 2 +- godot/Test.tscn | 32 ++++++++++++++++--------------- godot/project.godot | 2 +- sui/scenesrc/SuiHeader.tscn | 10 +++------- sui/scenesrc/SuiIconButton.tscn | 23 ++++++++-------------- sui/scenesrc/SuiText.tscn | 10 +++------- sui/scenesrc/SuiTextButton.tscn | 12 ++++-------- sui/src/SuiBaseClass.gd | 29 ++++++++++++++++++++++++++++ sui/src/SuiHeader.gd | 17 ++--------------- sui/src/SuiHeaderTool.gd | 19 ------------------ sui/src/SuiIconButton.gd | 28 ++++++++------------------- sui/src/SuiIconButtonTool.gd | 34 --------------------------------- sui/src/SuiText.gd | 28 ++++++++------------------- sui/src/SuiTextButton.gd | 28 ++++++++------------------- sui/src/SuiTextButtonTool.gd | 26 ------------------------- sui/src/SuiTextTool.gd | 19 ------------------ 18 files changed, 95 insertions(+), 230 deletions(-) create mode 100644 sui/src/SuiBaseClass.gd delete mode 100644 sui/src/SuiHeaderTool.gd delete mode 100644 sui/src/SuiIconButtonTool.gd delete mode 100644 sui/src/SuiTextButtonTool.gd delete mode 100644 sui/src/SuiTextTool.gd diff --git a/godot/CORE b/godot/CORE index 92855bb..9d46a0e 160000 --- a/godot/CORE +++ b/godot/CORE @@ -1 +1 @@ -Subproject commit 92855bb4e7dec253093ec043e5d070ccba91c1ec +Subproject commit 9d46a0ec051eda6c898c836922fc6622d063cc36 diff --git a/godot/Init.gd b/godot/Init.gd index 5ab4166..4694221 100644 --- a/godot/Init.gd +++ b/godot/Init.gd @@ -2,7 +2,7 @@ extends Node var core: Core var core_config: CoreConfiguration = CoreConfiguration.new() -@onready var logger: CoreLoggerInstance = core.logger.get_instance("Init.gd") +@onready var logger: CoreLoggerInstance = core.logger.get_instance("Init.gd", self) @onready var sms: CoreBaseModule = core.sms func _init() -> void: @@ -15,7 +15,7 @@ func _ready() -> void: await core.complete_init() logger.info("Loading Test.tscn into SceneTree") - sms.add_scene("test", CoreTypes.SceneType.MAIN, ResourceLoader.load("res://Test.tscn").instantiate()) + sms.add_scene("test", ResourceLoader.load("res://Test.tscn").instantiate(), CoreTypes.SceneType.MAIN) logger.info("Freeing") queue_free() diff --git a/godot/Test.gd b/godot/Test.gd index 7f6e342..996038a 100644 --- a/godot/Test.gd +++ b/godot/Test.gd @@ -1,6 +1,6 @@ extends Control -@onready var logger: CoreLoggerInstance = get_node("/root/CORE").logger.get_instance("Test.gd") +@onready var logger: CoreLoggerInstance = get_node("/root/CORE").logger.get_instance("Test.gd", self) func _ready() -> void: $SuiIconButton.connect("up", func() -> void: logger.info("SuiIconButton: up()")) diff --git a/godot/Test.tscn b/godot/Test.tscn index 827717a..721f2c6 100644 --- a/godot/Test.tscn +++ b/godot/Test.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=6 format=3 uid="uid://5fghtsgvqc7j"] +[gd_scene load_steps=8 format=3 uid="uid://5fghtsgvqc7j"] [ext_resource type="PackedScene" uid="uid://cxg471hoqg6mr" path="res://SUI/scenesrc/SuiIconButton.tscn" id="1_3di6k"] [ext_resource type="Script" path="res://Test.gd" id="1_xnmp1"] [ext_resource type="PackedScene" uid="uid://4hi8y7pu3w0v" path="res://SUI/scenesrc/SuiTextButton.tscn" id="2_dxvwu"] [ext_resource type="PackedScene" uid="uid://1r7pvm0biuk7" path="res://SUI/scenesrc/SuiHeader.tscn" id="2_pcev0"] [ext_resource type="PackedScene" uid="uid://bso65vpjqc4g4" path="res://SUI/scenesrc/SuiText.tscn" id="4_1lt1v"] +[ext_resource type="Texture2D" uid="uid://beqhfqbyme6in" path="res://SUI/dist/example.png" id="4_12skp"] [node name="Test" type="Control"] layout_mode = 3 @@ -17,31 +18,32 @@ script = ExtResource("1_xnmp1") [node name="SuiHeader" parent="." instance=ExtResource("2_pcev0")] layout_mode = 1 -offset_left = 43.0 -offset_top = 349.0 -offset_right = -360.0 -offset_bottom = -14.0 +offset_left = 171.0 +offset_top = 436.0 +offset_right = -282.0 +offset_bottom = -4.0 text = "Header: Normal [b]Bold[/b] [i]Italic[/i] [b][i]Bold Italic[/i][/b] [code]Code -->[/code]" [node name="SuiIconButton" parent="." instance=ExtResource("1_3di6k")] layout_mode = 1 -offset_left = 423.0 +offset_left = 671.0 offset_top = 28.0 offset_right = -32.0 -offset_bottom = -408.0 +offset_bottom = -446.0 +image = ExtResource("4_12skp") [node name="SuiText" parent="." instance=ExtResource("4_1lt1v")] layout_mode = 1 -offset_left = 371.0 -offset_top = 205.0 -offset_right = -349.0 -offset_bottom = -225.0 +offset_left = 697.0 +offset_top = 245.0 +offset_right = -23.0 +offset_bottom = -185.0 text = "Text: Normal [b]Bold[/b] [i]Italic[/i] [b][i]Bold Italic[/i][/b] [code]Code -->[/code]" [node name="SuiTextButton" parent="." instance=ExtResource("2_dxvwu")] layout_mode = 1 -offset_left = 645.0 -offset_top = 307.0 -offset_right = -26.0 -offset_bottom = -69.0 +offset_left = 665.0 +offset_top = 368.0 +offset_right = -6.0 +offset_bottom = -8.0 text = "Button: Normal [b]Bold[/b] [i]Italic[/i] [b][i]Bold Italic[/i][/b] [code]Code -->[/code]" diff --git a/godot/project.godot b/godot/project.godot index 46277e5..9cde015 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -19,7 +19,7 @@ boot_splash/show_image=false [display] -window/size/viewport_width=950 +window/size/viewport_width=960 window/size/viewport_height=540 [filesystem] diff --git a/sui/scenesrc/SuiHeader.tscn b/sui/scenesrc/SuiHeader.tscn index a663ee3..67e5f23 100644 --- a/sui/scenesrc/SuiHeader.tscn +++ b/sui/scenesrc/SuiHeader.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=4 format=3 uid="uid://1r7pvm0biuk7"] +[gd_scene load_steps=3 format=3 uid="uid://1r7pvm0biuk7"] -[ext_resource type="Script" path="res://SUI/src/SuiHeader.gd" id="1_b3qg3"] -[ext_resource type="Script" path="res://SUI/src/SuiHeaderTool.gd" id="2_bnj46"] +[ext_resource type="Script" path="res://SUI/src/SuiHeader.gd" id="2_bnj46"] [ext_resource type="Theme" uid="uid://c08yxv1cirbxe" path="res://SUI/themes/RichTextLabel.tres" id="3_877pi"] [node name="SuiHeader" type="Control"] @@ -13,14 +12,11 @@ offset_right = -780.0 offset_bottom = -490.0 grow_horizontal = 2 grow_vertical = 2 -script = ExtResource("1_b3qg3") - -[node name="ToolScript" type="Node" parent="."] script = ExtResource("2_bnj46") [node name="Text" type="RichTextLabel" parent="."] layout_mode = 0 -offset_right = 170.0 +offset_right = 180.0 offset_bottom = 50.0 theme = ExtResource("3_877pi") theme_override_font_sizes/normal_font_size = 35 diff --git a/sui/scenesrc/SuiIconButton.tscn b/sui/scenesrc/SuiIconButton.tscn index 2eabca8..3e0a546 100644 --- a/sui/scenesrc/SuiIconButton.tscn +++ b/sui/scenesrc/SuiIconButton.tscn @@ -1,8 +1,6 @@ -[gd_scene load_steps=5 format=3 uid="uid://cxg471hoqg6mr"] +[gd_scene load_steps=3 format=3 uid="uid://cxg471hoqg6mr"] -[ext_resource type="Script" path="res://SUI/src/SuiIconButton.gd" id="1_ekv73"] -[ext_resource type="Texture2D" uid="uid://beqhfqbyme6in" path="res://SUI/dist/example.png" id="2_c5w38"] -[ext_resource type="Script" path="res://SUI/src/SuiIconButtonTool.gd" id="2_g6elc"] +[ext_resource type="Script" path="res://SUI/src/SuiIconButton.gd" id="2_g6elc"] [ext_resource type="Theme" uid="uid://prqv77t23rsq" path="res://SUI/themes/Button.tres" id="3_knxki"] [node name="SuiIconButton" type="Control"] @@ -11,29 +9,24 @@ anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 offset_right = -900.0 -offset_bottom = -490.0 +offset_bottom = -480.0 grow_horizontal = 2 grow_vertical = 2 -script = ExtResource("1_ekv73") -image = ExtResource("2_c5w38") +script = ExtResource("2_g6elc") ip_left = 8 ip_top = 5 ip_right = 8 ip_bottom = 5 -[node name="ToolScript" type="Node" parent="."] -script = ExtResource("2_g6elc") - [node name="Button" type="Button" parent="."] layout_mode = 0 -offset_right = 50.0 -offset_bottom = 50.0 +offset_right = 60.0 +offset_bottom = 60.0 theme = ExtResource("3_knxki") [node name="Icon" type="NinePatchRect" parent="."] layout_mode = 0 offset_left = 8.0 offset_top = 5.0 -offset_right = 42.0 -offset_bottom = 45.0 -texture = ExtResource("2_c5w38") +offset_right = 60.0 +offset_bottom = 60.0 diff --git a/sui/scenesrc/SuiText.tscn b/sui/scenesrc/SuiText.tscn index c92238f..0750cb8 100644 --- a/sui/scenesrc/SuiText.tscn +++ b/sui/scenesrc/SuiText.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=4 format=3 uid="uid://bso65vpjqc4g4"] +[gd_scene load_steps=3 format=3 uid="uid://bso65vpjqc4g4"] -[ext_resource type="Script" path="res://SUI/src/SuiText.gd" id="1_1jc62"] -[ext_resource type="Script" path="res://SUI/src/SuiTextTool.gd" id="2_87ovr"] +[ext_resource type="Script" path="res://SUI/src/SuiText.gd" id="2_87ovr"] [ext_resource type="Theme" uid="uid://c08yxv1cirbxe" path="res://SUI/themes/RichTextLabel.tres" id="3_fttgr"] [node name="SuiText" type="Control"] @@ -13,14 +12,11 @@ offset_right = -850.0 offset_bottom = -503.0 grow_horizontal = 2 grow_vertical = 2 -script = ExtResource("1_1jc62") - -[node name="ToolScript" type="Node" parent="."] script = ExtResource("2_87ovr") [node name="Text" type="RichTextLabel" parent="."] layout_mode = 0 -offset_right = 100.0 +offset_right = 110.0 offset_bottom = 37.0 theme = ExtResource("3_fttgr") theme_override_font_sizes/normal_font_size = 25 diff --git a/sui/scenesrc/SuiTextButton.tscn b/sui/scenesrc/SuiTextButton.tscn index ba3a4fe..fac8fdc 100644 --- a/sui/scenesrc/SuiTextButton.tscn +++ b/sui/scenesrc/SuiTextButton.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=5 format=3 uid="uid://4hi8y7pu3w0v"] +[gd_scene load_steps=4 format=3 uid="uid://4hi8y7pu3w0v"] -[ext_resource type="Script" path="res://SUI/src/SuiTextButton.gd" id="1_tjgbd"] -[ext_resource type="Script" path="res://SUI/src/SuiTextButtonTool.gd" id="2_43xd1"] +[ext_resource type="Script" path="res://SUI/src/SuiTextButton.gd" id="2_43xd1"] [ext_resource type="Theme" uid="uid://prqv77t23rsq" path="res://SUI/themes/Button.tres" id="3_u0br7"] [ext_resource type="Theme" uid="uid://c08yxv1cirbxe" path="res://SUI/themes/RichTextLabel.tres" id="4_vp57w"] @@ -14,20 +13,17 @@ offset_right = -700.0 offset_bottom = -490.0 grow_horizontal = 2 grow_vertical = 2 -script = ExtResource("1_tjgbd") - -[node name="ToolScript" type="Node" parent="."] script = ExtResource("2_43xd1") [node name="Button" type="Button" parent="."] layout_mode = 0 -offset_right = 250.0 +offset_right = 260.0 offset_bottom = 50.0 theme = ExtResource("3_u0br7") [node name="Text" type="RichTextLabel" parent="."] layout_mode = 0 -offset_right = 250.0 +offset_right = 260.0 offset_bottom = 50.0 mouse_filter = 2 theme = ExtResource("4_vp57w") diff --git a/sui/src/SuiBaseClass.gd b/sui/src/SuiBaseClass.gd new file mode 100644 index 0000000..df1aaae --- /dev/null +++ b/sui/src/SuiBaseClass.gd @@ -0,0 +1,29 @@ +@tool +extends Control +class_name SuiBaseClass + +var core: Core +var logger: CoreLoggerInstance = null + +@export_category("Debugging") +@export var editor_process: bool = true +@export var runtime_process: bool = true + +# +++ initialization and process methods +++ +func _ready() -> void: + if !in_editor(): core = get_node("/root/CORE") + +func _process(_delta: float): + if execute_process(): update_element() + +# +++ element updating +++ +func update_element() -> void: pass + +# +++ etc +++ +func execute_process() -> bool: + if in_editor() and !editor_process: return false + elif !in_editor() and !runtime_process: return false + else: return true + +func in_editor() -> bool: + return get_node_or_null("/root/CORE") == null diff --git a/sui/src/SuiHeader.gd b/sui/src/SuiHeader.gd index e177332..67d8f1e 100644 --- a/sui/src/SuiHeader.gd +++ b/sui/src/SuiHeader.gd @@ -1,24 +1,11 @@ -extends Control - -@onready var logger: CoreLoggerInstance = get_node("/root/CORE").logger.get_instance("SUI/src/SuiHeader.gd") +@tool +extends SuiBaseClass @export_category("Base Configuration") @export_subgroup("RichTextLabel") @export var bbcode_support: bool = true @export_multiline var text: String = "[center]SuiHeader[/center]" @export var font_size: int = 35 -@export_category("Debugging") -@export var editor_process: bool = true -@export var runtime_process: bool = true - -func _ready() -> void: - # Free unused children - logger.diag("<" + name + "> Freeing ToolScript") - get_child(0).queue_free() - -func _process(_delta: float) -> void: - if !runtime_process: return - update_element() func update_element() -> void: # Update sizes diff --git a/sui/src/SuiHeaderTool.gd b/sui/src/SuiHeaderTool.gd deleted file mode 100644 index 1c5a6a8..0000000 --- a/sui/src/SuiHeaderTool.gd +++ /dev/null @@ -1,19 +0,0 @@ -@tool -extends Node - -func _process(_delta: float): - if !get_parent().editor_process: return - var parent: Control = get_parent() - var text: RichTextLabel = parent.get_node("Text") - - # Update sizes - text.size = parent.size - - # Update RichTextLabel stuff - text.bbcode_enabled = parent.bbcode_support - text.text = parent.text - text.add_theme_font_size_override("normal_font_size", parent.font_size) - text.add_theme_font_size_override("bold_font_size", parent.font_size) - text.add_theme_font_size_override("italics_font_size", parent.font_size) - text.add_theme_font_size_override("bold_italics_font_size", parent.font_size) - text.add_theme_font_size_override("mono_font_size", parent.font_size) diff --git a/sui/src/SuiIconButton.gd b/sui/src/SuiIconButton.gd index cc76157..00b9a3a 100644 --- a/sui/src/SuiIconButton.gd +++ b/sui/src/SuiIconButton.gd @@ -1,6 +1,5 @@ -extends Control - -@onready var logger: CoreLoggerInstance = get_node("/root/CORE").logger.get_instance("SUI/src/SuiIconButton.gd") +@tool +extends SuiBaseClass @export_category("Base Configuration") @export_subgroup("Button") @@ -25,9 +24,6 @@ extends Control @export_subgroup("Axis Stretch") @export var as_horizontal: NinePatchRect.AxisStretchMode = NinePatchRect.AxisStretchMode.AXIS_STRETCH_MODE_STRETCH @export var as_vertical: NinePatchRect.AxisStretchMode = NinePatchRect.AxisStretchMode.AXIS_STRETCH_MODE_STRETCH -@export_category("Debugging") -@export var editor_process: bool = true -@export var runtime_process: bool = true signal down signal up @@ -35,20 +31,12 @@ signal pressed signal toggled func _ready() -> void: - # Free unused children - logger.diag("<" + name + "> Freeing ToolScript") - get_child(0).queue_free() - - # Add signals - logger.diag("<" + name + "> Adding signals") - $Button.connect("button_down", func() -> void: emit_signal("down")) - $Button.connect("button_up", func() -> void: emit_signal("up")) - $Button.connect("pressed", func() -> void: emit_signal("pressed")) - $Button.connect("toggled", func(toggled_on: bool) -> void: emit_signal("toggled", toggled_on)) - -func _process(_delta: float) -> void: - if !runtime_process: return - update_element() + super() + if !in_editor(): + $Button.connect("button_down", func() -> void: emit_signal("down")) + $Button.connect("button_up", func() -> void: emit_signal("up")) + $Button.connect("pressed", func() -> void: emit_signal("pressed")) + $Button.connect("toggled", func(toggled_on: bool) -> void: emit_signal("toggled", toggled_on)) func update_element() -> void: # Update button size diff --git a/sui/src/SuiIconButtonTool.gd b/sui/src/SuiIconButtonTool.gd deleted file mode 100644 index 1057e44..0000000 --- a/sui/src/SuiIconButtonTool.gd +++ /dev/null @@ -1,34 +0,0 @@ -@tool -extends Node - -func _process(_delta: float): - if !get_parent().editor_process: return - var parent: Control = get_parent() - var button: Button = parent.get_node("Button") - var icon: NinePatchRect = parent.get_node("Icon") - - # Update button size - button.size = parent.size - - # Update icon size + padding - icon.size = parent.size - icon.position.x = parent.ip_left - icon.position.y = parent.ip_top - icon.size.x -= parent.ip_right + parent.ip_left - icon.size.y -= parent.ip_bottom + parent.ip_top - - # Update Button stuff - button.disabled = parent.disabled - button.toggle_mode = parent.toggle_mode - button.button_pressed = parent.button_pressed - - # Update NinePatchRect stuff - icon.texture = parent.image - icon.region_rect = parent.region_rect - icon.draw_center = parent.draw_center - icon.patch_margin_left = parent.pm_left - icon.patch_margin_top = parent.pm_top - icon.patch_margin_right = parent.pm_right - icon.patch_margin_bottom = parent.pm_bottom - icon.axis_stretch_horizontal = parent.as_horizontal - icon.axis_stretch_vertical = parent.as_vertical diff --git a/sui/src/SuiText.gd b/sui/src/SuiText.gd index 1748ac4..e4f77e1 100644 --- a/sui/src/SuiText.gd +++ b/sui/src/SuiText.gd @@ -1,34 +1,22 @@ -extends Control - -@onready var logger: CoreLoggerInstance = get_node("/root/CORE").logger.get_instance("SUI/src/SuiText.gd") +@tool +extends SuiBaseClass @export_category("Base Configuration") @export_subgroup("RichTextLabel") @export var bbcode_support: bool = true @export_multiline var text: String = "[center]SuiText[/center]" @export var font_size: int = 25 -@export_category("Debugging") -@export var editor_process: bool = true -@export var runtime_process: bool = true signal meta_clicked signal meta_hover_started signal meta_hover_ended -func _ready() -> void: - # Free unused children - logger.diag("<" + name + "> Freeing ToolScript") - get_child(0).queue_free() - - # Add signals - logger.diag("<" + name + "> Adding signals") - $Text.connect("meta_clicked", func(meta: Variant) -> void: emit_signal("meta_clicked", meta)) - $Text.connect("meta_hover_started", func(meta: Variant) -> void: emit_signal("meta_hover_started", meta)) - $Text.connect("meta_hover_ended", func(meta: Variant) -> void: emit_signal("meta_hover_ended", meta)) - -func _process(_delta: float) -> void: - if !runtime_process: return - update_element() +func _ready(): + super() + if in_editor(): + $Text.connect("meta_clicked", func(meta: Variant) -> void: emit_signal("meta_clicked", meta)) + $Text.connect("meta_hover_started", func(meta: Variant) -> void: emit_signal("meta_hover_started", meta)) + $Text.connect("meta_hover_ended", func(meta: Variant) -> void: emit_signal("meta_hover_ended", meta)) func update_element() -> void: # Update sizes diff --git a/sui/src/SuiTextButton.gd b/sui/src/SuiTextButton.gd index 310193b..f508b46 100644 --- a/sui/src/SuiTextButton.gd +++ b/sui/src/SuiTextButton.gd @@ -1,6 +1,5 @@ -extends Control - -@onready var logger: CoreLoggerInstance = get_node("/root/CORE").logger.get_instance("SUI/src/SuiTextButton.gd") +@tool +extends SuiBaseClass @export_category("Base Configuration") @export_subgroup("Button") @@ -11,9 +10,6 @@ extends Control @export var bbcode_support: bool = true @export_multiline var text: String = "[center]SuiTextButton[/center]" @export var font_size: int = 35 -@export_category("Debugging") -@export var editor_process: bool = true -@export var runtime_process: bool = true signal down signal up @@ -21,20 +17,12 @@ signal pressed signal toggled func _ready() -> void: - # Free unused children - logger.diag("<" + name + "> Freeing ToolScript") - get_child(0).queue_free() - - # Add signals - logger.diag("<" + name + "> Adding signals") - $Button.connect("button_down", func() -> void: emit_signal("down")) - $Button.connect("button_up", func() -> void: emit_signal("up")) - $Button.connect("pressed", func() -> void: emit_signal("pressed")) - $Button.connect("toggled", func(toggled_on: bool) -> void: emit_signal("toggled", toggled_on)) - -func _process(_delta: float) -> void: - if !runtime_process: return - update_element() + super() + if !in_editor(): + $Button.connect("button_down", func() -> void: emit_signal("down")) + $Button.connect("button_up", func() -> void: emit_signal("up")) + $Button.connect("pressed", func() -> void: emit_signal("pressed")) + $Button.connect("toggled", func(toggled_on: bool) -> void: emit_signal("toggled", toggled_on)) func update_element() -> void: # Update sizes diff --git a/sui/src/SuiTextButtonTool.gd b/sui/src/SuiTextButtonTool.gd deleted file mode 100644 index bb1a852..0000000 --- a/sui/src/SuiTextButtonTool.gd +++ /dev/null @@ -1,26 +0,0 @@ -@tool -extends Node - -func _process(_delta: float): - if !get_parent().editor_process: return - var parent: Control = get_parent() - var button: Button = parent.get_node("Button") - var text: RichTextLabel = parent.get_node("Text") - - # Update sizes - button.size = parent.size - text.size = parent.size - - # Update Button stuff - button.disabled = parent.disabled - button.toggle_mode = parent.toggle_mode - button.button_pressed = parent.button_pressed - - # Update RichTextLabel stuff - text.bbcode_enabled = parent.bbcode_support - text.text = parent.text - text.add_theme_font_size_override("normal_font_size", parent.font_size) - text.add_theme_font_size_override("bold_font_size", parent.font_size) - text.add_theme_font_size_override("italics_font_size", parent.font_size) - text.add_theme_font_size_override("bold_italics_font_size", parent.font_size) - text.add_theme_font_size_override("mono_font_size", parent.font_size) diff --git a/sui/src/SuiTextTool.gd b/sui/src/SuiTextTool.gd deleted file mode 100644 index 1c5a6a8..0000000 --- a/sui/src/SuiTextTool.gd +++ /dev/null @@ -1,19 +0,0 @@ -@tool -extends Node - -func _process(_delta: float): - if !get_parent().editor_process: return - var parent: Control = get_parent() - var text: RichTextLabel = parent.get_node("Text") - - # Update sizes - text.size = parent.size - - # Update RichTextLabel stuff - text.bbcode_enabled = parent.bbcode_support - text.text = parent.text - text.add_theme_font_size_override("normal_font_size", parent.font_size) - text.add_theme_font_size_override("bold_font_size", parent.font_size) - text.add_theme_font_size_override("italics_font_size", parent.font_size) - text.add_theme_font_size_override("bold_italics_font_size", parent.font_size) - text.add_theme_font_size_override("mono_font_size", parent.font_size)