Add subtitle UI for voice playback

This commit is contained in:
2026-05-16 21:33:00 +01:00
parent 58050abded
commit 3174079e37
81 changed files with 8657 additions and 1231 deletions

View File

@@ -147,6 +147,7 @@ namespace BriarQueen.UI.Menus
// ── IUIWindow ─────────────────────────────────────────────────
public bool IsModal => true;
public WindowType WindowType => WindowType.SettingsWindow;
public UIPauseBehavior PauseBehavior => UIPauseBehavior.TreatAsBackRequest;
// ── Unity lifecycle ───────────────────────────────────────────
private void Awake()
@@ -155,9 +156,9 @@ namespace BriarQueen.UI.Menus
if (_backButton != null) _backButton.onClick.AddListener(OnBackClicked);
// Individual buttons drive panel switching via SelectionRequested
if (_gameCategoryButton != null) _gameCategoryButton.SelectionRequested += _ => SwitchCategory(Category.Game);
if (_visualCategoryButton != null) _visualCategoryButton.SelectionRequested += _ => SwitchCategory(Category.Visual);
if (_audioCategoryButton != null) _audioCategoryButton.SelectionRequested += _ => SwitchCategory(Category.Audio);
if (_gameCategoryButton != null) _gameCategoryButton.SelectionRequested += OnGameCategorySelected;
if (_visualCategoryButton != null) _visualCategoryButton.SelectionRequested += OnVisualCategorySelected;
if (_audioCategoryButton != null) _audioCategoryButton.SelectionRequested += OnAudioCategorySelected;
HookSlider(_masterVolumeSlider, _masterVolumeText, v => _draftAudio.MasterVolume = v);
HookSlider(_musicVolumeSlider, _musicVolumeText, v => _draftAudio.MusicVolume = v);
@@ -210,9 +211,9 @@ namespace BriarQueen.UI.Menus
if (_applyButton != null) _applyButton.onClick.RemoveListener(OnApplyClicked);
if (_backButton != null) _backButton.onClick.RemoveListener(OnBackClicked);
if (_gameCategoryButton != null) _gameCategoryButton.SelectionRequested -= _ => SwitchCategory(Category.Game);
if (_visualCategoryButton != null) _visualCategoryButton.SelectionRequested -= _ => SwitchCategory(Category.Visual);
if (_audioCategoryButton != null) _audioCategoryButton.SelectionRequested -= _ => SwitchCategory(Category.Audio);
if (_gameCategoryButton != null) _gameCategoryButton.SelectionRequested -= OnGameCategorySelected;
if (_visualCategoryButton != null) _visualCategoryButton.SelectionRequested -= OnVisualCategorySelected;
if (_audioCategoryButton != null) _audioCategoryButton.SelectionRequested -= OnAudioCategorySelected;
if (_popupDisplayDurationSlider != null)
_popupDisplayDurationSlider.onValueChanged.RemoveListener(OnPopupDisplayDurationChanged);
@@ -246,7 +247,7 @@ namespace BriarQueen.UI.Menus
StopAndResetCancellation();
gameObject.SetActive(true);
TryRegisterRaycaster();
EnsureExclusiveRaycaster();
_canvasGroup.alpha = 1f;
_canvasGroup.blocksRaycasts = false;
@@ -368,6 +369,21 @@ namespace BriarQueen.UI.Menus
return true;
}
private void OnGameCategorySelected(AnimatedSelectionButton _)
{
SwitchCategory(Category.Game);
}
private void OnVisualCategorySelected(AnimatedSelectionButton _)
{
SwitchCategory(Category.Visual);
}
private void OnAudioCategorySelected(AnimatedSelectionButton _)
{
SwitchCategory(Category.Audio);
}
// ── Category switching ────────────────────────────────────────
private void SwitchCategory(Category category)
@@ -909,17 +925,18 @@ namespace BriarQueen.UI.Menus
};
}
private void TryRegisterRaycaster()
private void EnsureExclusiveRaycaster()
{
if (_raycasterRegistered)
return;
if (_interactManager == null || _graphicRaycaster == null)
return;
_interactManager.AddUIRaycaster(_graphicRaycaster);
if (!_raycasterRegistered)
{
_interactManager.AddUIRaycaster(_graphicRaycaster);
_raycasterRegistered = true;
}
_interactManager.SetExclusiveRaycaster(_graphicRaycaster);
_raycasterRegistered = true;
}
private void TryUnregisterRaycaster()
@@ -931,7 +948,7 @@ namespace BriarQueen.UI.Menus
return;
_interactManager.RemoveUIRaycaster(_graphicRaycaster);
_interactManager.ClearExclusiveRaycaster();
_interactManager.ReleaseExclusiveRaycaster(_graphicRaycaster);
_raycasterRegistered = false;
}
}