11#include " game/pointers/Pointers.hpp"
22#include " game/frontend/Menu.hpp"
33#include " core/frontend/manager/UIManager.hpp"
4+ #include " game/frontend/submenus/Settings/GUISettings.hpp"
45
56namespace YimMenu
67{
78 void RenderModernVTheme ()
89 {
10+ YimMenu::SyncColorCommandsToStyle ();
11+
912 ImGuiIO& io = ImGui::GetIO ();
1013 ImDrawList* drawList = ImGui::GetBackgroundDrawList ();
1114
@@ -26,72 +29,68 @@ namespace YimMenu
2629 ImGui::Begin (" ##BubbleInputWindow" , nullptr , ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoBringToFrontOnFocus);
2730
2831 const auto & submenus = YimMenu::UIManager::GetSubmenus ();
32+ auto activeSubmenu = YimMenu::UIManager::GetActiveSubmenu ();
33+
2934 for (size_t i = 0 ; i < submenus.size (); ++i)
3035 {
3136 auto & submenu = submenus[i];
32- // Changed horizontal to vertical:
37+
3338 ImVec2 bubblePos (basePos.x , basePos.y + i * bubbleSpacing + 2 );
3439 ImVec2 center (bubblePos.x + bubbleSize / 2 .0f , bubblePos.y + bubbleSize / 2 .0f );
3540
3641 ImGui::SetCursorScreenPos (bubblePos);
3742 ImGui::PushID (static_cast <int >(i));
3843
39- ImVec2 bgPos (center.x - bgSize / 2 .0f , center.y - bgSize / 2 .0f );
40- drawList->AddRectFilled (bgPos, ImVec2 (bgPos.x + bgSize, bgPos.y + bgSize), IM_COL32 (10 , 10 , 10 , 255 ), rounding);
41- drawList->AddRect (bgPos, ImVec2 (bgPos.x + bgSize, bgPos.y + bgSize), IM_COL32 (192 , 192 , 192 , 32 ), rounding, ImDrawFlags_None, 1 .0f );
42-
43- ImU32 bubbleColor = IM_COL32 (25 , 25 , 31 , 255 );
44- ImU32 hoverColor = IM_COL32 (46 , 46 , 51 , 255 );
44+ // Invisible button logic
4545 ImGui::InvisibleButton (" ##Bubble" , ImVec2 (bubbleSize, bubbleSize));
4646 bool hovered = ImGui::IsItemHovered ();
4747 bool clicked = ImGui::IsItemClicked ();
4848
49- drawList->AddRectFilled (bubblePos, ImVec2 (bubblePos.x + bubbleSize, bubblePos.y + bubbleSize), hovered ? hoverColor : bubbleColor, rounding);
50- drawList->AddRect (bubblePos, ImVec2 (bubblePos.x + bubbleSize, bubblePos.y + bubbleSize), IM_COL32 (192 , 192 , 192 , 16 ), rounding, ImDrawFlags_None, 1 .0f );
51-
52- auto activeSubmenu = YimMenu::UIManager::GetActiveSubmenu ();
53-
5449 if (clicked)
5550 {
5651 if (submenu == activeSubmenu)
57- {
5852 YimMenu::UIManager::SetShowContentWindow (!YimMenu::UIManager::ShowingContentWindow ());
59- }
6053 else
6154 {
6255 YimMenu::UIManager::SetActiveSubmenu (submenu);
6356 YimMenu::UIManager::SetShowContentWindow (true );
6457 }
6558 }
6659
67- ImU32 defaultIconColor = IM_COL32 (255 , 255 , 255 , 255 );
68- ImU32 activeIconColor = IM_COL32 (46 , 204 , 113 , 255 );
69- ImU32 hoveredIconColor = IM_COL32 (36 , 174 , 93 , 255 );
70- ImU32 iconColor = submenu == activeSubmenu ? activeIconColor : (hovered ? hoveredIconColor : defaultIconColor);
60+ // Colors from ImGui style
61+ ImU32 buttonColor = ImGui::GetColorU32 (ImGuiCol_Button);
62+ ImU32 hoverColor = ImGui::GetColorU32 (ImGuiCol_ButtonHovered);
63+ ImU32 activeColor = ImGui::GetColorU32 (ImGuiCol_ButtonActive);
64+ ImU32 borderColor = ImGui::GetColorU32 (ImGuiCol_Border);
65+ ImU32 iconColor = ImGui::GetColorU32 (ImGuiCol_Text);
7166
67+ // Final fill color
68+ ImU32 fillColor = (submenu == activeSubmenu) ? activeColor : (hovered ? hoverColor : buttonColor);
69+
70+ // Draw filled button bubble
71+ drawList->AddRectFilled (bubblePos, bubblePos + ImVec2 (bubbleSize, bubbleSize), fillColor, rounding);
72+ drawList->AddRect (bubblePos, bubblePos + ImVec2 (bubbleSize, bubbleSize), borderColor, rounding, ImDrawFlags_None, 1 .0f );
73+
74+ // Draw icon centered (text color always)
7275 ImGui::PushFont (YimMenu::Menu::Font::g_AwesomeFont);
7376 ImVec2 iconSize = ImGui::CalcTextSize (submenu->m_Icon .c_str ());
7477 ImVec2 iconPos (center.x - iconSize.x / 2 , center.y - iconSize.y / 2 );
7578 drawList->AddText (YimMenu::Menu::Font::g_AwesomeFont, 0 .0f , iconPos, iconColor, submenu->m_Icon .c_str ());
7679 ImGui::PopFont ();
7780
78- ImU32 defaultTextColor = IM_COL32 (255 , 255 , 255 , 255 );
79- ImU32 activeTextColor = IM_COL32 (46 , 204 , 113 , 255 );
80- ImU32 hoveredTextColor = IM_COL32 (36 , 174 , 93 , 255 );
81- ImU32 textColor = submenu == activeSubmenu ? activeTextColor : (hovered ? hoveredTextColor : defaultTextColor);
82-
81+ // Draw label below bubble
8382 ImVec2 labelSize = ImGui::CalcTextSize (submenu->m_Name .c_str ());
8483 ImVec2 labelPos (center.x - labelSize.x / 2 , bubblePos.y + bubbleSize + 15 .0f );
8584 ImVec2 bgMin = labelPos - ImVec2 (6 , 2 );
8685 ImVec2 bgMax = labelPos + labelSize + ImVec2 (6 , 2 );
87-
88- drawList->AddRectFilled (bgMin, bgMax, IM_COL32 (26 , 26 , 31 , 120 ));
89- drawList->AddRect (bgMin, bgMax, IM_COL32 (192 , 192 , 192 , 16 ), 4 .0f );
90- drawList->AddText (labelPos, textColor, submenu->m_Name .c_str ());
86+ drawList->AddRectFilled (bgMin, bgMax, ImGui::GetColorU32 (ImGuiCol_ChildBg));
87+ drawList->AddRect (bgMin, bgMax, borderColor, 4 .0f );
88+ drawList->AddText (labelPos, iconColor, submenu->m_Name .c_str ());
9189
9290 ImGui::PopID ();
9391 }
9492
93+ // Drag zone (optional repositioning)
9594 ImVec2 dragZoneMin = ImVec2 (basePos.x + bubbleSize + 10 , basePos.y );
9695 ImVec2 dragZoneMax = ImVec2 (basePos.x + bubbleSize + 10 + bubbleSpacing, basePos.y + bubbleSpacing * submenus.size ());
9796 ImGui::SetCursorScreenPos (dragZoneMin);
@@ -107,8 +106,7 @@ namespace YimMenu
107106 else
108107 {
109108 ImVec2 delta = io.MousePos - dragStart;
110- basePosOffset.x += delta.x ;
111- basePosOffset.y += delta.y ;
109+ basePosOffset += delta;
112110 dragStart = io.MousePos ;
113111 }
114112 }
@@ -119,8 +117,7 @@ namespace YimMenu
119117
120118 ImGui::End ();
121119
122- auto activeSubmenu = YimMenu::UIManager::GetActiveSubmenu ();
123-
120+ // Content window
124121 if (YimMenu::UIManager::ShowingContentWindow () && activeSubmenu)
125122 {
126123 float windowWidth = *YimMenu::Pointers.ScreenResX / 2 .5f ;
@@ -130,14 +127,11 @@ namespace YimMenu
130127
131128 ImGui::SetNextWindowSize (windowSize, ImGuiCond_FirstUseEver);
132129 ImGui::SetNextWindowPos (ImVec2 (centerX, centerY), ImGuiCond_FirstUseEver);
133- ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse;
134130
135- if (ImGui::Begin (" ##Categories&Content" , nullptr , flags ))
131+ if (ImGui::Begin (" ##Categories&Content" , nullptr , ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse ))
136132 {
137133 if (ImGui::BeginChild (" ##categorySelectors" , ImVec2 (0 , 60 ), true ))
138- {
139134 activeSubmenu->DrawCategorySelectors ();
140- }
141135 ImGui::EndChild ();
142136
143137 if (ImGui::BeginChild (" ##options" , ImVec2 (0 , 0 ), true ))
0 commit comments