Add dialogue portrait side placement

This commit is contained in:
2026-06-18 03:55:46 +09:00
parent b280632852
commit b8378d9144
8 changed files with 54 additions and 17 deletions

View File

@@ -2487,7 +2487,7 @@ func _normalize_dialogue_line(line) -> Dictionary:
var text := str(line)
if text.is_empty():
return {}
return {"speaker": "", "text": text, "portrait": ""}
return {"speaker": "", "text": text, "portrait": "", "side": "left"}
if typeof(line) == TYPE_DICTIONARY:
var text := str(line.get("text", ""))
if text.is_empty():
@@ -2499,11 +2499,19 @@ func _normalize_dialogue_line(line) -> Dictionary:
return {
"speaker": speaker,
"text": text,
"portrait": portrait
"portrait": portrait,
"side": _normalize_dialogue_side(line.get("side", "left"))
}
return {}
func _normalize_dialogue_side(value) -> String:
var side := str(value).strip_edges().to_lower()
if side == "right":
return "right"
return "left"
func _spawn_event_deployment(deployment) -> bool:
if typeof(deployment) != TYPE_DICTIONARY:
push_error("Skipping malformed event deployment in %s." % battle_id)