feat: command executor (search bar) (#1029)

This commit is contained in:
Johann
2023-03-11 00:06:09 +01:00
committed by GitHub
parent 4af9c7f258
commit 10bbf1f4bb
16 changed files with 250 additions and 73 deletions

View File

@ -24,6 +24,8 @@ namespace big
register_hotkey("invisveh", g.settings.hotkeys.invisveh, RAGE_JOAAT("invisveh"));
register_hotkey("localinvisveh", g.settings.hotkeys.localinvisveh, RAGE_JOAAT("localinvisveh"));
register_hotkey("fastquit", g.settings.hotkeys.fast_quit, RAGE_JOAAT("fastquit"));
register_hotkey("quicksearch", g.settings.hotkeys.cmd_excecutor, RAGE_JOAAT("cmdexecutor"));
g_renderer->add_wndproc_callback([this](HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
wndproc(static_cast<eKeyState>(msg), wparam);
@ -61,8 +63,8 @@ namespace big
};
const auto name_hash = rage::joaat(name);
return update_hotkey_map(m_hotkeys[1], name_hash, key) // released
&& update_hotkey_map(m_hotkeys[0], name_hash, key);// down
return update_hotkey_map(m_hotkeys[1], name_hash, key) // released
&& update_hotkey_map(m_hotkeys[0], name_hash, key); // down
}
void hotkey_service::wndproc(eKeyState state, key_t key)
@ -70,6 +72,10 @@ namespace big
if (const auto chat_data = *g_pointers->m_chat_data; chat_data && (chat_data->m_chat_open || chat_data->m_timer_two))
return;
//command executer is opened
if (g.cmd_executor.enabled)
return;
if (g_gui->is_open())
return;