From a32edb6d8cf30c2db63fa7da6400cc8fe597d2f6 Mon Sep 17 00:00:00 2001 From: WeaverSong Date: Tue, 7 May 2024 12:26:57 -0600 Subject: [PATCH] Renamed functions to include base_class to avoid potential future conflicts --- src/ui_elements/BetterLineEdit.gd | 12 ++++++------ src/ui_elements/BetterTextEdit.gd | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ui_elements/BetterLineEdit.gd b/src/ui_elements/BetterLineEdit.gd index ffbc7535..fbd4792c 100644 --- a/src/ui_elements/BetterLineEdit.gd +++ b/src/ui_elements/BetterLineEdit.gd @@ -18,9 +18,9 @@ func _init() -> void: caret_blink_interval = 0.6 func _ready() -> void: - focus_entered.connect(_on_focus_entered) - focus_exited.connect(_on_focus_exited) - mouse_exited.connect(_on_mouse_exited) + focus_entered.connect(_on_base_class_focus_entered) + focus_exited.connect(_on_base_class_focus_exited) + mouse_exited.connect(_on_base_class_mouse_exited) text_submitted.connect(_on_base_class_text_submitted) func _input(event: InputEvent) -> void: @@ -42,7 +42,7 @@ var tree_was_paused_before := false var first_click := false var text_before_focus := "" -func _on_focus_entered() -> void: +func _on_base_class_focus_entered() -> void: process_mode = PROCESS_MODE_ALWAYS tree_was_paused_before = get_tree().paused first_click = true @@ -50,7 +50,7 @@ func _on_focus_entered() -> void: if not tree_was_paused_before: get_tree().paused = true -func _on_focus_exited() -> void: +func _on_base_class_focus_exited() -> void: process_mode = PROCESS_MODE_INHERIT first_click = false if not tree_was_paused_before: @@ -64,7 +64,7 @@ func _on_base_class_text_submitted(_submitted_text) -> void: release_focus() -func _on_mouse_exited() -> void: +func _on_base_class_mouse_exited() -> void: _hovered = false queue_redraw() diff --git a/src/ui_elements/BetterTextEdit.gd b/src/ui_elements/BetterTextEdit.gd index ff902f4b..91d913d1 100644 --- a/src/ui_elements/BetterTextEdit.gd +++ b/src/ui_elements/BetterTextEdit.gd @@ -24,7 +24,7 @@ func _ready() -> void: _timer.timeout.connect(blink) get_v_scroll_bar().value_changed.connect(queue_redraw_caret.unbind(1)) get_h_scroll_bar().value_changed.connect(queue_redraw_caret.unbind(1)) - mouse_exited.connect(_on_mouse_exited) + mouse_exited.connect(_on_base_class_mouse_exited) # Workaround for there not being a built-in overtype_mode_changed signal. @@ -88,7 +88,7 @@ func _on_focus_exited() -> void: _timer.stop() RenderingServer.canvas_item_clear(_surface) -func _on_mouse_exited() -> void: +func _on_base_class_mouse_exited() -> void: _hovered = false queue_redraw()