6
6
7
7
void Module::drawImGui ()
8
8
{
9
- bool f = false ;
10
- if (!enabled)
9
+ float sbarWidth = ImGui::GetScrollMaxY () > 0 .0f ? ImGui::GetStyle ().ScrollbarSize : 0 ;
10
+
11
+ if (enabled)
12
+ {
13
+ ImGui::PushStyleColor (ImGuiCol_Button, ccc4ToVec (Client::get ()->getThemeColour (" ModuleEnabled" , ccc4 (40 , 40 , 40 , 255 ))));
14
+ ImGui::PushStyleColor (ImGuiCol_ButtonHovered, ccc4ToVec (Client::get ()->getThemeColour (" ModuleEnabledHovered" , ccc4 (50 , 50 , 50 , 255 ))));
15
+ ImGui::PushStyleColor (ImGuiCol_ButtonActive, ccc4ToVec (Client::get ()->getThemeColour (" ModuleEnabledActive" , ccc4 (50 , 50 , 50 , 255 ))));
16
+ ImGui::PushStyleColor (ImGuiCol_Text, ccc4ToVec (Client::get ()->getThemeColour (" ModuleEnabledText" , Client::get ()->accentColour )));
17
+ }
18
+ else
11
19
{
12
20
ImGui::PushStyleColor (ImGuiCol_Button, ccc4ToVec (Client::get ()->getThemeColour (" ModuleDisabled" , ccc4 (40 , 40 , 40 , 255 ))));
13
21
ImGui::PushStyleColor (ImGuiCol_ButtonHovered, ccc4ToVec (Client::get ()->getThemeColour (" ModuleDisabledHovered" , ccc4 (50 , 50 , 50 , 255 ))));
14
22
ImGui::PushStyleColor (ImGuiCol_ButtonActive, ccc4ToVec (Client::get ()->getThemeColour (" ModuleDisabledActive" , ccc4 (50 , 50 , 50 , 255 ))));
15
-
16
- f = true ;
23
+ ImGui::PushStyleColor (ImGuiCol_Text, ccc4ToVec (Client::get ()->getThemeColour (" ModuleDisabledText" , ccc4 (255 , 255 , 255 , 255 ))));
17
24
}
18
25
19
- if (ImGui::Button (this ->name .c_str (), ImVec2 (Client::get ()->widgetSize .x + (options.size () > 0 ? -Client::get ()->widgetSize .y : 0 ), Client::get ()->widgetSize .y )))
26
+ if (ImGui::Button (this ->name .c_str (), ImVec2 (Client::get ()->widgetSize .x + (options.size () > 0 ? -Client::get ()->widgetSize .y - sbarWidth : 0 ), Client::get ()->widgetSize .y )))
20
27
{
21
28
onToggleAndroid (nullptr );
22
29
}
@@ -47,7 +54,7 @@ void Module::drawImGui()
47
54
{
48
55
float offset = Client::get ()->ini ->getKeyValueFloat (" Offsets::ModuleBarOffset" , " 3" );
49
56
auto optionBtn = enabled ? Client::get ()->accentColour : Client::get ()->getThemeColour (" ModuleBarDeselected" , ccc4 (70 , 70 , 70 , 255 ));
50
- ImVec2 topRightPos = ImVec2 (ImGui::GetWindowPos ().x + ImGui::GetCursorPos ().x + Client::get ()->widgetSize .x - offset, ImGui::GetWindowPos ().y + ImGui::GetCursorPos ().y - Client::get ()->widgetSize .y + offset);
57
+ ImVec2 topRightPos = ImVec2 (ImGui::GetWindowPos ().x + ImGui::GetCursorPos ().x + Client::get ()->widgetSize .x - offset - sbarWidth , ImGui::GetWindowPos ().y + ImGui::GetCursorPos ().y - Client::get ()->widgetSize .y + offset);
51
58
52
59
ImGui::GetWindowDrawList ()->AddRectFilled (topRightPos, ImVec2 (topRightPos.x - Client::get ()->ini ->getKeyValueFloat (" ModuleBarSize::Width" , " 3" ), topRightPos.y + Client::get ()->ini ->getKeyValueFloat (" ModuleBarSize::Height" , " 18" )), ImColor (ccc4ToVec (optionBtn)));
53
60
}
@@ -57,8 +64,7 @@ void Module::drawImGui()
57
64
if (ImGui::GetMousePos ().x >= ImGui::GetItemRectMin ().x && ImGui::GetMousePos ().y >= ImGui::GetItemRectMin ().y && ImGui::GetMousePos ().x <= ImGui::GetItemRectMax ().x && ImGui::GetMousePos ().y <= ImGui::GetItemRectMax ().y )
58
65
Client::get ()->hoveredModule = this ;
59
66
60
- if (f)
61
- ImGui::PopStyleColor (3 );
67
+ ImGui::PopStyleColor (4 );
62
68
}
63
69
64
70
void Module::onOptionsAndroid (CCObject* sender)
0 commit comments