Skip to content

Commit

Permalink
Visual Editor: Fix for file field (#2473)
Browse files Browse the repository at this point in the history
The file event field would cause the path to get changed to just the file name without the directory when you accidentally click on the field and click off the field without changing anything. This changes adds a check to make sure the current value and field text value aren't the same before calling _on_file_dialog_selected, or, if file_mode isn't directory open mode, that the current value as just the filename isn't the same as the field's value.
  • Loading branch information
salianifo authored Nov 11, 2024
1 parent 589658e commit 9449b48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/dialogic/Editor/Events/Fields/field_file.gd
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ func _on_field_focus_entered() -> void:
func _on_field_focus_exited() -> void:
$FocusStyle.hide()
var field_text: String = %Field.text
if current_value == field_text or (file_mode != EditorFileDialog.FILE_MODE_OPEN_DIR and current_value.get_file() == field_text):
return
_on_file_dialog_selected(field_text)

#endregion

0 comments on commit 9449b48

Please sign in to comment.