Add top audio status chip

This commit is contained in:
2026-06-20 18:01:55 +09:00
parent b1884274ec
commit 1ab6a32530
2 changed files with 64 additions and 0 deletions

View File

@@ -4747,6 +4747,34 @@ func _check_hud_command_grid_layout(failures: Array[String]) -> void:
var top_toolbar := scene.end_turn_button.get_parent() as HBoxContainer
if top_toolbar == null or top_toolbar.name != "TopToolBar":
failures.append("global battle commands should move to the top icon toolbar")
if scene.top_audio_chip == null:
failures.append("top HUD should expose a compact audio status chip")
else:
if scene.top_audio_chip.get_parent() == top_toolbar:
failures.append("audio status should be a quiet HUD chip, not another global command button")
if scene.top_audio_chip.custom_minimum_size.x > 64.0 or scene.top_audio_chip.custom_minimum_size.y < 46.0:
failures.append("audio status chip should stay compact and stable: %s" % str(scene.top_audio_chip.custom_minimum_size))
var audio_tooltip := _collect_child_tooltips(scene.top_audio_chip)
if not audio_tooltip.contains("소리 상태") or not audio_tooltip.contains("현재 음악:") or not audio_tooltip.contains("효과음"):
failures.append("audio status chip should expose the current sound mix in a tooltip: %s" % audio_tooltip)
if not _has_descendant_texture(scene.top_audio_chip):
failures.append("audio status chip should use generated icon artwork")
scene._on_settings_bgm_toggled(false)
scene._on_settings_sfx_toggled(false)
if scene.top_audio_chip.modulate.a > 0.60:
failures.append("audio status chip should dim when both music and SFX are off: %s" % str(scene.top_audio_chip.modulate))
scene._on_settings_bgm_toggled(true)
scene._on_settings_sfx_toggled(true)
if scene.top_audio_chip.modulate.a < 0.90:
failures.append("audio status chip should brighten when sound is available: %s" % str(scene.top_audio_chip.modulate))
var audio_click := InputEventMouseButton.new()
audio_click.button_index = MOUSE_BUTTON_LEFT
audio_click.pressed = true
scene._hide_settings_panel()
scene._on_top_audio_chip_gui_input(audio_click)
if scene.settings_panel == null or not scene.settings_panel.visible:
failures.append("clicking the audio chip should open the in-game settings panel")
scene._hide_settings_panel()
for button in [
scene.end_turn_button,
scene.threat_button,