Repository navigation
Expand file tree
/
Copy pathModuleManager.h
More file actions
178 lines (148 loc) · 3.1 KB
/
Copy pathModuleManager.h
File metadata and controls
178 lines (148 loc) · 3.1 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#pragma once
#include <memory>
#include <vector>
#include <string>
#include <bitset>
#include "ESP.h"
enum ModuleType : uint8_t {
Combat,
Movement,
Player,
World,
Render,
Exploit,
Misc,
Client,
};
struct ModuleInfo {
std::string name;
ModuleType type;
};
const std::vector<ModuleInfo> module_info
{
{"Aimbot", Combat},
{"Auto Clicker", Combat},
{"Criticals", Combat},
{"Velocity", Combat},
{"Fly", Movement},
{"Inv Move", Movement},
{"Safe Walk", Movement},
{"Scaffold", Movement},
{"Speed", Movement},
{"Spider", Movement},
{"Sprint", Movement},
{"Step", Movement},
{"Auto Armor", Player},
{"Auto Swap", Player},
{"Auto Tool", Player},
{"Chest Stealer", Player},
{"Inv Manager", Player},
{"No Fall", Player},
{"No Slow", Player},
{"Timer", Player},
{"Fast Place", World},
{"ESP", Render},
{"Fullbright", Render},
{"Hud", Render},
{"Target Hud", Render},
{"True Sight", Render},
{"Fake Damage", Exploit},
{"Auto Respawn", Misc},
};
const std::vector<std::string> instant_modules
{
"Fake Damage",
};
#define MODULE_COUNT 28
class ModuleManager {
public:
bool modules[MODULE_COUNT]{ false };
ModuleManager() {
Reset();
// 测试
Enable("Auto Clicker");
Enable("Auto Respawn");
Enable("Auto Swap");
Enable("Auto Tool");
Enable("Sprint");
Enable("No Fall");
Enable("Inv Move");
//Enable("ESP");
Enable("Fullbright");
Enable("Hud");
//Enable("Target Hud");
//Enable("Velocity");
}
void Reset() {
memset(modules, 0, MODULE_COUNT);
}
void EnableAll() {
for (int i = 0; i < MODULE_COUNT; i++) {
modules[i] = true;
}
}
static std::string GetModuleName(int index) {
return module_info[index].name;
}
static ModuleType GetModuleType(int index) {
return module_info[index].type;
}
bool& ModuleOnRef(int index) {
return modules[index];
}
bool& ModuleOnRef(const std::string& name) {
for (int i = 0; i < module_info.size(); i++) {
if (module_info[i].name == name) {
return ModuleOnRef(i);
}
}
return modules[0];
}
bool ModuleOn(int index) const{
return modules[index];
}
bool ModuleOn(const std::string& name) const {
for (int i = 0; i < module_info.size(); i++) {
if (module_info[i].name == name) {
return ModuleOn(i);
}
}
return false;
}
void Enable(int index) {
modules[index] = true;
}
void Enable(const std::string& name) {
for (int i = 0; i < module_info.size(); i++) {
if (module_info[i].name == name) {
Enable(i);
}
}
}
void Disable(int index) {
modules[index] = false;
}
void Disable(const std::string& name) {
for (int i = 0; i < module_info.size(); i++) {
if (module_info[i].name == name) {
Disable(i);
}
}
}
bool NeedWorldEntities() const {
return ModuleOn("ESP") && ESP::target_mode == ESP_ALL;
}
std::vector<int> GetEnabledModules() const {
std::vector<int> enabled_modules;
for (int i = 0; i < module_info.size(); i++) {
if (ModuleOn(i)) {
enabled_modules.push_back(i);
}
}
return enabled_modules;
}
size_t GetEnabledModuleCount() const {
return GetEnabledModules().size();
}
};
inline std::unique_ptr<ModuleManager> p_modmgr = nullptr;