Add photorealistic officer portraits

This commit is contained in:
2026-06-18 12:43:19 +09:00
parent c3a09d6577
commit 644bab582e
14 changed files with 61 additions and 7 deletions

View File

@@ -2006,9 +2006,16 @@ func _load_dialogue_portrait(portrait_path: String) -> Texture2D:
return null
if not normalized_path.begins_with("res://") and not normalized_path.begins_with("user://"):
normalized_path = "res://%s" % normalized_path
if not ResourceLoader.exists(normalized_path, "Texture2D"):
if ResourceLoader.exists(normalized_path, "Texture2D"):
var imported_texture := load(normalized_path) as Texture2D
if imported_texture != null:
return imported_texture
if not FileAccess.file_exists(normalized_path):
return null
return load(normalized_path) as Texture2D
var image := Image.new()
if image.load(normalized_path) != OK:
return null
return ImageTexture.create_from_image(image)
func _dialogue_portrait_initials(speaker: String) -> String: