I was going to mention that there's a keybind for music, but they specifically mentioned they wanted to click something.
Also, the default ctrl+s turns off Sound Effects, Ambience, and Dialog, but OP just wanted a Dialog toggle. Below is the function that runs when using the sounds keybind:
Code:
function Sound_ToggleSound()
if ( GetCVar("Sound_EnableAllSound") == "0" ) then
ActionStatus:DisplayMessage(SOUND_DISABLED);
else
if ( GetCVar("Sound_EnableSFX") == "0" ) then
SetCVar("Sound_EnableSFX", 1);
SetCVar("Sound_EnableAmbience", 1);
SetCVar("Sound_EnableDialog", 1);
ActionStatus:DisplayMessage(SOUND_EFFECTS_ENABLED);
else
SetCVar("Sound_EnableSFX", 0);
SetCVar("Sound_EnableAmbience", 0);
SetCVar("Sound_EnableDialog", 0);
ActionStatus:DisplayMessage(SOUND_EFFECTS_DISABLED);
end
end
end