Skip to content

Split player HUD game and voice volume controls - #32

Open
Sythos wants to merge 4 commits into
timriker:mainfrom
Sythos:bzo-volume-ui
Open

Split player HUD game and voice volume controls#32
Sythos wants to merge 4 commits into
timriker:mainfrom
Sythos:bzo-volume-ui

Conversation

@Sythos

@Sythos Sythos commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Closes #29

Hey! This reworks the player HUD audio control into a compact two-channel volume panel.

What changed

  • Added a procedural speaker button next to the Player HUD gear.
  • The speaker button and V key toggle the volume panel, so the bars can be hidden and shown whenever needed.
  • The panel splits volume into:
    • Audio master: all Three.js gameplay/SFX audio.
    • Voice: remote nearby WebRTC playback.
  • Both sliders run from 0–100%; 0% remains the mute position, while the last non-zero level is kept as the restore value.
  • On narrow portrait screens such as a vertical phone, the toggle button moves to the bottom-left, directly above the chat/notification box. Desktop keeps the side-by-side HUD layout.

Audio scope

The master path uses the existing Three.js AudioListener and setMasterVolume(), so gameplay sounds stay on one predictable global gain. Voice remains separate and only changes the hidden remote media elements; it never changes microphone capture or voice signalling.

Both channel states are persisted in localStorage with separate keys, and invalid or blocked storage falls back safely. A dedicated Audio/Sound section inside the full settings dialog is still worth evaluating, but I kept this PR focused on the compact HUD control requested by the issue.

Validation

  • npm run check — passed, including lint, controls/docs, shared-pair checks, audio/voice tests, and the existing gameplay/render suite.
  • Browser UI checks passed at 1280×720, 390×844, 844×390, and 1080×1920: the Player HUD stays top-left, the radar stays top-right, the panel stays below Player on compact layouts, and the speaker button sits just above chat in portrait mode.
  • Verified both sliders at 0% and non-zero values, click/V visibility toggling, and a clean browser console.
  • No real WebRTC peer or hardware headset test was available locally; this PR covers the software path and responsive UI.

@Sythos

Sythos commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author
002 001

@Sythos

Sythos commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Following up on the latest IRC chat with Juest, I added a dedicated voice-playback mute toggle under the voice slider. Clicking it now crosses out the mic icon, sets voice volume to 0%, and hides the Nearby microphone HUD; clicking it again restores the saved level and brings the HUD back. The change is included in this PR.

@Sythos

Sythos commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Clicking mic icon set 0% voice plus set insivible the voice channel hud (clicking again toggle volume and also hud channel indicator)

003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Volume control

1 participant