1+ #define _CRT_SECURE_NO_WARNINGS
2+
13#include < corecrt_math.h>
24#include " gui.h"
35#include " ../dependencies/ImGui/imgui.h"
@@ -177,6 +179,47 @@ void gui::CreateImGui() noexcept
177179
178180 ImGui_ImplWin32_Init (overlay);
179181 ImGui_ImplDX11_Init (device, device_context);
182+
183+ ImGuiStyle& style = ImGui::GetStyle ();
184+ style.Alpha = 1.0 ;
185+ style.WindowRounding = 3 ;
186+ style.GrabRounding = 1 ;
187+ style.GrabMinSize = 20 ;
188+ style.FrameRounding = 3 ;
189+
190+ style.Colors [ImGuiCol_Text] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 1 .00f );
191+ style.Colors [ImGuiCol_TextDisabled] = ImVec4 (0 .00f , 0 .40f , 0 .41f , 1 .00f );
192+ style.Colors [ImGuiCol_WindowBg] = ImVec4 (0 .00f , 0 .00f , 0 .00f , 1 .00f );
193+ style.Colors [ImGuiCol_Border] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .65f );
194+ style.Colors [ImGuiCol_BorderShadow] = ImVec4 (0 .00f , 0 .00f , 0 .00f , 0 .00f );
195+ style.Colors [ImGuiCol_FrameBg] = ImVec4 (0 .44f , 0 .80f , 0 .80f , 0 .18f );
196+ style.Colors [ImGuiCol_FrameBgHovered] = ImVec4 (0 .44f , 0 .80f , 0 .80f , 0 .27f );
197+ style.Colors [ImGuiCol_FrameBgActive] = ImVec4 (0 .44f , 0 .81f , 0 .86f , 0 .66f );
198+ style.Colors [ImGuiCol_TitleBg] = ImVec4 (0 .14f , 0 .18f , 0 .21f , 0 .73f );
199+ style.Colors [ImGuiCol_TitleBgCollapsed] = ImVec4 (0 .00f , 0 .00f , 0 .00f , 0 .54f );
200+ style.Colors [ImGuiCol_TitleBgActive] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .27f );
201+ style.Colors [ImGuiCol_MenuBarBg] = ImVec4 (0 .00f , 0 .00f , 0 .00f , 0 .20f );
202+ style.Colors [ImGuiCol_ScrollbarBg] = ImVec4 (0 .22f , 0 .29f , 0 .30f , 0 .71f );
203+ style.Colors [ImGuiCol_ScrollbarGrab] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .44f );
204+ style.Colors [ImGuiCol_ScrollbarGrabHovered] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .74f );
205+ style.Colors [ImGuiCol_ScrollbarGrabActive] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 1 .00f );
206+ style.Colors [ImGuiCol_CheckMark] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .68f );
207+ style.Colors [ImGuiCol_SliderGrab] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .36f );
208+ style.Colors [ImGuiCol_SliderGrabActive] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .76f );
209+ style.Colors [ImGuiCol_Button] = ImVec4 (0 .00f , 0 .65f , 0 .65f , 0 .46f );
210+ style.Colors [ImGuiCol_ButtonHovered] = ImVec4 (0 .01f , 1 .00f , 1 .00f , 0 .43f );
211+ style.Colors [ImGuiCol_ButtonActive] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .62f );
212+ style.Colors [ImGuiCol_Header] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .33f );
213+ style.Colors [ImGuiCol_HeaderHovered] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .42f );
214+ style.Colors [ImGuiCol_HeaderActive] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .54f );
215+ style.Colors [ImGuiCol_ResizeGrip] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .54f );
216+ style.Colors [ImGuiCol_ResizeGripHovered] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .74f );
217+ style.Colors [ImGuiCol_ResizeGripActive] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 1 .00f );
218+ style.Colors [ImGuiCol_PlotLines] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 1 .00f );
219+ style.Colors [ImGuiCol_PlotLinesHovered] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 1 .00f );
220+ style.Colors [ImGuiCol_PlotHistogram] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 1 .00f );
221+ style.Colors [ImGuiCol_PlotHistogramHovered] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 1 .00f );
222+ style.Colors [ImGuiCol_TextSelectedBg] = ImVec4 (0 .00f , 1 .00f , 1 .00f , 0 .22f );
180223}
181224
182225void gui::DestroyImGui () noexcept
@@ -224,6 +267,16 @@ void gui::EndRender() noexcept
224267
225268void gui::Render () noexcept
226269{
270+ // 水印
271+ auto start = std::chrono::system_clock::now ();
272+ auto end = std::chrono::system_clock::now ();
273+ auto elasped_seconds = end - start;
274+ auto end_time = std::chrono::system_clock::to_time_t (end);
275+ ImGui::SetNextWindowPos ({ 10 , 10 });
276+ ImGui::SetWindowSize (ImVec2 (296 , 50 ));
277+ ImGui::Begin (" watermark" , 0 , ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar);
278+ ImGui::Text (" yinlei | %s" , std::ctime (&end_time));
279+ ImGui::End ();
227280 if (menuToggle) {
228281 // 更新当前玩家最大速度
229282 if (speed > maxSpeed) {
@@ -233,7 +286,8 @@ void gui::Render() noexcept
233286 ImGui::ShowDemoWindow(&show_demo_window);*/
234287 ImGuiWindowFlags window_flags = 0 ;
235288 window_flags |= ImGuiWindowFlags_MenuBar;
236- ImGui::SetNextWindowSize ({ 600 .f ,500 .f }, ImGuiCond_FirstUseEver);
289+ window_flags |= ImGuiWindowFlags_NoCollapse;
290+ ImGui::SetNextWindowSize (ImVec2 (900 , 450 ), ImGuiCond_FirstUseEver);
237291 ImGui::Begin (" CS2 ESP Cheat" , 0 , window_flags);
238292 if (ImGui::BeginMenuBar ())
239293 {
@@ -312,7 +366,7 @@ void gui::Render() noexcept
312366 ImGui::Text (" Maximum movement speed: %d" , maxSpeed);
313367 ImGui::EndTabItem ();
314368 }
315- if (ImGui::BeginTabItem (" About " ))
369+ if (ImGui::BeginTabItem (" Misc " ))
316370 {
317371 ImGui::SeparatorText (" Github Homepage" );
318372 ImGui::TextWrapped (" https://github.com/yinleiCoder/cs2-cheat-cpp" );
0 commit comments