Add photorealistic officer portraits
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user