Improve readable story text wrapping
This commit is contained in:
@@ -740,6 +740,16 @@ func _check_text_fit_contract(scene, failures: Array[String]) -> void:
|
||||
)).split("\n")
|
||||
if compact_lines.size() > 2:
|
||||
failures.append("compact visible text should respect the requested line budget: %s" % str(compact_lines))
|
||||
var compact_single_line := str(scene._compact_visible_text(
|
||||
"영천 들판 너머의 황건 진영이 마을과 성채를 등지고 길게 늘어서 있으니 조급히 들이치지 말고 전열을 유지하라.",
|
||||
3,
|
||||
18
|
||||
))
|
||||
var compact_single_lines := compact_single_line.split("\n")
|
||||
if compact_single_lines.size() < 2:
|
||||
failures.append("long single-line text should wrap into multiple readable preview lines: %s" % compact_single_line)
|
||||
if compact_single_lines.size() > 3:
|
||||
failures.append("long single-line text should still respect the line budget: %s" % compact_single_line)
|
||||
|
||||
|
||||
func _check_command_notice_readable_preview(failures: Array[String]) -> void:
|
||||
@@ -753,6 +763,8 @@ func _check_command_notice_readable_preview(failures: Array[String]) -> void:
|
||||
notice_lines = str(scene.objective_notice_label.text).split("\n")
|
||||
if notice_lines.size() > 3:
|
||||
failures.append("long command notice should keep only title plus two readable body lines: %s" % str(notice_lines))
|
||||
if scene.objective_notice_label != null and not scene.objective_notice_label.text.contains("주의:"):
|
||||
failures.append("long command notice should keep the warning line visible beside the goal: %s" % scene.objective_notice_label.text)
|
||||
if scene.objective_notice_label != null and not scene.objective_notice_label.tooltip_text.contains("마지막 황건 잔당"):
|
||||
failures.append("long command notice should preserve the full text in its tooltip")
|
||||
scene.free()
|
||||
@@ -802,6 +814,19 @@ func _check_first_battle_rendered_text_fit(failures: Array[String]) -> void:
|
||||
scene._render_dialogue_line()
|
||||
_check_label_fits_visible_area(scene, failures, scene.dialogue_speaker_label, "opening dialogue speaker %d" % (index + 1))
|
||||
_check_label_fits_visible_area(scene, failures, scene.dialogue_text_label, "opening dialogue body %d" % (index + 1))
|
||||
var long_dialogue := "동쪽 성채의 깃발을 먼저 꺾되 북쪽 숲의 보급고를 지나치지 마라. 적이 마을을 등지고 버티면 하후돈으로 앞줄을 묶고 조조는 뒤로 돌아 마지막 황건 잔당을 끊어라."
|
||||
scene.active_dialogue_lines = scene._normalized_dialogue_lines([{"speaker": "Cao Cao", "display_speaker": "조조", "text": long_dialogue}])
|
||||
scene.active_dialogue_index = 0
|
||||
scene._render_dialogue_line()
|
||||
_check_label_fits_visible_area(scene, failures, scene.dialogue_text_label, "long tactical dialogue body")
|
||||
if scene.dialogue_text_label != null:
|
||||
var visible_dialogue_lines := str(scene.dialogue_text_label.text).split("\n")
|
||||
if visible_dialogue_lines.size() < 2:
|
||||
failures.append("long tactical dialogue should show more than a single clipped line: %s" % scene.dialogue_text_label.text)
|
||||
if visible_dialogue_lines.size() > BattleSceneScript.DIALOGUE_VISIBLE_BODY_LINES:
|
||||
failures.append("long tactical dialogue should respect visible line budget: %s" % scene.dialogue_text_label.text)
|
||||
if not scene.dialogue_text_label.tooltip_text.contains("마지막 황건 잔당"):
|
||||
failures.append("long tactical dialogue should preserve the full copy in tooltip: %s" % scene.dialogue_text_label.tooltip_text)
|
||||
scene.free()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user