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

Binds: Added support for "toggle_zoom" binds to trigger the radio commands menu #1699

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Added Korean translation (by @Kojap)
- Added diagnostic information to the addonchecker output.
- This also includes a Garry's Mod version check which triggers a warning if TTT2 is not compatible. First baseline version is '240313' (by @NickCloudAT)
- Added support for "toggle_zoom" binds to trigger the radio commands menu (by @TW1STaL1CKY)

### Fixed

Expand Down
11 changes: 4 additions & 7 deletions gamemodes/terrortown/gamemode/client/cl_keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,20 @@ function GM:PlayerBindPress(ply, bindName, pressed)
elseif string.sub(bindName, 1, 4) == "slot" and pressed then
local idx = tonumber(string.sub(bindName, 5, -1)) or 1

-- if radiomenu is open, override weapon select
-- If radiomenu is open, override weapon select
if RADIO.Show then
RADIO:SendCommand(idx)
else
WSWITCH:SelectSlot(idx)
end

return true
elseif bindName == "+zoom" and pressed then
-- open or close radio
elseif (bindName == "+zoom" or bindName == "toggle_zoom") and pressed then
-- Open or close radio
RADIO:ShowRadioCommands(not RADIO.Show)

return true
elseif bindName == "+voicerecord" then
-- This blocks the old Garry's Mod bind
return true
elseif bindName == "-voicerecord" then
elseif bindName == "+voicerecord" or bindName == "-voicerecord" then
-- This blocks the old Garry's Mod bind
return true
elseif bindName == "gm_showteam" and pressed and ply:IsSpec() then
Expand Down
Loading