forked from Sthephanfelix/Overwatch-Aimbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDraw.cpp
572 lines (537 loc) · 21.5 KB
/
Draw.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
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
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
#include "stdafx.h"
#include "Draw.h"
#include "DirectX.h"
#include <d3dx10.h>
#include "Player.h"
#define SAFE_RELEASE(P) if(P){P->Release() ; P = NULL ;}
extern ID2D1HwndRenderTarget* pRender;
extern RECT MyRect;
extern IDWriteFactory* pWriteFactory;
extern ID2D1SolidColorBrush* pBrush;
ID2D1SolidColorBrush* DrawBrush=NULL;
ID2D1LinearGradientBrush* DrawGradientBrush=NULL;
extern IDWriteTextFormat* pTextFormatMsyh;
IDWriteTextFormat* pTextFormatKaiTi=NULL;
IDWriteTextFormat* pTextFormatSimSun = NULL;
IDWriteTextFormat* pTextFormatHealth = NULL;
void DarwRelease()
{
SAFE_RELEASE(DrawBrush);
SAFE_RELEASE(pTextFormatKaiTi);
SAFE_RELEASE(DrawGradientBrush);
}
bool TextFormatInit()//创建字体
{
if (!pTextFormatKaiTi)
{
pWriteFactory->CreateTextFormat(L"KaiTi",
NULL,
DWRITE_FONT_WEIGHT_MEDIUM, // 粗细
DWRITE_FONT_STYLE_NORMAL, // 斜体
DWRITE_FONT_STRETCH_NORMAL, // Stretch
19.0f, // Size
L"MyFont", // Local
&pTextFormatKaiTi);
}
if (!pTextFormatSimSun)
{
pWriteFactory->CreateTextFormat(L"SimSun",
NULL,
DWRITE_FONT_WEIGHT_MEDIUM, // 粗细
DWRITE_FONT_STYLE_NORMAL, // 斜体
DWRITE_FONT_STRETCH_NORMAL, // Stretch
18.0f, // Size
L"MyFont", // Local
&pTextFormatSimSun);
}
if (!pTextFormatHealth)
{
pWriteFactory->CreateTextFormat(L"Msyh",
NULL,
DWRITE_FONT_WEIGHT_MEDIUM, // 粗细
DWRITE_FONT_STYLE_NORMAL, // 斜体
DWRITE_FONT_STRETCH_NORMAL, // Stretch
12.0f, // Size
L"MyFont", // Local
&pTextFormatHealth);
}
return false;
}
bool SolidColorBrushInit()//创建固色画刷
{
if (!DrawBrush)
{
pRender->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Black), &DrawBrush);
return true;
}
return false;
}
bool LinearGradientBrushInit(int X, int Y, int W, int H, D3DCOLOR Color, D3DCOLOR Color2, float Alpha)//创建变色画刷
{
SAFE_RELEASE(DrawGradientBrush);
if (!DrawGradientBrush)
{
D2D1_GRADIENT_STOP GRADIENT_STOP[2];
ID2D1GradientStopCollection* GradientStopCollection = NULL;
GRADIENT_STOP[0].color = D2D1::ColorF(D2D1::ColorF(Color, Alpha));
GRADIENT_STOP[0].position = 0.f;
GRADIENT_STOP[1].color = D2D1::ColorF(D2D1::ColorF(Color2, Alpha));
GRADIENT_STOP[1].position = 1.f;
pRender->CreateGradientStopCollection(GRADIENT_STOP, 2, D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, &GradientStopCollection);
pRender->CreateLinearGradientBrush(
D2D1::LinearGradientBrushProperties(
D2D1::Point2F((float)X, (float)Y),
D2D1::Point2F(float(W), float(H))),
GradientStopCollection,
&DrawGradientBrush
);
return true;
}
return false;
}
void DrawRenderText(int X, int Y, const char* text, D3DCOLOR Color, IDWriteTextFormat*TextFormat,float Alpha)//文字
{
WCHAR WStr[256] = { 0 };
MultiByteToWideChar(CP_ACP, 0, text, strlen(text), WStr, strlen(text) * 2);
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->DrawText(WStr, wcslen(WStr), TextFormat,
D2D1::RectF((float)X, (float)Y, (float)MyRect.right, (float)MyRect.bottom), DrawBrush);
}
void DrawVectorLine(D3DXVECTOR3 X, D3DXVECTOR3 Y, D3DCOLOR Color, float Width , float Alpha )//直线
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->DrawLine(D2D1::Point2F(X.x, X.y), D2D1::Point2F(Y.x, Y.y), DrawBrush, Width);
}
void DrawLine(int X, int Y, int XX, int YY, D3DCOLOR Color, float Width , float Alpha)//直线
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->DrawLine(D2D1::Point2F(X, Y), D2D1::Point2F(XX, YY), DrawBrush, Width);
}
void DrawFillRectangle(int X, int Y, int W, int H ,D3DCOLOR Color, float Alpha)//填充矩形
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->FillRectangle(D2D1::RectF((float)X, (float)Y, float(X + W), float(Y + H)), DrawBrush);
}
void DrawFillRectangleGradient(int X, int Y, int W, int H, D3DCOLOR Color, D3DCOLOR Color2, float Alpha = 1.0f)//填充变色矩形
{
LinearGradientBrushInit( X, Y, W, H, Color, Color2, Alpha);
pRender->FillRectangle(D2D1::RectF((float)X, (float)Y, float(X + W), float(Y + H)), DrawGradientBrush);
}
void DrawRectangle(float X, float Y, float W, float H, D3DCOLOR Color, float Width, float Alpha )//矩形
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->DrawRectangle(D2D1::RectF(X, Y, X + W, Y + H), DrawBrush, Width);
}
void DrawRectangleGradient(float X, float Y, int W, int H, D3DCOLOR Color, D3DCOLOR Color2, float Width = 1.0f, float Alpha = 1.0f)//变色矩形
{
LinearGradientBrushInit(X, Y, W, H, Color, Color2, Alpha);
pRender->DrawRectangle(D2D1::RectF(X, Y, W, H), DrawGradientBrush, Width);
}
void DrawFillRoundedRectangle(int X, int Y, int W, int H, float RadianX, float RadianY, D3DCOLOR Color, float Alpha = 1.0f)//填充圆角
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF((float)X, (float)Y, float(X + W), float(Y + H)),
RadianX, RadianY), DrawBrush);
}
void DrawFillRoundedRectangleGradient(int X, int Y, int W, int H, float RadianX, float RadianY, D3DCOLOR Color, D3DCOLOR Color2,float Alpha = 1.0f)//填充变色圆角
{
LinearGradientBrushInit(X, Y, W, H, Color, Color2, Alpha);
pRender->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF((float)X, (float)Y, float(X + W), float(Y + H)),
RadianX, RadianY), DrawGradientBrush);
}
void DrawRoundedRectangle(int X, int Y, int W, int H, float RadianX, float RadianY, D3DCOLOR Color, float Width = 1.0f, float Alpha = 1.0f)//圆角
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF((float)X, (float)Y, float(W), float(H)), RadianX, RadianY), DrawBrush, Width);
}
void DrawRoundedRectangleGradient(int X, int Y, int W, int H, float RadianX, float RadianY, D3DCOLOR Color, D3DCOLOR Color2, float Width = 1.0f, float Alpha = 1.0f)//变色圆角
{
LinearGradientBrushInit(X, Y, W, H, Color, Color2, Alpha);
pRender->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF((float)X, (float)Y, float(W), float(H)), RadianX, RadianY), DrawGradientBrush, Width);
}
void DrawFillRound(float X, float Y, float Radius, D3DCOLOR Color, float Alpha = 1.0f)//填充圆
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->FillEllipse(D2D1::Ellipse(D2D1::Point2F(X, Y), Radius, Radius), DrawBrush);
}
void DrawRound(float X, float Y, float Radius, D3DCOLOR Color, float Width = 1.0f, float Alpha = 1.0f)//圆
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->DrawEllipse(D2D1::Ellipse(D2D1::Point2F(X, Y), Radius, Radius), DrawBrush, Width);
}
void DrawEllipse(float X, float Y, float RadiusX, float RadiusY, D3DCOLOR Color, float Width, float Alpha )//椭圆
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->DrawEllipse(D2D1::Ellipse(D2D1::Point2F(X, Y), RadiusX, RadiusY), DrawBrush, Width);
}
void DrawFillEllipse(float X, float Y, float RadiusX, float RadiusY, D3DCOLOR Color, float Alpha = 1.0f)//填充椭圆
{
DrawBrush->SetColor(D2D1::ColorF(Color, Alpha));
pRender->FillEllipse(D2D1::Ellipse(D2D1::Point2F(X, Y), RadiusX, RadiusY), DrawBrush);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// 以下为自定义 ////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DrawProgressBar(int X, int Y, int W, int H, int Value, int MaxValue, D3DCOLOR Color)//进度条
{
int progress = (int)((float)Value / ((float)MaxValue / 100));
int w = (int)((float)W / 100 * progress);
D3DCOLOR color = D3DCOLOR_RGBA(255, 0, 0, 255);
DrawFillRoundedRectangle(X, Y - 1, W + 1, H + 2, 15, 15, Color, 0);
if (w >= 2)DrawFillRoundedRectangle(X + 1, Y, w - 1, H, 15, 15, color);
}
void DrawHalfRectangle(float X, float Y, float W, float H, D3DCOLOR Color, float Width, float Alpha)//断式矩形
{
float DivW =W/4.5;
float DivH = H/3.5;
DrawLine(X, Y, X + DivW, Y, Color, Width, Alpha);
DrawLine(X, Y, X, Y + DivH, Color, Width, Alpha);
DrawLine(X + W - DivW, Y, X + W , Y, Color, Width, Alpha);
DrawLine(X + W, Y, X + W, Y + DivH, Color, Width, Alpha);
DrawLine(X , Y + H, X + DivW, Y + H, Color, Width, Alpha);
DrawLine(X , Y + H, X , Y +H- DivH, Color, Width, Alpha);
DrawLine(X + W - DivW, Y + H, X + W, Y + H, Color, Width, Alpha);
DrawLine(X + W, Y + H, X + W, Y + H - DivH, Color, Width, Alpha);
}
void DrawVerticalHealth(float Health, float MaxHealth,int X, int Y, int W, int H)//高要负数
{
if (H >= -20)
H = -21;
int progress = (int)((float)Health / ((float)MaxHealth / 100));
int h = (int)((float)H / 100 * progress);
D3DCOLOR color = D3DCOLOR_RGBA(255, 0, 0, 255);
if (progress >= 20) color = D3DCOLOR_RGBA(255, 165, 0, 255);
if (progress >= 40) color = D3DCOLOR_RGBA(255, 255, 0, 255);
if (progress >= 60) color = D3DCOLOR_RGBA(173, 255, 47, 255);
if (progress >= 80) color = D3DCOLOR_RGBA(0, 255, 0, 255);
DrawFillRoundedRectangle(X, Y - 1, W, H, 3, 1, D3DCOLOR_RGBA(0, 0, 0, 255));//最大血量黑色
DrawFillRoundedRectangle(X + 1, Y, W, h, 3, 1, color, 0.8);//当前血量
// char text[20];
// sprintf_s(text, "HP: %d", (INT)Health);
// DrawRenderText(X-10, Y, text, color, pTextFormatHealth);
}
void DrawTransverseHealth(float Health, float MaxHealth, float _X, int X, int Y, int W, int H)
{
if (W <= 30)
W = 31;
int progress = (int)((float)Health / ((float)MaxHealth / 100));
int w = (int)((float)W / 100 * progress);
D3DCOLOR color = D3DCOLOR_RGBA(255, 0, 0, 255);
if (progress >= 20) color = D3DCOLOR_RGBA(255, 165, 0, 255);
if (progress >= 40) color = D3DCOLOR_RGBA(255, 255, 0, 255);
if (progress >= 60) color = D3DCOLOR_RGBA(173, 255, 47, 255);
if (progress >= 80) color = D3DCOLOR_RGBA(0, 255, 0, 255);
DrawFillRoundedRectangle(X, Y - 1, W,H, 3,1,D3DCOLOR_RGBA(0, 0, 0, 255));//最大血量黑色
DrawFillRoundedRectangle(X + 1, Y, w, H, 3,1,color);//当前血量
// char text[20];
// sprintf_s(text, "HP: %d", (INT)Health);
// DrawRenderText(_X - 10, Y, text, color, pTextFormatHealth);
}
void DrawDistance(float Distance, int X, int Y)
{
char text[20];
sprintf_s(text, "[%d m]", (INT)Distance);
DrawRenderText(X, Y+15, text, D2D1::ColorF::White, pTextFormatHealth);
}
void MyChack::MyCreateChack(int X, int Y, int W, int H, D3DCOLOR Color,const char* Text)
{
MyChackX = X;
MyChackY = Y;
MyChackW = W;
MyChackH = H;
DrawRectangle(X - 1, Y - 1, W + 2, H + 2, D2D1::ColorF::Tomato,1.5);
DrawRectangle(X, Y, W, H, Color,1.5);
if (MyChackSelect)
{
DrawFillRectangle(X+2, Y+2, W-4, H-4, Color,1.5);
}
DrawRenderText(X + 18, Y - 3, Text, D2D1::ColorF::Black, pTextFormatSimSun);
DrawRenderText(X+20, Y-5, Text, D2D1::ColorF::White, pTextFormatSimSun);
}
void MyChack::MyChackClick(POINT MousePoint)
{
bool ClickMouse = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1 : 0;
if (ClickMouse&&
((MyChackX < MousePoint.x) && ((MyChackX+MyChackW) > MousePoint.x)) &&
((MyChackY < MousePoint.y) && ((MyChackH+ MyChackY) > MousePoint.y))
)
{
MyChackSelect = !MyChackSelect;
Sleep(100);
}
}
void MyMenu::MyCreateMenu(POINT MenuPoint ,int W, int H, D3DCOLOR Color, const char* Text)
{
MyMenuX = MenuPoint.x;
MyMenuY = MenuPoint.y;
MyMenuW = W;
MyMenuH = H;
if (MyMenuHideShow)
{
DrawFillRoundedRectangle(MyMenuX, MyMenuY, W, 25, 7, 7, Color);
DrawFillRectangle(MyMenuX, MyMenuY + 10, W, 15, Color);
// DrawFillRectangle(MyMenuX, MyMenuY + 10, 111, H+3, Color);
DrawLine(MyMenuX + 1, MyMenuY + 25, MyMenuX + 1, MyMenuY + H + 12, Color);//左竖
DrawLine(MyMenuX + W - 1, MyMenuY + 25, MyMenuX + W - 1, MyMenuY + H + 12, Color);//右竖
DrawLine(MyMenuX, MyMenuY + H + 13, MyMenuX + W, MyMenuY + H + 13, Color);
DrawFillRectangle(MyMenuX + 1, MyMenuY + 13, W - 2, H, D2D1::ColorF::Black, 0.6f);
DrawRenderText(MyMenuX + 13, MyMenuY, Text, D2D1::ColorF::Black, pTextFormatMsyh);
DrawRenderText(MyMenuX + 15, MyMenuY - 2, Text, D2D1::ColorF::White, pTextFormatMsyh);
}
}
extern POINT MenuPoint;
POINT DragPoint;
void MyMenu::MyClickPoint(POINT MousePoint)
{
bool ClickMouse = GetAsyncKeyState(VK_LBUTTON) & 0x8000;
if (ClickMouse)
{
if (!DragMenu&&((MyMenuX < MousePoint.x) && ((MyMenuX + MyMenuW) > MousePoint.x)) &&
((MyMenuY < MousePoint.y) && ((25 + MyMenuY) > MousePoint.y))
)
{
if (DragPoint.y == 0 | DragPoint.x == 0)
{
DragPoint.y = MousePoint.y - MenuPoint.y;
DragPoint.x = MousePoint.x - MenuPoint.x;
}
DragMenu = true;
}
if (DragMenu == true)
{
MenuPoint.y = MousePoint.y - DragPoint.y;
MenuPoint.x = MousePoint.x - DragPoint.x;
}
}
else
{
DragMenu = false;
DragPoint = POINT{};
}
}
void MyRadio::MyCreateRadio(int X, int Y, int W, int H, D3DCOLOR Color, const char* Text)
{
MyRadioX = X;
MyRadioY = Y;
MyRadioW = W;
MyRadioH = H;
//DrawRectangle(X - 1, Y - 1, W + 2, H + 2, Color,0.7);
DrawFillRectangle(X, Y, W, H, Color);
if (!MyRadioSelect)
{
DrawFillRectangle(X, Y, W, H, D2D1::ColorF::Black, 0.6f);
}
DrawRenderText(X+4, Y + (H/5)+2, Text, D2D1::ColorF::Black, pTextFormatSimSun);
DrawRenderText(X+6, Y +(H/5), Text, D2D1::ColorF::White, pTextFormatSimSun);
}
void MyHealthButton::MyCreateButton(int X, int Y, int W, int H, D3DCOLOR Color)
{
MyButtonX = X + 6;
MyButtonY = Y + (H / 2);
MyButtonW = W;
MyButtonH = H;
DrawFillRectangle(MyButtonX, MyButtonY, W, H, Color);
DrawLine (MyButtonX+11 , MyButtonY+1, MyButtonX+3, MyButtonY+8, D2D1::ColorF::White,2.5);
DrawLine(MyButtonX+3 , MyButtonY + 8, MyButtonX+11, MyButtonY + 14, D2D1::ColorF::White, 2.5);
DrawFillRectangle(MyButtonX+50, MyButtonY, W, H, Color);
DrawLine(MyButtonX + 53, MyButtonY + 1, MyButtonX + 62, MyButtonY + 8, D2D1::ColorF::White, 3);
DrawLine(MyButtonX + 62, MyButtonY + 8, MyButtonX + 53, MyButtonY + 14, D2D1::ColorF::White, 3);
if (MyButtonSelect)
{
DrawRenderText(MyButtonX + 22, Y + (H / 5) + 2, "横", D2D1::ColorF::Black, pTextFormatSimSun);
DrawRenderText(MyButtonX + 24, Y + (H / 5), "横", D2D1::ColorF::White, pTextFormatSimSun);
}
if (!MyButtonSelect)
{
DrawRenderText(MyButtonX + 22, Y + (H / 5) + 2, "竖", D2D1::ColorF::Black, pTextFormatSimSun);
DrawRenderText(MyButtonX + 24, Y + (H / 5), "竖", D2D1::ColorF::White, pTextFormatSimSun);
}
}
void MyHealthButton::MyButtonClick(POINT MousePoint)
{
bool ClickMouse = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1 : 0;
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY < MousePoint.y) && ((MyButtonH + MyButtonY) > MousePoint.y))
)
{
MyButtonSelect = !MyButtonSelect;
Sleep(100);
}
if (ClickMouse &&
((MyButtonX+50 < MousePoint.x) && ((MyButtonX+50 + MyButtonW) > MousePoint.x)) &&
((MyButtonY < MousePoint.y) && ((MyButtonH + MyButtonY) > MousePoint.y))
)
{
MyButtonSelect = !MyButtonSelect;
Sleep(100);
}
}
void MyAimBotHeight::MyCreateButton(int X, int Y, int W, int H, D3DCOLOR Color)
{
MyButtonX = X + 6;
MyButtonY = Y + (H / 2);
MyButtonW = W;
MyButtonH = H;
DrawFillRectangle(MyButtonX, MyButtonY, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + 2, MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + MyButtonW-2 , MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawFillRectangle(MyButtonX , MyButtonY+50, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + MyButtonW - 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
char A[100];
sprintf_s(A, "自瞄高度: %d", MyHeightInt);
DrawRenderText(MyButtonX -83, MyButtonY + 19, A, D2D1::ColorF::White, pTextFormatSimSun);
}
void MyAimBotHeight::MyButtonClick(POINT MousePoint)
{
bool ClickMouse = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1 : 0;
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY < MousePoint.y) && ((MyButtonH + MyButtonY) > MousePoint.y))
)
{
MyHeightInt += 1;
Sleep(100);
}
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY + 50 < MousePoint.y) && ((MyButtonH + MyButtonY + 50) > MousePoint.y))
)
{
MyHeightInt -= 1;
Sleep(100);
}
}
void MyAimBotKey::MyCreateButton(int X, int Y, int W, int H, D3DCOLOR Color)
{
MyButtonX = X + 6;
MyButtonY = Y + (H / 2);
MyButtonW = W;
MyButtonH = H;
DrawFillRectangle(MyButtonX, MyButtonY, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + 2, MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + MyButtonW - 2, MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawFillRectangle(MyButtonX, MyButtonY + 50, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + MyButtonW - 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
char A[100];
if (MyHeightInt == 1)
{
DrawRenderText(MyButtonX - 73, MyButtonY + 19, "自瞄键: 左键", D2D1::ColorF::White, pTextFormatSimSun);
return;
}
if (MyHeightInt == 2)
{
DrawRenderText(MyButtonX - 73, MyButtonY + 19, "自瞄键: 右键", D2D1::ColorF::White, pTextFormatSimSun);
return;
}
if (MyHeightInt == 4)
{
DrawRenderText(MyButtonX - 73, MyButtonY + 19, "自瞄键: 中键", D2D1::ColorF::White, pTextFormatSimSun);
return;
}
sprintf_s(A, "自瞄键: %d", MyHeightInt);
DrawRenderText(MyButtonX - 73, MyButtonY + 19, A, D2D1::ColorF::White, pTextFormatSimSun);
}
void MyAimBotKey::MyButtonClick(POINT MousePoint)
{
bool ClickMouse = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1 : 0;
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY < MousePoint.y) && ((MyButtonH + MyButtonY) > MousePoint.y))
)
{
if (MyHeightInt == 0xfe)
{
return;
}
MyHeightInt += 1;
Sleep(100);
}
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY + 50 < MousePoint.y) && ((MyButtonH + MyButtonY + 50) > MousePoint.y))
)
{
if (MyHeightInt == 1)
{
return;
}
MyHeightInt -= 1;
Sleep(100);
}
}
void MyAimBotSpeed::MyCreateButton(int X, int Y, int W, int H, D3DCOLOR Color)
{
MyButtonX = X + 6;
MyButtonY = Y + (H / 2);
MyButtonW = W;
MyButtonH = H;
DrawFillRectangle(MyButtonX, MyButtonY, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + 2, MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + MyButtonW - 2, MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawFillRectangle(MyButtonX, MyButtonY + 50, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + MyButtonW - 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
char A[100];
sprintf_s(A, "平滑速度: %d", MyHeightInt);
DrawRenderText(MyButtonX - 85, MyButtonY + 19, A, D2D1::ColorF::White, pTextFormatSimSun);
}
void MyAimBotSpeed::MyButtonClick(POINT MousePoint)
{
bool ClickMouse = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1 : 0;
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY < MousePoint.y) && ((MyButtonH + MyButtonY) > MousePoint.y))
)
{
MyHeightInt += 1;
Sleep(100);
}
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY + 50 < MousePoint.y) && ((MyButtonH + MyButtonY + 50) > MousePoint.y))
)
{
MyHeightInt -= 1;
Sleep(100);
}
}
void MyChangeButton::MyCreateButton(int X, int Y, int W, int H, D3DCOLOR Color,char*Text)
{
MyButtonX = X + 6;
MyButtonY = Y + (H / 2);
MyButtonW = W;
MyButtonH = H;
DrawFillRectangle(MyButtonX, MyButtonY, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + 2, MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 1, MyButtonX + MyButtonW - 2, MyButtonY + 12, D2D1::ColorF::White, 2.5);
DrawFillRectangle(MyButtonX, MyButtonY + 50, W, H, Color);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
DrawLine(MyButtonX + MyButtonW / 2, MyButtonY + 64, MyButtonX + MyButtonW - 2, MyButtonY + 53, D2D1::ColorF::White, 2.5);
char A[100];
sprintf_s(A, "%d", MyHeightInt);
DrawRenderText(MyButtonX - 83, MyButtonY + 19, Text, D2D1::ColorF::White, pTextFormatSimSun);
DrawRenderText(MyButtonX + 13, MyButtonY + 20, A, D2D1::ColorF::White, pTextFormatSimSun);
}
void MyChangeButton::MyButtonClick(POINT MousePoint)
{
bool ClickMouse = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1 : 0;
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY < MousePoint.y) && ((MyButtonH + MyButtonY) > MousePoint.y))
)
{
MyHeightInt += 1;
Sleep(100);
}
if (ClickMouse &&
((MyButtonX < MousePoint.x) && ((MyButtonX + MyButtonW) > MousePoint.x)) &&
((MyButtonY + 50 < MousePoint.y) && ((MyButtonH + MyButtonY + 50) > MousePoint.y))
)
{
MyHeightInt -= 1;
Sleep(100);
}
}