Skip to content

Commit

Permalink
[licenses] Detect movement of licenses json file
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Feb 21, 2024
1 parent 02e30b6 commit 0794b8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ License class.

### Changelog

#### 1.7.8

- Detect movement of licenses json file

#### 1.7.7

- Use absolute paths in preloads
Expand Down
6 changes: 6 additions & 0 deletions addons/licenses/internal/licenses.gd
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func _ready() -> void:
self._components.components_changed.connect(self._on_components_changed)
if Engine.is_editor_hint():
self._file_watcher = FileSystemWatcher.new(self._components)
EditorInterface.get_file_system_dock().files_moved.connect(self._on_file_moved)

func reload() -> void:
self._update_set_license_filepath_button()
Expand Down Expand Up @@ -135,3 +136,8 @@ func _on_components_changed() -> void:

func _emit_changed():
self._components.emit_changed()

func _on_file_moved(old_file: String, new_file: String) -> void:
if old_file == Licenses.get_license_data_filepath():
Licenses.set_license_data_filepath(new_file)
self._license_file_edit.text = Licenses.get_license_data_filepath()

0 comments on commit 0794b8f

Please sign in to comment.