Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voice: Reworked HUD #1473

Merged
merged 28 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7380cf3
added fake spectrometer
TimGoll Mar 8, 2024
6c7f9b2
Merge branch 'master' into voice-UI
TimGoll Mar 9, 2024
3edd9a7
cleaned up code; suports multiple players speaking
TimGoll Mar 9, 2024
69ca320
always render local player first
TimGoll Mar 9, 2024
50920b8
added docs
TimGoll Mar 9, 2024
b982868
removed old voice HUD overwrite
TimGoll Mar 9, 2024
166c791
Update CHANGELOG.md
TimGoll Mar 9, 2024
3c01092
Merge branch 'master' into voice-UI
TimGoll Mar 31, 2024
6456f9b
spec color; fixed speaker voice name in UI
TimGoll Mar 31, 2024
dcf1f79
voice UI tweaks
TimGoll Mar 31, 2024
d927fdf
Merge branch 'master' into voice-UI
TimGoll Apr 12, 2024
9f747a9
elliptic nick
TimGoll Apr 12, 2024
a7210d8
cached colors; line thickness scaling
TimGoll Apr 12, 2024
2470778
removed basecolor
TimGoll Apr 12, 2024
2c60ca7
removed outdated todo
TimGoll Apr 12, 2024
1b967ca
removed unused variable
TimGoll Apr 12, 2024
5fcd4f4
renamed voice spectrum function
TimGoll Apr 12, 2024
86881f4
voice color supports team changes now
TimGoll Apr 12, 2024
deca9f9
style and linting
TimGoll Apr 12, 2024
cad99bb
linter errors
TimGoll Apr 12, 2024
ba332b3
Update gamemodes/terrortown/gamemode/client/cl_voice.lua
TimGoll Apr 15, 2024
4c159a2
fixed voice chat mode setting
TimGoll Apr 20, 2024
5386e3b
changed loading order
TimGoll Apr 22, 2024
0f5924f
removed select
TimGoll Apr 24, 2024
d7c102a
prevent error on connect
TimGoll Apr 25, 2024
bf56c16
Update CHANGELOG.md
TimGoll May 11, 2024
151af9c
removed basecolor
TimGoll May 13, 2024
2d81c70
Merge branch 'master' into voice-UI
TimGoll May 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Added sounds to multiple UI interactions (can be disabled in settings: Gameplay > Client-Sounds)
- Added a globally audible sound when searching a body
- Added the option to add a subtitle to a marker vision element
- Added a new voice chat UI (by @TimGoll)
- Added `TTT2CanTakeCredits` hook for overriding whether a player is allowed to take credits from a given corpse. (by @Spanospy)
- Disabled locational voice during the preparing phase by default
- Added a ConVar `ttt_locational_voice_prep` to reenable it
Expand Down Expand Up @@ -70,6 +71,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel

### Breaking Changes

- Renamed `TTT2ModifyVoiceChatColor(ply, clr)` to `TTT2ModifyVoiceChatMode(ply, mode)`
- Renamed `ply:GetHeightVector()` to `ply:GetHeadPosition()`

## [v0.13.1b](https://github.com/TTT-2/TTT2/tree/v0.13.1b) (2024-02-27)
Expand Down
11 changes: 0 additions & 11 deletions gamemodes/terrortown/gamemode/client/cl_hud_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,6 @@ function GM:HUDPaint()
if hook.Run("HUDShouldDraw", "TTTRadar") then
RADAR:Draw(client)
end

if not client:Alive() or client:Team() == TEAM_SPEC then
return
end

---
-- @realm client
-- stylua: ignore
if hook.Run("HUDShouldDraw", "TTTVoice") then
VOICE.Draw(client)
end
end

---
Expand Down
2 changes: 1 addition & 1 deletion gamemodes/terrortown/gamemode/client/cl_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ ttt_include("cl_equip")
ttt_include("cl_shopeditor")
ttt_include("cl_chat")
ttt_include("cl_radio")
ttt_include("cl_voice")
ttt_include("cl_inventory")
ttt_include("cl_status")
ttt_include("cl_player_ext")
ttt_include("cl_voice")

ttt_include("cl_armor")
ttt_include("cl_damage_indicator")
Expand Down
15 changes: 15 additions & 0 deletions gamemodes/terrortown/gamemode/client/cl_player_ext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,21 @@ function plymeta:AnimUpdateGesture()
end

---
-- Enables that the player is currently speaking in voice. This state is used for the voice UI.
-- @param boolean state The speaking state
-- @realm client
function plymeta:SetSpeakingInVoice(state)
self.speaking = state
end

---
-- Returns if the player is currently speaking in voice. This state is used for the voice UI.
-- @return boolean The speaking state
-- @realm client
function plymeta:IsSpeakingInVoice()
return self.speaking or false
end

-- Creates an elliptic nick for a given length.
-- @param number width The maximum width that should be used to limit the nick
-- @param[default="DefaultBold"] string font The font ID
Expand Down