Add ImGui style from Cheat Menu on the gta trilogy.

Add credits to user-grinch for the style used in readme and in the code.
Disable dll test code.
This commit is contained in:
kelson8 2025-03-13 06:52:59 -04:00
parent affa0dbe3f
commit b49dd981e7
5 changed files with 82 additions and 0 deletions

View File

@ -40,3 +40,7 @@ Here are some images of what this ImGui test is so far
![Light Mode Toggle](/screenshots/LightModeToggle.png) -->
# Credits
Credit to user-grinch on github for the ImGui style that I am using.
The code for it is in imgui_functions.cpp under 'ImGuiFunctions::Main::ApplyStyle()'
* https://github.com/user-grinch/Cheat-Menu/blob/master/src/cheatmenu.cpp#L271-L335

View File

@ -69,6 +69,8 @@ int main(int, char**)
// I forgot about making a test DLL for this project.
// DLL initialize
#ifdef DLL_TEST
HINSTANCE hinstDLL;
DLLPROC HelloWorld;
BOOL fFreeDLL;
@ -119,6 +121,9 @@ int main(int, char**)
// End DLL initialize
#endif //DLL_TEST
#endif //_DIRECTX9
#endif //_TEST1

View File

@ -107,4 +107,72 @@ static void ImGuiFunctions::Main::HelpMarker(const char* desc)
ImGui::PopTextWrapPos();
ImGui::EndTooltip();
}
}
// Credit to user-grinch on github for the style code here.
// https://github.com/user-grinch/Cheat-Menu/blob/master/src/cheatmenu.cpp#L271-L335
void ImGuiFunctions::Main::ApplyStyle()
{
ImGuiStyle* style = &ImGui::GetStyle();
ImVec4* colors = style->Colors;
style->WindowPadding = ImVec2(8, 8);
style->WindowRounding = 5.0f;
style->FramePadding = ImVec2(8, 8);
style->FrameRounding = 5.0f;
style->PopupRounding = 5.0f;
style->ItemSpacing = ImVec2(7, 7);
style->ItemInnerSpacing = ImVec2(7, 7);
style->IndentSpacing = 25.0f;
style->ScrollbarSize = 12.0f;
style->ScrollbarRounding = 10.0f;
style->GrabMinSize = 5.0f;
style->GrabRounding = 3.0f;
style->ChildBorderSize = 0;
style->WindowBorderSize = 0;
style->FrameBorderSize = 0;
style->TabBorderSize = 0;
style->PopupBorderSize = 0;
style->Colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f);
style->Colors[ImGuiCol_TextDisabled] = ImVec4(0.35f, 0.33f, 0.3f, 1.00f);
style->Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.06f, 0.95f);
style->Colors[ImGuiCol_ChildBg] = ImVec4(0.0f, 0.0f, 0.0f, 0.0f);
style->Colors[ImGuiCol_PopupBg] = ImVec4(0.06f, 0.05f, 0.06f, 0.95f);
style->Colors[ImGuiCol_Border] = ImVec4(0.12f, 0.12f, 0.12f, 1.0f);
style->Colors[ImGuiCol_BorderShadow] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
style->Colors[ImGuiCol_FrameBg] = ImVec4(0.15f, 0.15f, 0.15f, 0.95f);
style->Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f);
style->Colors[ImGuiCol_FrameBgActive] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
style->Colors[ImGuiCol_TitleBg] = ImVec4(0.12f, 0.12f, 0.12f, 0.94f);
style->Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 0.98f, 0.95f, 0.75f);
style->Colors[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
style->Colors[ImGuiCol_MenuBarBg] = ImVec4(0.15f, 0.15f, 0.15f, 0.95f);
style->Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.15f, 0.15f, 0.15f, 0.95f);
style->Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.5f, 0.5f, 0.5f, 0.3f);
style->Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.7f, 0.7f, 0.7f, 0.3f);
style->Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.9f, 0.9f, 0.9f, 0.3f);
style->Colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
style->Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
style->Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
style->Colors[ImGuiCol_Separator] = ImVec4(0.15f, 0.15f, 0.15f, 0.95f);
style->Colors[ImGuiCol_Button] = ImVec4(0.15f, 0.15f, 0.15f, 0.95f);
style->Colors[ImGuiCol_ButtonHovered] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f);
style->Colors[ImGuiCol_ButtonActive] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
style->Colors[ImGuiCol_Tab] = ImVec4(0.15f, 0.15f, 0.15f, 0.95f);
style->Colors[ImGuiCol_TabHovered] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f);
style->Colors[ImGuiCol_TabActive] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
style->Colors[ImGuiCol_Header] = ImVec4(0.0f, 0.0f, 0.0f, 0.0f);
style->Colors[ImGuiCol_HeaderHovered] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f);
style->Colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
style->Colors[ImGuiCol_ResizeGrip] = ImVec4(0.12f, 0.12f, 0.12f, 0.00f);
style->Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f);
style->Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
style->Colors[ImGuiCol_PlotLines] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
style->Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
style->Colors[ImGuiCol_PlotHistogram] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
style->Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
style->Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.06f, 0.05f, 0.06f, 0.95f);
style->Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.6f);
}

View File

@ -13,6 +13,7 @@ namespace ImGuiFunctions {
void ShowWindow(HWND hwnd);
void ShutDown();
void DestroyWindow(HWND hwnd, WNDCLASSEXW wc);
void ApplyStyle();
}
}

View File

@ -202,6 +202,10 @@ void DirectX9Test::directX9Test()
// Setup Dear ImGui style
ImGui::StyleColorsDark();
// Setup the style from the Cheat Menu
// https://github.com/user-grinch/Cheat-Menu
ImGuiFunctions::Main::ApplyStyle();
//ImGui::StyleColorsLight();
// Setup Platform/Renderer backends