Prioritize core battle log entries
This commit is contained in:
@@ -11914,13 +11914,51 @@ func _refresh_battle_log_box() -> void:
|
||||
log_box.tooltip_text = "전투 기록\n군령과 전장 변화가 여기에 짧게 남습니다."
|
||||
return
|
||||
var visible_lines: Array[String] = []
|
||||
var start_index := maxi(0, battle_log_recent_lines.size() - BATTLE_LOG_VISIBLE_LINES)
|
||||
for index in range(start_index, battle_log_recent_lines.size()):
|
||||
visible_lines.append("· %s" % _short_preview_text(battle_log_recent_lines[index], BATTLE_LOG_VISIBLE_CHARS))
|
||||
for entry in _compact_battle_log_visible_entries():
|
||||
visible_lines.append("· %s" % _short_preview_text(str(entry), BATTLE_LOG_VISIBLE_CHARS))
|
||||
log_box.append_text(_join_strings(visible_lines, "\n"))
|
||||
log_box.tooltip_text = "전투 기록\n%s" % _join_strings(battle_log_recent_lines, "\n")
|
||||
|
||||
|
||||
func _compact_battle_log_visible_entries() -> Array[String]:
|
||||
var target_count := mini(BATTLE_LOG_VISIBLE_LINES, battle_log_recent_lines.size())
|
||||
var visible_indices: Array[int] = []
|
||||
for offset in range(battle_log_recent_lines.size()):
|
||||
var index := battle_log_recent_lines.size() - 1 - offset
|
||||
var entry := str(battle_log_recent_lines[index])
|
||||
if _is_compact_battle_log_detail_entry(entry):
|
||||
continue
|
||||
visible_indices.push_front(index)
|
||||
if visible_indices.size() >= target_count:
|
||||
break
|
||||
if visible_indices.size() < target_count:
|
||||
for offset in range(battle_log_recent_lines.size()):
|
||||
var index := battle_log_recent_lines.size() - 1 - offset
|
||||
if visible_indices.has(index):
|
||||
continue
|
||||
visible_indices.push_front(index)
|
||||
if visible_indices.size() >= target_count:
|
||||
break
|
||||
var entries: Array[String] = []
|
||||
for index in visible_indices:
|
||||
entries.append(str(battle_log_recent_lines[index]))
|
||||
return entries
|
||||
|
||||
|
||||
func _is_compact_battle_log_detail_entry(entry_text: String) -> bool:
|
||||
var normalized := entry_text.strip_edges()
|
||||
if normalized.is_empty():
|
||||
return true
|
||||
if normalized.contains("공적 +"):
|
||||
return true
|
||||
if normalized.ends_with(" 소모.") and normalized.contains("기력 "):
|
||||
return true
|
||||
for directional_token in ["후방 공격 +", "측면 공격 +", "정면 공격 +"]:
|
||||
if normalized.contains(directional_token):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _format_log_entry_text(message: String) -> String:
|
||||
if message.begins_with("Objective updated:"):
|
||||
return "군령 갱신:%s" % message.substr("Objective updated:".length())
|
||||
|
||||
Reference in New Issue
Block a user