Skip to content

Commit

Permalink
Renamed functions to include base_class to avoid potential future con…
Browse files Browse the repository at this point in the history
…flicts
  • Loading branch information
WeaverSong committed May 7, 2024
1 parent 2665d0a commit a32edb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/ui_elements/BetterLineEdit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -42,15 +42,15 @@ 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
text_before_focus = text
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:
Expand All @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions src/ui_elements/BetterTextEdit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit a32edb6

Please sign in to comment.