Skip to content

Commit

Permalink
Binds: Added support for "toggle_zoom" binds to trigger the radio com…
Browse files Browse the repository at this point in the history
…mands menu (#1699)
  • Loading branch information
TW1STaL1CKY authored Dec 27, 2024
1 parent 043eee5 commit dd72a97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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

0 comments on commit dd72a97

Please sign in to comment.