From 80dfe4e0d0021005aaf098120e62e1a82ef58c7c Mon Sep 17 00:00:00 2001 From: Seter <86374920+skkuull@users.noreply.github.com> Date: Sun, 22 Jan 2023 23:34:28 +0300 Subject: [PATCH 1/2] console: matches changes --- src/client/component/game_console.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index 24e28483..c311ba7d 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -278,10 +278,10 @@ namespace game_console if (matches.size() > 24) { draw_hint_box(1, dvars::con_inputHintBoxColor->current.vector); - draw_hint_text(0, utils::string::va("%i matches (too many to show here). Press SHIFT + TAB to show more", matches.size()), + draw_hint_text(0, utils::string::va("%i matches (too many to show here. Press shift+tilde to open full console)", matches.size()), dvars::con_inputDvarMatchColor->current.vector); - if (game::playerKeys[0].keys[game::keyNum_t::K_SHIFT].down && game::playerKeys[0].keys[game::keyNum_t::K_TAB].down) + if (GetAsyncKeyState(VK_TAB) & 1) { console::info("]%s\n", con.buffer); for (size_t i = 0; i < matches.size(); i++) From 83deb552fec3f832bde94bc1c61c1e9032c48cba Mon Sep 17 00:00:00 2001 From: Seter <86374920+skkuull@users.noreply.github.com> Date: Sun, 29 Jan 2023 04:10:20 +0300 Subject: [PATCH 2/2] fix console tab Co-Authored-By: fed <58637860+fedddddd@users.noreply.github.com> --- src/client/component/game_console.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index c311ba7d..8fb8aa3e 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -278,17 +278,8 @@ namespace game_console if (matches.size() > 24) { draw_hint_box(1, dvars::con_inputHintBoxColor->current.vector); - draw_hint_text(0, utils::string::va("%i matches (too many to show here. Press shift+tilde to open full console)", matches.size()), + draw_hint_text(0, utils::string::va("%i matches (too many to show here. press shift+tilde to open full console, press tab to print all matches)", matches.size()), dvars::con_inputDvarMatchColor->current.vector); - - if (GetAsyncKeyState(VK_TAB) & 1) - { - console::info("]%s\n", con.buffer); - for (size_t i = 0; i < matches.size(); i++) - { - console::info("\t%s\n", matches[i].data()); - } - } } else if (matches.size() == 1) { @@ -721,6 +712,15 @@ namespace game_console clear(); } + + if (key == game::keyNum_t::K_TAB && std::strlen(con.buffer) >= 2 && matches.size() > 24) + { + console::info("]%s\n", con.buffer); + for (const auto& match : matches) + { + console::info("\t%s\n", match.data()); + } + } } }