1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151

//----------------------------------------------------------------------------

// volume.cfg

// Team Fortress 2 volume control binds

//

// sixx, march 2019

//

// Key binds for quick control of game and voice

// volume levels. Includes voice mute and a bind

// to show / hide text chat stream.

//

// This script requires a console reset script.

// Save the following code as reset_console.cfg:

// con_filter_text ""

//

//

// // CONTROLS

//

// Decrease, Increase game volume:

// <RALT> + < - > , < = >

//

// Decrease, Increase voice volume:

// <RALT> + < [ > , < ] >

//

// Mute / unmute voice chat:

// <RALT> + < \ >

//

// Show / hide text chat:

// <RALT> + < o >

//

//

// // SETTINGS

//

// Keys bound by script: RALT - = [ ] \ o

//

// If you have these keys bound already, copy

// your existing binds to the following lines:

// [key] [line]

// RALT n/a

// - 90 # game default preset

// = 98

// [ 113

// ] 122

// \ 135

// o 144

//

// Set default voice master volume on line 136,

// script default is 0.70.

// Set default chat lines on line 146,

// script default is 10.

// Set display fade on line 72,

// script default is 250.

//

// Set default con_filter_text in reset_console.cfg

//

//----------------------------------------------------------------------------



echo "-> volume.cfg"



con_filter_enable 1



//---------------------------------------------

// Right Alt [RAlt] modifier key for volume

//---------------------------------------------

alias +ralt_vol "+vol_display; +vol_game; +vol_voice; +vol_voice_tgl; +alt_o"

alias -ralt_vol "-alt_o; -vol_game; -vol_voice; -vol_voice_tgl; -vol_display"



bind "RALT" "+ralt_vol"



// display new volume values after change. fade after delay

// display isn't perfect

alias +vol_display "developer 1; con_filter_text e = "

alias -vol_display "wait 250; developer 0; exec reset_console.cfg" // LINE 72

// reset_console.cfg ::

// con_filter_text ""



//--------------------

// Game master volume

//--------------------

alias +vol_game "+alt_dash; alias vol_g_inc vol_g_i1"

alias -vol_game "-alt_dash; alias vol_g_inc vol_g_i0"



//----------

// decrease game volume

// RAlt + -

//----------

alias vol_g_dec "incrementvar volume 0 1 -0.05"



alias +alt_dash "bind - vol_g_dec"

// disguiseteam must be bound directly to work

alias -alt_dash "bind - disguiseteam" // LINE 90



//----------

// increase game volume

// RAlt + =

//----------

bind "=" "vol_g_inc"

alias vol_g_inc // null

alias vol_g_i0 // LINE 98

alias vol_g_i1 "incrementvar volume 0 1 0.05"



//--------------------

// Voice volume

//--------------------

alias +vol_voice "alias vol_v_dec vol_v_d1; alias vol_v_inc vol_v_i1"

alias -vol_voice "alias vol_v_dec vol_v_d0; alias vol_v_inc vol_v_i0"



//----------

// decrease voice volume

// RAlt + [

//----------

bind "[" "vol_v_dec"

alias vol_v_dec // null

alias vol_v_d0 // LINE 113

alias vol_v_d1 "incrementvar voice_scale 0 1 -0.05"



//----------

// increase voice volume

// RAlt + ]

//----------

bind "]" "vol_v_inc"

alias vol_v_inc // null

alias vol_v_i0 // LINE 122

alias vol_v_i1 "incrementvar voice_scale 0 1 0.05"



//--------------------

// toggle voice on, off (mute)

// RAlt + \

//--------------------

alias +vol_voice_tgl "alias vol_v_tgl vol_v_t1"

alias -vol_voice_tgl "alias vol_v_tgl vol_v_t0"



//----------

bind "\" "vol_v_tgl"

alias vol_v_tgl // null

alias vol_v_t0 // LINE 135

alias vol_v_t1 "toggle voice_scale 0.000000 0.70; vol_v_td" // LINE 136

alias vol_v_td "incrementvar voice_scale 0 1 0" // rounding



//--------------------

// show / hide chat

// RAlt + o

//--------------------

alias +alt_o "bind o alt_o_0"

alias -alt_o "unbind o" // LINE 144



alias alt_o_0 "toggle hud_saytext_time 0 10" // LINE 146



//--------------------

// set / reset default binds

//--------------------

-ralt_vol