local g_master_switch = ui.checkbox( 'RAGE', 'Other', 'Immediate teleport' )
local g_quick_peek, g_quick_peek_key = ui.reference( 'RAGE', 'Other', 'Quick peek assist' )
local g_shot_someone = false
local g_setup_command = function( cmd )
if g_shot_someone then
cmd.discharge_pending = true
g_shot_someone = false
end
end
local g_aim_fire = function( )
g_shot_someone = ui.get( g_quick_peek ) and ui.get( g_quick_peek_key )
end
local g_ui_callback = function( )
local fn = ui.get( g_master_switch ) and client.set_event_callback or client.unset_event_callback
fn( 'setup_command', g_setup_command )
fn( 'aim_fire', g_aim_fire )
end
ui.set_callback( g_master_switch, g_ui_callback )
g_ui_callback( )