-
Notifications
You must be signed in to change notification settings - Fork 0
/
Visuals.h
419 lines (376 loc) · 6.79 KB
/
Visuals.h
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
#pragma once
#include "Hooks.h"
#include "RageBackTracking.h"
#include "Hitmarker.h"
#include <list>
#include <map>
enum zeus_stages {
none = -1,
good,
warning,
fatal
};
struct BOX
{
int h, w, x, y;
};
struct BaseData {
BaseData(IBasePlayer* entity) noexcept;
constexpr auto operator<(const BaseData& other) const
{
return distanceToLocal > other.distanceToLocal;
}
float distanceToLocal;
Vector obbMins, obbMaxs;
Vector origin;
matrix coordinateFrame;
struct {
int x, y, w, h;
} box;
float time_to_die = 0.f;
bool m_bDidSmokeEffect;
int m_nSmokeEffectTickBegin;
};
struct ColorToggleThickness {
ColorToggleThickness() = default;
ColorToggleThickness(float thickness) : thickness{ thickness } { }
float thickness = 1.0f;
};
struct Trail : ColorToggleThickness {
enum Type {
Line = 0,
Circles,
FilledCircles
};
color_t color = color_t(255, 255, 255, 255);
bool rainbow;
int type = Line;
float time = 2.0f;
};
struct WeaponData_t : BaseData {
WeaponData_t(IBasePlayer *entity) noexcept;
int clip;
int reserveAmmo;
std::string group = str("All");
std::string name = str("All");
std::string displayName;
};
struct ProjectileInfo_t : BaseData {
ProjectileInfo_t(IBasePlayer* projectile) noexcept;
void update(IBasePlayer* projectile) noexcept;
constexpr auto operator==(int otherHandle) const noexcept
{
return handle == otherHandle;
}
bool exploded = false;
bool thrownByLocalPlayer = false;
bool thrownByEnemy = false;
int handle;
std::string name = str("");
std::vector<std::pair<float, Vector>> trajectory;
bool trail_added = false;
IBasePlayer* entity;
};
struct InfernoInfo_t {
std::vector<Vector> points;
Vector entity_origin;
Vector origin;
float time_to_die;
float range;
};
struct Flags_t
{
std::string name = "";
bool toggled = false;
bool icon = false;
float modifier = 0.f;
color_t clr = color_t();
Flags_t(std::string cur_name, bool toggle, color_t color, bool is_icon = false) {
name = cur_name;
toggled = toggle;
clr = color;
icon = is_icon;
}
};
struct Health_t
{
int health = -1;
float difference = 0;
float multiplier = 0;
void Erase()
{
health = -1;
difference = 0.f;
multiplier = 0.f;
}
};
struct INFO_t
{
IBasePlayer* player;
std::string weapon_name;
IBaseCombatWeapon* weapon;
int hp;
int ammo, max_ammo;
int player_distance;
bool offscreen;
int zeuser_stages;
bool is_valid = false;
bool is_gun;
bool scope,
flash, have_armor, have_helmet, dormant,
have_kit, fake_duck, misc_weapon;
std::string name, last_place;
Vector origin;
float angle1, angle2;
float duck, last_seen_time;
Vector body_pos;
float alpha;
struct {
int x, y, w, h;
}box;
struct
{
std::vector<int> hitboxes;
std::vector<Vector> points;
matrix bones[128];
}AnimInfo;
studiohdr_t* hdr;
Vector bone_pos_child[128];
Vector bone_pos_parent[128];
std::map<int, float> modifier = {};
std::map<int, float> esp_offsets = {};
Health_t health_info;
void Reset() {
player = nullptr;
weapon = nullptr;
hdr = nullptr;
memset(AnimInfo.bones, 0, sizeof(AnimInfo.bones));
if (!AnimInfo.hitboxes.empty())
AnimInfo.hitboxes.clear();
if (!AnimInfo.points.empty())
AnimInfo.points.clear();
if (name.length())
name.clear();
if (last_place.length())
last_place.clear();
if (weapon_name.length())
weapon_name.clear();
esp_offsets.clear();
modifier.clear();
health_info.Erase();
hp = 0;
ammo = 0;
max_ammo = 0;
duck = 0.f;
last_seen_time = 0.f;
player_distance = 0;
alpha = 0.f;
box.x = 0;
box.y = 0;
box.w = 0;
box.h = 0;
zeuser_stages = -1;
is_valid = false;
is_gun = false;
scope = false;
flash = false;
have_armor = false;
have_helmet = false;
dormant = false;
have_kit = false;
fake_duck = false;
misc_weapon = false;
origin = Vector(0, 0, 0);
body_pos = Vector(0, 0, 0);
memset(csgo->EntityAlpha, 0, sizeof(csgo->EntityAlpha));
memset(bone_pos_child, 0, sizeof(bone_pos_child));
memset(bone_pos_parent, 0, sizeof(bone_pos_parent));
offscreen = false;
}
};
struct BombInfo_t {
Vector origin;
float time;
float blow;
float blow_time;
float bomb_ticking;
float defuse_time;
float defuse_cooldown;
bool is_defusing;
bool bomb_defused;
};
class CVisuals
{
public:
std::list<ProjectileInfo_t> ProjectileInfo;
std::vector<WeaponData_t> WeaponData;
std::vector<InfernoInfo_t> InfernoInfo;
std::vector<BombInfo_t> BombInfo;
std::vector<Flags_t> FlagsInfo[64] = {};
Vector PredictedOrigin;
int health[65];
INFO_t player_info[64] = {};
void DrawWatermark();
void DrawLocalVisuals();
void Draw();
void StoreOtherInfo();
void ResetInfo();
void RecordInfo();
void DrawAngleLine(Vector origin, float angle, color_t color);
Vector strored_origin[64];
};
namespace Z {
enum class WeaponType {
Knife = 0,
Pistol,
SubMachinegun,
Rifle,
Shotgun,
SniperRifle,
Machinegun,
C4,
Placeholder,
Grenade,
Unknown,
StackableItem,
Fists,
BreachCharge,
BumpMine,
Tablet,
Melee
};
enum class WeaponId : short {
Deagle = 1,
Elite,
Fiveseven,
Glock,
Ak47 = 7,
Aug,
Awp,
Famas,
G3SG1,
GalilAr = 13,
M249,
M4A1 = 16,
Mac10,
P90 = 19,
ZoneRepulsor,
Mp5sd = 23,
Ump45,
Xm1014,
Bizon,
Mag7,
Negev,
Sawedoff,
Tec9,
Taser,
Hkp2000,
Mp7,
Mp9,
Nova,
P250,
Shield,
Scar20,
Sg553,
Ssg08,
GoldenKnife,
Knife,
Flashbang = 43,
HeGrenade,
SmokeGrenade,
Molotov,
Decoy,
IncGrenade,
C4,
Healthshot = 57,
KnifeT = 59,
M4a1_s,
Usp_s,
Cz75a = 63,
Revolver,
TaGrenade = 68,
Axe = 75,
Hammer,
Spanner = 78,
GhostKnife = 80,
Firebomb,
Diversion,
FragGrenade,
Snowball,
BumpMine,
Bayonet = 500,
ClassicKnife = 503,
Flip = 505,
Gut,
Karambit,
M9Bayonet,
Huntsman,
Falchion = 512,
Bowie = 514,
Butterfly,
Daggers,
Paracord,
SurvivalKnife,
Ursus = 519,
Navaja,
NomadKnife,
Stiletto = 522,
Talon,
SkeletonKnife = 525,
GloveStuddedBloodhound = 5027,
GloveT,
GloveCT,
GloveSporty,
GloveSlick,
GloveLeatherWrap,
GloveMotorcycle,
GloveSpecialist,
GloveHydra
};
enum class ClassId {
BaseCSGrenadeProjectile = 9,
BreachChargeProjectile = 29,
BumpMineProjectile = 33,
C4,
Chicken = 36,
CSPlayer = 40,
CSPlayerResource,
CSRagdoll = 42,
Deagle = 46,
DecoyProjectile = 48,
Drone,
Dronegun,
DynamicProp = 52,
EconEntity = 53,
EconWearable,
Hostage = 97,
Healthshot = 104,
Cash,
Knife = 107,
KnifeGG,
MolotovProjectile = 114,
AmmoBox = 125,
LootCrate,
RadarJammer,
WeaponUpgrade,
PlantedC4,
PropDoorRotating = 143,
SensorGrenadeProjectile = 153,
SmokeGrenadeProjectile = 157,
SnowballPile = 160,
SnowballProjectile,
Tablet = 172,
Aug = 232,
Awp,
Elite = 239,
FiveSeven = 241,
G3sg1,
Glock = 245,
P2000,
P250 = 258,
Scar20 = 261,
Sg553 = 265,
Ssg08 = 267,
Tec9 = 269
};
}