Code formatted using GDQuest's formatter
This commit is contained in:
1 parent
fefb1a5bf0
commit
3ec4b5786f
15 files changed
+201
-146
No files matched your search
@@ -6,7 +6,9 @@ extends VBoxContainer
|
||||
|
||||
const SCREENSHOT_PREVIEW = preload("res://addons/screenshots/debugger/bottom_panel/screenshot_preview/screenshot_preview.tscn")
|
||||
|
||||
var roll_directory : String
|
||||
var roll_directory: String
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
%RollPanelContainer.add_theme_stylebox_override("panel", get_theme_stylebox("panel", "ItemListSecondary"))
|
||||
%CameraRollIcon.texture = get_theme_icon("CameraTexture", "EditorIcons")
|
||||
@@ -15,33 +17,36 @@ func _ready() -> void:
|
||||
local_data.settings.value_changed.connect(_on_local_data_changed)
|
||||
%DirectoryWatcher.files_deleted.connect(_on_files_deleted)
|
||||
|
||||
|
||||
func _on_files_deleted(files: PackedStringArray) -> void:
|
||||
for file in files:
|
||||
for preview in previews_container.get_children():
|
||||
if ProjectSettings.globalize_path(preview.path) == ProjectSettings.localize_path(file):
|
||||
preview.queue_free()
|
||||
|
||||
|
||||
func _on_local_data_changed(section: String, key: String, new_value) -> void:
|
||||
if not key == "PathLineEdit":
|
||||
return
|
||||
|
||||
|
||||
%DirectoryWatcher.remove_scan_directory(roll_directory)
|
||||
roll_directory = new_value
|
||||
%DirectoryWatcher.add_scan_directory(roll_directory)
|
||||
|
||||
|
||||
|
||||
|
||||
func add_preview(file_path: String, timestamp: String, locale: String) -> void:
|
||||
var s = SCREENSHOT_PREVIEW.instantiate()
|
||||
var image = Image.load_from_file(file_path)
|
||||
var texture = ImageTexture.create_from_image(image)
|
||||
s.texture = texture
|
||||
|
||||
|
||||
s.path = file_path
|
||||
s.locale = locale
|
||||
previews_container.add_child(s)
|
||||
|
||||
|
||||
|
||||
func get_all_previews_paths() -> Array[String]:
|
||||
var arr : Array[String] = []
|
||||
var arr: Array[String] = []
|
||||
for preview in previews_container.get_children():
|
||||
arr.append(preview.path)
|
||||
return arr
|
||||
Reference in new issue
Block a user