From 97c21ea044da03f872e93114181b6521c7d98d19 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Sun, 21 Aug 2016 12:21:00 +0200 Subject: [PATCH] new keybind to scroll the console by mousewheel (for now) by default bound to the '#'-key (and backslash) Press and hold the '#'-key and scroll the wheel to scroll console. Just pressing and releasing '#' resets the console position. Without the console open, releasing '#' always resets the console position. --- config/resetbinds.cfg | 7 ++++--- config/scripts.cfg | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config/resetbinds.cfg b/config/resetbinds.cfg index 20611601..9c9aaf5e 100644 --- a/config/resetbinds.cfg +++ b/config/resetbinds.cfg @@ -8,10 +8,11 @@ persistidents 0 alias key_console_end [ conskip -1000 ] alias key_console_forward [ conskip -5 ] alias key_console_rewind [ conskip 5 ] +alias key_console_scroll [ if (strcmp $modifier 0) [ tempalias __confade $confade ] ; onrelease "confade $__confade ; if (! $__scrolled) [ conskip -1000 ]" ; confade 0 ; tempalias __scrolled 0 ; domodifier conscroll ] alias key_demo_gamespeeddown [ if (watchingdemo) [ if (<= $gamespeed 100) [ gamespeed (- $gamespeed 10) ] [ gamespeed (- $gamespeed 100) ]; gamespeed ] ] alias key_demo_gamespeedup [ if (watchingdemo) [ if (< $gamespeed 100) [ gamespeed (+ $gamespeed 10) ] [ gamespeed (+ $gamespeed 100) ]; gamespeed ] ] alias key_demo_gamespeedreset [ if (watchingdemo) [ gamespeed 100; gamespeed ] ] -alias key_demo_togglespeed [ if (watchingdemo) [ tempalias tmp_gamespeed $gamespeed; gamespeed 1000; onrelease [ gamespeed $tmp_gamespeed ] ] ] +alias key_demo_togglespeed [ if (watchingdemo) [ onrelease (concat gamespeed $gamespeed) ; gamespeed 1000 ] ] alias key_domodifier_1 [ domodifier 1 ] alias key_domodifier_2 [ domodifier 2 ] alias key_escape [ if $connected [ ingamemenu ] [ if (watchingdemo) [ showmenu [Watching demo] ] [ showmenu main ] ] ] @@ -47,7 +48,7 @@ bind ESCAPE key_escape bind SPACE jump bind EXCLAIM [] bind QUOTEDBL [] -bind HASH [] +bind HASH key_console_scroll bind DOLLAR [] bind AMPERSAND [] bind QUOTE [] @@ -93,7 +94,7 @@ bind QUESTION [] bind AT [] bind LEFTBRACKET [] editbind LEFTBRACKET [ editheight 0 -1 ] -bind BACKSLASH [] +bind BACKSLASH key_console_scroll bind RIGHTBRACKET [] editbind RIGHTBRACKET [ editheight 0 1 ] bind CARET key_commandline diff --git a/config/scripts.cfg b/config/scripts.cfg index fd660b1d..74b3cf52 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -238,6 +238,11 @@ delta_edit_attr5 = [ entproperty 4 $arg2 $editmeta2down ] // Changes the fifth delta_edit_attr6 = [ entproperty 5 $arg2 $editmeta2down ] // Changes the sixth value on entities... delta_edit_attr7 = [ entproperty 6 $arg2 $editmeta2down ] // Changes the seventh value on entities... +// Scroll console (in all modes) +delta_game_conscroll = [ __scrolled = $conopen ; conskip (* 4 $arg1) ] +delta_spect_conscroll = $delta_game_conscroll +delta_edit_conscroll = $delta_game_conscroll + // HUD toggles const toggleshowmap [ showmap 1; onrelease [ showmap 0 ] ]