feat(services): added hotkey_service (#634)

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
Aure7138
2022-11-27 01:29:14 +08:00
committed by GitHub
parent d927a58b1d
commit 2364bc5688
8 changed files with 195 additions and 3 deletions

View File

@ -1,6 +1,7 @@
#include "views/view.hpp"
#include "widgets/imgui_hotkey.hpp"
#include "script_mgr.hpp"
#include "services/hotkey/hotkey_service.hpp"
namespace big
{
@ -36,8 +37,11 @@ namespace big
if (ImGui::Hotkey("Menu Toggle", &g->settings.hotkeys.menu_toggle))
g->settings.hotkeys.editing_menu_toggle = true; // make our menu reappear
ImGui::Text("(Below hotkey is not implemented)");
ImGui::Hotkey("Teleport to waypoint", &g->settings.hotkeys.teleport_waypoint);
if (ImGui::Hotkey("Teleport to waypoint", &g->settings.hotkeys.teleport_waypoint))
g_hotkey_service->update_hotkey("waypoint", g->settings.hotkeys.teleport_waypoint);
if (ImGui::Hotkey("Teleport to objective", &g->settings.hotkeys.teleport_objective))
g_hotkey_service->update_hotkey("objective", g->settings.hotkeys.teleport_objective);
ImGui::PopItemWidth();