diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index f1abf41..3f4b469 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -11,6 +11,7 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Befor - **Browser (JoyChromium)** in the session menu, pinned right under ControlFS and working the same way: [JoyChromium](https://github.com/lippdev/joychromium) (the TV browser you drive with the controller) opens full screen over the game and, if it isn't installed, the first press downloads its newest release, checks its SHA-256 and installs it. Going back to the PC while it's open takes it out of full screen and leaves it as a window, tabs and all. (#175, #181) - **Move the mouse pointer out of the way** (issue #172): when the launcher shows up on the TV, the pointer goes to the bottom-right corner of the game screen (twice, since Steam recenters it while opening) and goes back where it was when you return to the PC. On by default; turn it off in Settings or under System → When entering console mode. Based on @JarJarShinks' version in #173. (#177) - Redesigned title bar: on the Console interface the background runs up to the top edge of the window (no grey strip) and the minimize, maximize and close buttons are white, with the same soft highlight as the interface's own buttons; on the Desktop interface the icon and name are larger and the buttons fill the bar's height. (#182) +- Console interface: new sounds. Move, confirm and back use glass and "minimize" sounds from Kenney's Interface Sounds pack (CC0), and switching tabs (LB / RB) gets its own sound, a crystal tick made by the Selene theme's sound script (MIT). The sounds play only with the controller (and the keyboard): mouse clicks, in the Console interface or the session menu, no longer make a sound. (#183) ### Fixes - Custom app: Console Mode moves only the program's largest window to the game screen, instead of every window Windows reports as its main one; a tooltip is no longer stretched over the TV. (#175) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e251f0..54beb48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CH - **Navegador (JoyChromium)** no menu da sessão, fixo logo abaixo do ControlFS e funcionando do mesmo jeito: o [JoyChromium](https://github.com/lippdev/joychromium) (o navegador para a TV que se usa com o controle) abre em tela cheia por cima do jogo e, se não estiver instalado, o primeiro clique baixa a versão mais recente, confere o SHA-256 e instala. Voltar ao PC com ele aberto o tira da tela cheia e o deixa como janela, sem perder as abas. (#175, #181) - **Tirar o ponteiro do mouse do caminho** (issue #172): quando o iniciador aparece na TV, o ponteiro vai para o canto inferior direito da tela de jogo (duas vezes, porque a Steam o recentraliza ao abrir) e, ao voltar ao PC, volta para onde estava. Ligado por padrão; desligue em Ajustes ou em Sistema → Ao entrar no modo console. Baseado na versão de @JarJarShinks no #173. (#177) - Barra de título redesenhada: na interface Console, o fundo vai até a borda de cima da janela (sem a faixa cinza) e os botões de minimizar, maximizar e fechar ficam brancos, com o mesmo realce suave dos botões da interface; na interface Desktop, o ícone e o nome ficam maiores e os botões ocupam a altura toda da barra. (#182) +- Interface Console: sons novos. Mover, confirmar e voltar usam sons de vidro e de "minimizar" do pacote Interface Sounds da Kenney (CC0), e trocar de aba (LB / RB) ganhou um som próprio, um tique de cristal gerado pelo script de sons do tema Selene (MIT). Os sons tocam só com o controle (e o teclado): clicar com o mouse, na interface Console ou no menu da sessão, não faz mais som. (#183) ### Correções - Aplicativo personalizado: o Console Mode leva para a tela de jogo só a maior janela do programa, em vez de todas as que o Windows aponta como principal; uma dica de ferramenta não é mais esticada sobre a TV. (#175) diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 675b060..861dc86 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -12,6 +12,15 @@ Até a versão 1.5, o Console Mode embutia o [MultiMonitorTool](https://www.nirs |-------|------|----------------| | [Inter](https://rsms.me/inter/) 4.1 | GitHub (SIL Open Font License 1.1) | Embarcada (`src/ConsoleMode/Assets/Fonts/InterVariable.ttf`) como fonte da interface Console. A licença vai junto, em `Inter-OFL.txt` | +## Sons da interface + +Embarcados no executável (`src/ConsoleMode/Assets/Sounds`), convertidos para WAV mono de 44,1 kHz com o volume igualado. + +| Som | Origem | Licença | +|-----|--------|---------| +| `move.wav` (`glass_002`), `confirm.wav` (`confirmation_001`), `back.wav` (`minimize_008`) | [Interface Sounds](https://kenney.nl/assets/interface-sounds), da Kenney | CC0 1.0 (domínio público; crédito opcional) | +| `tab.wav` (`cursor_c`) | Gerado pelo [`tools/make_sounds.py`](https://github.com/mattxslv/Selene/blob/main/tools/make_sounds.py) do [Selene](https://github.com/mattxslv/Selene), de Matthew Silva (mattxslv): síntese pura, sem amostras | MIT, Copyright (c) 2026 Matthew Silva | + ## Limite de FPS (opcional) | Ferramenta | Site | Uso no projeto | diff --git a/docs/TESTING.md b/docs/TESTING.md index 60898c2..3e3041b 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -80,7 +80,10 @@ Pré-condições: interface Console ativa (Ajustes → Interface → Console, ou ### Sons -- [ ] Há um som ao mover o foco, outro ao confirmar (A ou clique) e outro ao voltar (B); trocar de aba toca o de mover. Resultado: ______ +- [ ] Há um som ao mover o foco, outro ao confirmar (A ou clique) e outro ao voltar (B). Resultado: ______ +- [ ] Trocar de aba com LB / RB (ou Page Up / Page Down) toca um som próprio, diferente do de mover. Resultado: ______ +- [ ] Clicar com o mouse (numa aba, num bloco, num botão, numa linha de Sistema ou no menu da sessão) não faz som nenhum; o mesmo botão apertado pelo controle faz. Resultado: ______ +- [ ] Os sons novos (vidro ao mover, confirmação, "minimizar" ao voltar e o cursor do Selene na aba) saem no mesmo volume, sem estalo no começo ou no fim. Resultado: ______ - [ ] Sistema/Ajustes → "Sons da interface" desligado: silêncio total. Resultado: ______ - [ ] Segurar o direcional não acumula sons (um novo interrompe o anterior). Resultado: ______ diff --git a/src/ConsoleMode/Assets/Sounds/back.wav b/src/ConsoleMode/Assets/Sounds/back.wav new file mode 100644 index 0000000..1ca80cb Binary files /dev/null and b/src/ConsoleMode/Assets/Sounds/back.wav differ diff --git a/src/ConsoleMode/Assets/Sounds/confirm.wav b/src/ConsoleMode/Assets/Sounds/confirm.wav new file mode 100644 index 0000000..9ade5e6 Binary files /dev/null and b/src/ConsoleMode/Assets/Sounds/confirm.wav differ diff --git a/src/ConsoleMode/Assets/Sounds/move.wav b/src/ConsoleMode/Assets/Sounds/move.wav new file mode 100644 index 0000000..1366ef5 Binary files /dev/null and b/src/ConsoleMode/Assets/Sounds/move.wav differ diff --git a/src/ConsoleMode/Assets/Sounds/tab.wav b/src/ConsoleMode/Assets/Sounds/tab.wav new file mode 100644 index 0000000..2823969 Binary files /dev/null and b/src/ConsoleMode/Assets/Sounds/tab.wav differ diff --git a/src/ConsoleMode/ConsoleMode.csproj b/src/ConsoleMode/ConsoleMode.csproj index 3386ba4..415d5be 100644 --- a/src/ConsoleMode/ConsoleMode.csproj +++ b/src/ConsoleMode/ConsoleMode.csproj @@ -39,6 +39,7 @@ + diff --git a/src/ConsoleMode/Services/UiSoundSynth.cs b/src/ConsoleMode/Services/UiSoundSynth.cs index 55aa08e..63ad184 100644 --- a/src/ConsoleMode/Services/UiSoundSynth.cs +++ b/src/ConsoleMode/Services/UiSoundSynth.cs @@ -8,7 +8,9 @@ public enum UiSound /// Something was picked, opened or switched. Confirm, /// Went back or closed a panel. - Back + Back, + /// Switched to another tab of the console interface (LB / RB, or a click on a tab). + Tab } /// @@ -26,6 +28,7 @@ public static class UiSoundSynth private static Note[] Notes(UiSound sound) => sound switch { UiSound.Move => [new(1150, 1000, 45, 0.30)], + UiSound.Tab => [new(980, 1180, 55, 0.30)], UiSound.Confirm => [new(740, 740, 55, 0.32), new(1110, 1110, 95, 0.34)], _ => [new(820, 820, 50, 0.30), new(560, 540, 85, 0.30)] }; diff --git a/src/ConsoleMode/Services/UiSounds.cs b/src/ConsoleMode/Services/UiSounds.cs index 9948db6..0fedf21 100644 --- a/src/ConsoleMode/Services/UiSounds.cs +++ b/src/ConsoleMode/Services/UiSounds.cs @@ -3,7 +3,7 @@ namespace ConsoleMode.Services; /// -/// Plays the console interface sounds (see ) from memory through +/// Plays the console interface sounds (the ones shipped in Assets\Sounds, else ) from memory through /// winmm's PlaySound. Fire and forget: a new sound cuts the one still playing, and one that can't /// play (no audio device, a driver error) is skipped, never an error for the user. /// @@ -27,7 +27,7 @@ public static void Play(UiSound sound) { if (!Buffers.TryGetValue(sound, out var handle)) { - handle = GCHandle.Alloc(UiSoundSynth.Wav(sound), GCHandleType.Pinned); + handle = GCHandle.Alloc(Embedded(sound) ?? UiSoundSynth.Wav(sound), GCHandleType.Pinned); Buffers[sound] = handle; } // A new sound replaces the one playing, so quick moves keep up. @@ -40,6 +40,20 @@ public static void Play(UiSound sound) } } + /// + /// The sound shipped with the app (Assets\Sounds: Kenney's CC0 "Interface Sounds" and a tick made by the Selene + /// theme's MIT sound script, see THIRD_PARTY_NOTICES.md), or null when it isn't there: the synthesized one plays instead. + /// + private static byte[]? Embedded(UiSound sound) + { + var name = $"ConsoleMode.Assets.Sounds.{sound.ToString().ToLowerInvariant()}.wav"; + using var stream = typeof(UiSounds).Assembly.GetManifestResourceStream(name); + if (stream is null) return null; + using var copy = new MemoryStream(); + stream.CopyTo(copy); + return copy.ToArray(); + } + [DllImport("winmm.dll", EntryPoint = "PlaySoundW")] private static extern bool PlaySound(nint sound, nint module, uint flags); } diff --git a/src/ConsoleMode/SessionMenuWindow.xaml.cs b/src/ConsoleMode/SessionMenuWindow.xaml.cs index 7d807c7..562aa64 100644 --- a/src/ConsoleMode/SessionMenuWindow.xaml.cs +++ b/src/ConsoleMode/SessionMenuWindow.xaml.cs @@ -213,8 +213,7 @@ public SessionMenuWindow(MainViewModel viewModel, ScreenRect? target) card.StartBringIntoView(); }; Root.LostFocus += (_, e) => ScaleFocused(e.OriginalSource, grow: false); - // Mouse clicks sound like a confirm (the pad has its own sounds in the navigator). - Root.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler(OnPointerPressed), true); + // The sounds are the pad's (the navigator): mouse clicks stay silent. ViewModel.PropertyChanged += OnViewModelChanged; ViewModel.SessionPickerRefocus += FocusPickerSelection; @@ -450,18 +449,6 @@ private static void ScaleFocused(object source, bool grow) } } - private void OnPointerPressed(object sender, PointerRoutedEventArgs e) - { - for (var node = e.OriginalSource as DependencyObject; node is not null; node = VisualTreeHelper.GetParent(node)) - { - if (node is ButtonBase { IsEnabled: true }) - { - UiSounds.Play(UiSound.Confirm); - return; - } - } - } - // ── Guided tour ────────────────────────────────────────────────────────────────────────── private const double TourHolePadding = 6; diff --git a/src/ConsoleMode/Views/ConsoleHomeView.xaml.cs b/src/ConsoleMode/Views/ConsoleHomeView.xaml.cs index 023dadd..b8a05c4 100644 --- a/src/ConsoleMode/Views/ConsoleHomeView.xaml.cs +++ b/src/ConsoleMode/Views/ConsoleHomeView.xaml.cs @@ -44,8 +44,7 @@ public ConsoleHomeView() SettingsRows.GotFocus += (_, e) => { if (e.OriginalSource is Control row) _lastSettingsRow = row; }; CategoryRail.GettingFocus += OnRailGettingFocus; CategoryRail.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler((_, _) => _railPointerPressedAt = Environment.TickCount64), true); - // Mouse clicks on buttons sound like a confirm (the pad has its own sounds in the navigator). - Root.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler(OnPointerPressed), true); + // The sounds are the pad's (GamepadNavigator, LB / RB): mouse clicks stay silent. ViewModel.PropertyChanged += OnViewModelChanged; ViewModel.PickBackgroundImageRequested += () => _ = PickBackgroundImageAsync(); } @@ -289,7 +288,7 @@ private void AnimateTab(int from, int to) private void StepTab(int step) { if (ViewModel.IsConsoleActive || ViewModel.IsRolePanelOpen || ViewModel.IsPickerOpen || ViewModel.IsShortcutEditorOpen || ViewModel.IsConsoleTutorialOpen || ViewModel.IsControllerTestOpen) return; - if (ViewModel.StepConsoleTab(step)) UiSounds.Play(UiSound.Move); + if (ViewModel.StepConsoleTab(step)) UiSounds.Play(UiSound.Tab); } private void GoBack() @@ -427,18 +426,6 @@ private static void ScaleTile(object source, float scale) button.Scale = new Vector3(scale, scale, 1); } - private void OnPointerPressed(object sender, PointerRoutedEventArgs e) - { - for (var node = e.OriginalSource as DependencyObject; node is not null; node = Microsoft.UI.Xaml.Media.VisualTreeHelper.GetParent(node)) - { - if (node is Microsoft.UI.Xaml.Controls.Primitives.ButtonBase { IsEnabled: true }) - { - UiSounds.Play(UiSound.Confirm); - return; - } - } - } - private static Microsoft.UI.Xaml.Input.FocusNavigationDirection? Arrow(VirtualKey key) => key switch { VirtualKey.Up => Microsoft.UI.Xaml.Input.FocusNavigationDirection.Up,