forked from NMan1/Modern-Warfare-Warzone-Cheat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.cpp
147 lines (128 loc) · 3.78 KB
/
Menu.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#pragma once
#include <Windows.h>
#include "imgui.h"
#include "Render.h"
#include "Global.h"
#include <Settings.h>
namespace Menu
{
bool bIsOpen = true;
ImVec4 Red = { 255, 0, 0, 255 };
ImVec4 Green = { 0, 255, 0, 255 };
void MenuInit()
{
ImGuiStyle& style = ImGui::GetStyle();
style.Alpha = 1.f;
style.WindowPadding = ImVec2(28, 14);
style.WindowMinSize = ImVec2(32, 32);
style.WindowRounding = 0.0f; //4.0 for slight curve
style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
style.ChildRounding = 0.0f;
style.FramePadding = ImVec2(4, 3);
style.FrameRounding = 0.0f; //2.0
style.ItemSpacing = ImVec2(8, 4);
style.ItemInnerSpacing = ImVec2(4, 4);
style.TouchExtraPadding = ImVec2(0, 0);
style.IndentSpacing = 21.0f;
style.ColumnsMinSpacing = 3.0f;
style.ScrollbarSize = 6.0f;
style.ScrollbarRounding = 16.0f; //16.0
style.GrabMinSize = 0.1f;
style.GrabRounding = 16.0f; //16.00
style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
style.DisplayWindowPadding = ImVec2(22, 22);
style.DisplaySafeAreaPadding = ImVec2(4, 4);
style.AntiAliasedLines = true;
style.CurveTessellationTol = 1.25f;
}
void DrawMenu()
{
Menu::MenuInit();
ImGuiWindowFlags window_flags = 0;
ImGui::SetNextWindowSize(ImVec2(130, 140));
ImGui::SetNextWindowPos(ImVec2(1775, 15));
ImGui::PushFont(m_pTahomaFont);
ImGui::Begin("Overflow", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
{
if (Settings::bEspToggle)
{
ImGui::PushStyleColor(ImGuiCol_Text, Green);
//ImGui::Checkbox("ESP", &Globals::bEspToggle);
ImGui::Text("ESP - ON");
}
else
{
ImGui::PushStyleColor(ImGuiCol_Text, Red);
ImGui::Text("ESP - OFF");
}
ImGui::PopStyleColor();
ImGui::Spacing();
if (Settings::bTextToggle)
{
ImGui::PushStyleColor(ImGuiCol_Text, Green);
ImGui::Text("Text - ON");
}
else
{
ImGui::PushStyleColor(ImGuiCol_Text, Red);
ImGui::Text("Text - OFF");
}
ImGui::PopStyleColor();
ImGui::Spacing();
if (Settings::bSnapLinesToggle)
{
ImGui::PushStyleColor(ImGuiCol_Text, Green);
ImGui::Text("Snap - ON");
}
else
{
ImGui::PushStyleColor(ImGuiCol_Text, Red);
ImGui::Text("Snap - OFF");
}
ImGui::PopStyleColor();
ImGui::Spacing();
}
ImGui::End();
ImGui::PopFont();
}
WNDPROC oWndProc;
LRESULT APIENTRY WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_LBUTTONDOWN:
ImGui::GetIO().MouseDown[0] = true; return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
case WM_LBUTTONUP:
ImGui::GetIO().MouseDown[0] = false; return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
case WM_RBUTTONDOWN:
ImGui::GetIO().MouseDown[1] = true; return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
case WM_RBUTTONUP:
ImGui::GetIO().MouseDown[1] = false; return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
case WM_MBUTTONDOWN:
ImGui::GetIO().MouseDown[2] = true; return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
case WM_MBUTTONUP:
ImGui::GetIO().MouseDown[2] = false; return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
case WM_MOUSEWHEEL:
ImGui::GetIO().MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
case WM_MOUSEMOVE:
ImGui::GetIO().MousePos.x = (signed short)(lParam); ImGui::GetIO().MousePos.y = (signed short)(lParam >> 16); return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
}
return CallWindowProc(oWndProc, hwnd, uMsg, wParam, lParam);
}
void InputInit(HWND hWindow)
{
oWndProc = (WNDPROC)SetWindowLongPtr(hWindow, GWLP_WNDPROC, (__int3264)(LONG_PTR)WndProc);
}
void InputRemove(HWND hWindow)
{
SetWindowLongPtr(hWindow, GWLP_WNDPROC, (LONG_PTR)oWndProc);
}
}