diff --git a/src/game/frontend/manager/UIManager.hpp b/src/game/frontend/manager/UIManager.hpp index ddb13b29..6f4dda5a 100644 --- a/src/game/frontend/manager/UIManager.hpp +++ b/src/game/frontend/manager/UIManager.hpp @@ -3,12 +3,6 @@ namespace YimMenu { - class Option - { - public: - virtual void Draw() = 0; - }; - class MiniSubmenu { public: diff --git a/src/game/frontend/manager/Widgets/HotkeySetter.cpp b/src/game/frontend/manager/Widgets/HotkeySetter.cpp index 18571133..91d15fdd 100644 --- a/src/game/frontend/manager/Widgets/HotkeySetter.cpp +++ b/src/game/frontend/manager/Widgets/HotkeySetter.cpp @@ -46,7 +46,7 @@ namespace YimMenu } else { - ImGui::PushItemWidth(50); + ImGui::PushItemWidth(35); for (auto hotkey_modifier : command_hotkey_link->Hotkey) { char key_label[32]; diff --git a/src/game/frontend/manager/Widgets/Widgets.hpp b/src/game/frontend/manager/Widgets/Widgets.hpp index bf623e74..bd71644f 100644 --- a/src/game/frontend/manager/Widgets/Widgets.hpp +++ b/src/game/frontend/manager/Widgets/Widgets.hpp @@ -3,6 +3,14 @@ namespace YimMenu { + //Preferably, all options could be saved in a global instance to make UI elements searchable. + //Preferably, most if not all elements should be done through a widget to have them mapped. + class Option + { + public: + virtual void Draw() = 0; + }; + class Button : public Option { public: diff --git a/src/game/frontend/menu/Menu.cpp b/src/game/frontend/menu/Menu.cpp index 4b44ab63..2556d0a4 100644 --- a/src/game/frontend/menu/Menu.cpp +++ b/src/game/frontend/menu/Menu.cpp @@ -14,6 +14,8 @@ namespace YimMenu static auto SettingsSubmenu = std::make_shared(); SettingsSubmenu->LoadSubmenus(); //Loads mini submenus into memory. + + Renderer::AddRendererCallBack( [&] { if (!GUI::IsOpen()) @@ -22,7 +24,7 @@ namespace YimMenu //Think this add HTML&PHP with no CSS. Lol just for testing. ImGui::SetNextWindowSize(ImVec2(610, 610 /*add auto resize*/), ImGuiCond_Once); - if (ImGui::Begin("Main Window")) + if (ImGui::Begin("HorseMenu")) { const auto& pos = ImGui::GetCursorPos(); @@ -34,6 +36,8 @@ namespace YimMenu if (ImGui::BeginChild("##submenus", ImVec2(120, 0), true)) { + //Arguably the only place this file should be edited at for more menus + g_SubmenuHandler.SubmenuOption("L" /*Logo Font*/, "Self", SelfSubmenu); //Ideally with the logo you'd have them squares that fit perfectly. g_SubmenuHandler.SubmenuOption("L" /*Logo Font*/, "Settings", SettingsSubmenu); } @@ -64,5 +68,7 @@ namespace YimMenu } }, -1); + + //Menu::ApplyTheme(); } } \ No newline at end of file diff --git a/src/game/frontend/menu/settings/Settings.cpp b/src/game/frontend/menu/settings/Settings.cpp index 84fd7809..d035e046 100644 --- a/src/game/frontend/menu/settings/Settings.cpp +++ b/src/game/frontend/menu/settings/Settings.cpp @@ -1,6 +1,6 @@ #include "settings.hpp" -#include "core/commands/HotkeySystem.hpp" #include "core/commands/Commands.hpp" +#include "core/commands/HotkeySystem.hpp" #include "core/commands/LoopedCommand.hpp" #include "game/frontend/manager/Widgets/Widgets.hpp" @@ -11,19 +11,22 @@ namespace YimMenu { ImGui::BulletText("Hover over the command name to change its hotkey"); ImGui::BulletText("Press any registered key to remove"); + + ImGui::Spacing(); + ImGui::Separator(); ImGui::Spacing(); for (auto [hash, command] : Commands::GetCommands()) { ImGui::PushID(hash); - HotkeySetter(hash).Draw(); + if (g_HotkeySystem.m_CommandHotkeys.find(hash) != g_HotkeySystem.m_CommandHotkeys.end()) + HotkeySetter(hash).Draw(); ImGui::Spacing(); ImGui::PopID(); } - }; //Init mini submenus @@ -34,7 +37,7 @@ namespace YimMenu m_DefaultMiniSubmenu = m_MiniSubMenus.front(); } - //Script Tick If Needed + //Script Tick If Needed void Settings::Update() { //TODO