From 2da040d197823a81b75e264f3eef47d0361ea21d Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:38:00 +0100 Subject: [PATCH] Fix console tab --- src/client/component/game_console.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index 780873f8..2ab4f628 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -269,17 +269,13 @@ 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()), - 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].name.data()); - } - } + 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 them all)", + matches.size() + ), dvars::con_inputDvarMatchColor->current.vector); } else if (matches.size() == 1) { @@ -717,6 +713,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.name.data()); + } + } } }