-
Notifications
You must be signed in to change notification settings - Fork 3
/
menu.h
2940 lines (2745 loc) · 110 KB
/
menu.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
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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "xor.h"
using DrawTransitionOrg = void(*)(uintptr_t _this, uintptr_t canvas);
DrawTransitionOrg DrawTransitionOriginal = 0;
bool fakeunload = false;
UCanvas* static_canvas;
int width;
int height;
#pragma warning(disable : 4996)
//static wchar_t* s2wc(const char* c)
//{
// const size_t cSize = strlen(c) + 1;
// wchar_t* wc = new wchar_t[cSize];
// mbstowcs(wc, c, cSize);
//
// return wc;
//}
//#define ZeroGUI_MIN(A, B) (((A) < (B)) ? (A) : (B))
//#define ZeroGUI_MAX(A, B) (((A) >= (B)) ? (A) : (B))
APlayerController* PlayerController;
ue::FKey InsertKey;
ue::FKey F7Key;
ue::FKey RBKey;
ue::FKey LBKey;
//
//namespace ZeroGUI
//{
//
// namespace Input
// {
// static bool mouseDown[5];
// static bool mouseDownAlready[256];
//
// static bool keysDown[256];
// static bool keysDownAlready[256];
//
// static bool IsAnyMouseDown()
// {
// if (mouseDown[0]) return true;
// if (mouseDown[1]) return true;
// if (mouseDown[2]) return true;
// if (mouseDown[3]) return true;
// if (mouseDown[4]) return true;
//
// return false;
// }
//
// static bool IsMouseClicked(int button, int element_id, bool repeat)
// {
// if (mouseDown[button])
// {
// if (!mouseDownAlready[element_id])
// {
// mouseDownAlready[element_id] = true;
// return true;
// }
// if (repeat)
// return true;
// }
// else
// {
// mouseDownAlready[element_id] = false;
// }
// return false;
// }
// static bool IsKeyPressed(int key, bool repeat)
// {
// if (keysDown[key])
// {
// if (!keysDownAlready[key])
// {
// keysDownAlready[key] = true;
// return true;
// }
// if (repeat)
// return true;
// }
// else
// {
// keysDownAlready[key] = false;
// }
// return false;
// }
//
// static void Handle()
// {
// if (safe_call(safe_call(GetAsyncKeyState))(0x01))
// mouseDown[0] = true;
// else
// mouseDown[0] = false;
// }
// }
//
// namespace Colors
// {
// //Text
// static ue::FLinearColor Text{ 1.0f, 1.0f, 1.0f, 1.0f };
// static ue::FLinearColor Text_Shadow{ 0.0f, 0.0f, 0.0f, 0.0f };
// static ue::FLinearColor Text_Outline{ 0.0f, 0.0f, 0.0f, 0.30f };
//
// //Window
// static ue::FLinearColor Window_Background{ 0.009f, 0.009f, 0.009f, 1.0f };
// static ue::FLinearColor Window_Header{ 0.10f, 0.15f, 0.84f, 1.0f };
//
// //Buttons
// static ue::FLinearColor Button_Idle{ 5 / 255.f, 5 / 255.f, 5 / 255.f, 1.0f };
// static ue::FLinearColor Button_Hovered{ 7 / 255.f, 7 / 255.f, 7 / 255.f, 1.0f };
// static ue::FLinearColor Button_Active{ 8 / 255.f, 8 / 255.f, 8 / 255.f, 1.0f };
//
// //Combobox
// static ue::FLinearColor Combobox_Idle{ 5 / 255.f, 5 / 255.f, 5 / 255.f, 1.0f };
// static ue::FLinearColor Combobox_Hovered{ 7 / 255.f, 7 / 255.f, 7 / 255.f, 1.0f };
// static ue::FLinearColor Combobox_Elements{ 5 / 255.f, 5 / 255.f, 5 / 255.f, 1.0f };
//
// //Sliders
// static ue::FLinearColor Slider_Idle{ 0.17f, 0.16f, 0.23f, 1.0f };
// static ue::FLinearColor Slider_Hovered{ 0.17f, 0.16f, 0.23f, 1.0f };
// static ue::FLinearColor Slider_Progress{ 0.22f, 0.30f, 0.72f, 1.0f };
// static ue::FLinearColor Slider_Button{ 0.10f, 0.15f, 0.84f, 1.0f };
//
// static ue::FLinearColor ColorPicker_Background{ 0.006f, 0.006f, 0.006f, 1.0f };
// }
//
// namespace PostRenderer
// {
// struct DrawList
// {
// int type = -1; //1 = FilledRect, 2 = TextLeft, 3 = TextCenter, 4 = Draw_Line
// Vector2 pos;
// Vector2 size;
// ue::FLinearColor color;
// char* name;
// bool outline;
//
// Vector2 from;
// Vector2 to;
// int thickness;
// };
// static DrawList drawlist[128];
//
// static void drawFilledRect(Vector2 pos, float w, float h, ue::FLinearColor color)
// {
// for (int i = 0; i < 128; i++)
// {
// if (drawlist[i].type == -1)
// {
// drawlist[i].type = 1;
// drawlist[i].pos = pos;
// drawlist[i].size = Vector2{ w, h };
// drawlist[i].color = color;
// return;
// }
// }
// }
// static void TextLeft(char* name, Vector2 pos, ue::FLinearColor color, bool outline)
// {
// for (int i = 0; i < 128; i++)
// {
// if (drawlist[i].type == -1)
// {
// drawlist[i].type = 2;
// drawlist[i].name = name;
// drawlist[i].pos = pos;
// drawlist[i].outline = outline;
// drawlist[i].color = color;
// return;
// }
// }
// }
// static void TextCenter(char* name, Vector2 pos, ue::FLinearColor color, bool outline)
// {
// for (int i = 0; i < 128; i++)
// {
// if (drawlist[i].type == -1)
// {
// drawlist[i].type = 3;
// drawlist[i].name = name;
// drawlist[i].pos = pos;
// drawlist[i].outline = outline;
// drawlist[i].color = color;
// return;
// }
// }
// }
// static void Draw_Line(Vector2 from, Vector2 to, int thickness, ue::FLinearColor color)
// {
// for (int i = 0; i < 128; i++)
// {
// if (drawlist[i].type == -1)
// {
// drawlist[i].type = 4;
// drawlist[i].from = from;
// drawlist[i].to = to;
// drawlist[i].thickness = thickness;
// drawlist[i].color = color;
// return;
// }
// }
// }
// }
//
//
// static bool hover_element = false;
// static Vector2 menu_pos = Vector2{ 0, 0 };
// static float offset_x = 0.0f;
// static float offset_y = 0.0f;
//
// static Vector2 first_element_pos = Vector2{ 0, 0 };
//
// static Vector2 last_element_pos = Vector2{ 0, 0 };
// static Vector2 last_element_size = Vector2{ 0, 0 };
//
// static int current_element = -1;
// static Vector2 current_element_pos = Vector2{ 0, 0 };
// static Vector2 current_element_size = Vector2{ 0, 0 };
// static int elements_count = 0;
//
// static bool sameLine = false;
//
// static bool pushY = false;
// static float pushYvalue = 0.0f;
//
//
// static Vector2 CursorPos()
// {
// float cursorPosX;
// float cursorPosY;
// PlayerController->GetMousePosition(&cursorPosX, &cursorPosY);
//
// return Vector2{ cursorPosX, cursorPosY };
// }
// static bool MouseInZone(Vector2 pos, Vector2 size)
// {
// Vector2 cursor_pos = CursorPos();
//
// if (cursor_pos.x > pos.x && cursor_pos.y > pos.y)
// if (cursor_pos.x < pos.x + size.y && cursor_pos.y < pos.y + size.y)
// return true;
//
// return false;
// }
//
// static void Draw_Cursor(bool toogle)
// {
// if (toogle)
// {
// Vector2 cursorPos = CursorPos();
// //static_canvas->K2_DrawLine(Vector2{ cursorPos.x, cursorPos.x }, Vector2{ cursorPos.x + 35, cursorPos.y + 10 }, 1, ue::FLinearColor{ 0.30f, 0.30f, 0.80f, 1.0f });
//
//
// int x = 35;
// int y = 10;
// while (y != 30) //20 steps
// {
// x -= 1; if (x < 15) x = 15;
// y += 1; if (y > 30) y = 30;
//
// static_canvas->K2_DrawLine(Vector2{ cursorPos.x, cursorPos.y }, Vector2{ cursorPos.x + x, cursorPos.y + y }, 1, ue::FLinearColor{ 0.30f, 0.30f, 0.80f, 1.0f });
// }
//
// static_canvas->K2_DrawLine(Vector2{ cursorPos.x, cursorPos.y }, Vector2{ cursorPos.x + 15, cursorPos.y + 30 }, 1, ue::FLinearColor{ 0.30f, 0.30f, 0.80f, 1.0f });
// static_canvas->K2_DrawLine(Vector2{ cursorPos.x + 35, cursorPos.y + 10 }, Vector2{ cursorPos.x + 15, cursorPos.y + 30 }, 1, ue::FLinearColor{ 0.30f, 0.30f, 0.80f, 1.0f });
// }
// }
//
// static void SameLine()
// {
// sameLine = true;
// }
// static void PushNextElementY(float y, bool from_last_element = true)
// {
// pushY = true;
// if (from_last_element)
// pushYvalue = last_element_pos.y + last_element_size.y + y;
// else
// pushYvalue = menu_pos.y + y;
// }
// static void NextColumn(float x)
// {
// offset_x = x;
// PushNextElementY(first_element_pos.y, false);
// }
// static void PushElementX(float value)
// {
// offset_x = value;
// }
// static void PushElementY(float value)
// {
// pushY = true;
// pushYvalue = menu_pos.y + value - 10;
// }
// static void ClearFirstPos()
// {
// first_element_pos = Vector2{ 0, 0 };
// }
//
// static void TextLeft(char* name, Vector2 pos, ue::FLinearColor color, bool outline, bool big = false)
// {
// if(big)
// static_canvas->K2_DrawText(pos, color, ue::FString(s2wc(name)), false, true);
// else
// static_canvas->K2_DrawText(pos, color, ue::FString(s2wc(name)), false, true);
//
// }
// static void TextCenter(char* name, Vector2 pos, ue::FLinearColor color, bool outline, bool big = false)
// {
// if (big)
// static_canvas->K2_DrawText(pos, color, ue::FString(s2wc(name)), true, true);
// else
// static_canvas->K2_DrawText(pos , color, ue::FString(s2wc(name)), true, true);
// }
//
// static void GetColor(ue::FLinearColor* color, float* r, float* g, float* b, float* a)
// {
// *r = color->R;
// *g = color->G;
// *b = color->B;
// *a = color->A;
// }
// static UINT32 GetColorUINT(int r, int g, int b, int a)
// {
// UINT32 result = (BYTE(a) << 24) + (BYTE(r) << 16) + (BYTE(g) << 8) + BYTE(b);
// return result;
// }
//
// static void Draw_Line(Vector2 from, Vector2 to, int thickness, ue::FLinearColor color)
// {
// static_canvas->K2_DrawLine(Vector2{ from.x, from.y }, Vector2{ to.x, to.y }, thickness, color);
// }
// static void drawFilledRect(Vector2 initial_pos, float w, float h, ue::FLinearColor color)
// {
// for (float i = 0.0f; i < h; i += 1.0f)
// static_canvas->K2_DrawLine(Vector2{ initial_pos.x, initial_pos.y + i }, Vector2{ initial_pos.x + w, initial_pos.y + i }, 1.0f, color);
// }
// static void DrawFilledCircle(Vector2 pos, float r, ue::FLinearColor color)
// {
// float smooth = 0.07f;
//
// double PI = 3.14159265359;
// int size = (int)(2.0f * PI / smooth) + 1;
//
// float angle = 0.0f;
// int i = 0;
//
// for (; angle < 2 * PI; angle += smooth, i++)
// {
// Draw_Line(Vector2{ pos.x, pos.y }, Vector2{ pos.x + cosf(angle) * r, pos.y + sinf(angle) * r }, 1.0f, color);
// }
// }
// static void DrawCircle(Vector2 pos, int radius, int numSides, ue::FLinearColor Color)
// {
// float PI = 3.1415927f;
//
// float Step = PI * 2.0 / numSides;
// int Count = 0;
// Vector2 V[128];
// for (float a = 0; a < PI * 2.0; a += Step) {
// float X1 = radius * cos(a) + pos.x;
// float Y1 = radius * sin(a) + pos.y;
// float X2 = radius * cos(a + Step) + pos.x;
// float Y2 = radius * sin(a + Step) + pos.y;
// V[Count].x = X1;
// V[Count].x = Y1;
// V[Count + 1].x = X2;
// V[Count + 1].x = Y2;
// //Draw_Line(Vector2{ pos.x, pos.y }, Vector2{ X2, Y2 }, 1.0f, Color); // Points from Centre to ends of circle
// Draw_Line(Vector2{ V[Count].x, V[Count].x }, Vector2{ X2, Y2 }, 1.5f, Color);// Circle Around
// }
// }
//
// static Vector2 dragPos;
// static bool Window(char* name, Vector2* pos, Vector2 size, bool isOpen, bool WindowInvisible)
// {
// elements_count = 0;
//
// if (!isOpen)
// return false;
//
// bool isHovered = MouseInZone(Vector2{ pos->x, pos->y }, size);
//
// //Drop last element
// if (current_element != -1 && !safe_call(safe_call(GetAsyncKeyState))(0x1))
// {
// current_element = -1;
// }
//
// //Drag
// if (hover_element && safe_call(safe_call(GetAsyncKeyState))(0x1))
// {
//
// }
// else if ((isHovered || dragPos.x != 0) && !hover_element)
// {
// if (Input::IsMouseClicked(0, elements_count, true))
// {
// /*Vector2 cursorPos = CursorPos();
//
// cursorPos.x -= size.x;
// cursorPos.y -= size.y;
//
// if (dragPos.x == 0)
// {
// dragPos.x = (cursorPos.x - pos->x);
// dragPos.x = (cursorPos.x - pos->y);
// }
// pos->x = cursorPos.x - dragPos.x;
// pos->y = cursorPos.y - dragPos.y;*/
// }
// else
// {
// dragPos = Vector2{ 0, 0 };
// }
// }
// else
// {
// hover_element = false;
// }
//
//
// offset_x = 0.0f; offset_y = 0.0f;
// menu_pos = Vector2{ pos->x, pos->y };
// first_element_pos = Vector2{ 0, 0 };
// current_element_pos = Vector2{ 0, 0 };
// current_element_size = Vector2{ 0, 0 };
//
// if (!WindowInvisible) {
// //Bg
// drawFilledRect(Vector2{ pos->x, pos->y }, size.x, size.y, Colors::Window_Background);
// //drawFilledRect(Vector2{ pos->x, pos->y }, 122, size.y, ue::FLinearColor{ 0.006f, 0.006f, 0.006f, 1.0f });//My tabs bg
//
// //Header
// drawFilledRect(Vector2{ pos->x, pos->y }, size.x, 25.0f, Colors::Window_Header);
//
// offset_y += 25.0f;
//
// //Title
// Vector2 titlePos = Vector2{ pos->x + size.x / 2, pos->y + 25 / 2 };
// TextCenter(name, titlePos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
// }
// else {
// offset_y += 25.0f;
// }
// return true;
// }
//
// static void Text(char* text, bool center = false, bool outline = false)
// {
// elements_count++;
//
// float size = 25;
// Vector2 padding = Vector2{ 10, 10 };
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
//
// if (!sameLine)
// offset_y += size + padding.y;
//
// //Text
// Vector2 textPos = Vector2{ pos.x + 5.0f, pos.y + size / 2 };
// if (center)
// TextCenter(text, textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, outline);
// else
// TextLeft(text, textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, outline);
//
// sameLine = false;
// last_element_pos = pos;
// //last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
// }
// static bool ButtonTab(char* name, Vector2 size, bool active)
// {
// elements_count++;
//
// Vector2 padding = Vector2{ 5, 10 };
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
// bool isHovered = MouseInZone(Vector2{ pos.x, pos.y }, size);
//
// //Bg
// if (active)
// {
// drawFilledRect(Vector2{ pos.x, pos.y }, size.x, size.y, Colors::Button_Active);
// }
// else if (isHovered)
// {
// drawFilledRect(Vector2{ pos.x, pos.y }, size.x, size.y, Colors::Button_Hovered);
// hover_element = true;
// }
// else
// {
// drawFilledRect(Vector2{ pos.x, pos.y }, size.x, size.y, Colors::Button_Idle);
// }
//
// if (!sameLine)
// offset_y += size.y + padding.y;
//
// //Text
// Vector2 textPos = Vector2{ pos.x + size.x / 2, pos.y + size.y / 2 };
// TextCenter(name, textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
//
//
// sameLine = false;
// last_element_pos = pos;
// last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
//
// if (isHovered && Input::IsMouseClicked(0, elements_count, false))
// return true;
//
// return false;
// }
// static bool Button(char* name, Vector2 size)
// {
// elements_count++;
//
// Vector2 padding = Vector2{ 5, 10 };
//
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
//
//
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
// bool isHovered = MouseInZone(Vector2{ pos.x, pos.y }, size);
//
// //Bg
// if (isHovered)
// {
// drawFilledRect(Vector2{ pos.x, pos.y }, size.x, size.y, Colors::Button_Hovered);
// hover_element = true;
// }
// else
// {
// drawFilledRect(Vector2{ pos.x, pos.y }, size.x, size.y, Colors::Button_Idle);
// }
//
// if (!sameLine)
// offset_y += size.y + padding.y;
//
// //Text
// Vector2 textPos = Vector2{ pos.x + size.x / 2, pos.y + size.y / 2 };
// //if (!TextOverlapedFromActiveElement(textPos))
// TextCenter(name, textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
//
//
// sameLine = false;
// last_element_pos = pos;
// last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
//
// if (isHovered && Input::IsMouseClicked(0, elements_count, false))
// return true;
//
// return false;
// }
// static bool InvisibleButton(char* name, Vector2 size)
// {
// elements_count++;
//
// Vector2 padding = Vector2{ 5, 10 };
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
// bool isHovered = MouseInZone(Vector2{ pos.x, pos.y }, size);
//
// if (!sameLine)
// offset_y += size.y + padding.y;
//
// sameLine = false;
// last_element_pos = pos;
// last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
//
// if (isHovered && Input::IsMouseClicked(0, elements_count, false))
// return true;
//
// return false;
// }
// static void FakeElement()
// {
// Vector2 size = Vector2(1, 1);
// elements_count++;
//
// Vector2 padding = Vector2{ 1, 1 };
//
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
//
//
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
//
//
//
// if (!sameLine)
// offset_y += size.y + padding.y;
//
//
// sameLine = false;
// last_element_pos = pos;
// last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
//
// return;
// }
//
// static void Checkbox(char* name, bool* value)
// {
// elements_count++;
//
// Vector2 size = Vector2(20, 20);
// Vector2 padding = Vector2{ 10, 10 };
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
// bool isHovered = MouseInZone(Vector2{ pos.x, pos.y }, Vector2{ size.x, size.y });
//
// if (!sameLine)
// offset_y += size.y + padding.y;
//
//
// const float check_sz = ZeroGUI_MIN(size.x, size.y);
// const float pad = ZeroGUI_MAX(1.0f, (float)(int)(check_sz / 6.0f));
//
//
// Vector2 CheckMarkPos = Vector2(pos.x, pos.y);
//
//
// float sz = size.x - pad * 2.0f;
//
//
// float thickness = ZeroGUI_MAX(sz / 5.0f, 1.0f);
// sz -= thickness * 0.5f;
// CheckMarkPos = CheckMarkPos + Vector2(thickness * 0.25f, thickness * 0.25f);
//
// float third = sz / 3.0f;
// float bx = CheckMarkPos.x + third;
// float by = CheckMarkPos.y + sz - third * 0.5f;
//
// Vector2 TopLeft = Vector2(bx + third * 2 - sz, by - third * 2);
// Vector2 TopRight = Vector2(bx + third * 2, by - third * 2);
// Vector2 BottomLeft = Vector2(bx + third * 2 - sz, by - third * 2 + sz);
// Vector2 BottomRight = Vector2(bx + third * 2, by - third * 2 + sz);
//
// if (!*value)
// {
// //Top Left -> Bottom Right
// //Draw_Line(TopLeft, BottomRight, thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
//
// //Bottom Left -> Top Right
// //Draw_Line(BottomLeft, TopRight, thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
//
// Draw_Line(TopLeft, TopRight, thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
// Draw_Line(TopRight, BottomRight, thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
// Draw_Line(BottomRight, BottomLeft, thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
// Draw_Line(BottomLeft, TopLeft, thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
// }
// else {
//
// //Third -> Center
// Draw_Line(Vector2(bx - third, by - third), Vector2(bx, by), thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
//
// //Center -> Top Right
// Draw_Line(Vector2(bx, by), TopRight, thickness, ue::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
// }
//
//
//
// //Text
// Vector2 textPos = Vector2{ pos.x + size.x + 5.0f, pos.y/* + size.y / 2 */};
// //if (!TextOverlapedFromActiveElement(textPos))
// TextLeft(name, textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
//
//
// sameLine = false;
// last_element_pos = pos;
// //last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
//
// if (isHovered && Input::IsMouseClicked(0, elements_count, false))
// *value = !*value;
// }
// static void SliderInt(char* name, int* value, int min, int max)
// {
// elements_count++;
//
// Vector2 size = Vector2{ 240, 50 };
// Vector2 slider_size = Vector2{ 200, 10 };
// Vector2 padding = Vector2{ 10, 15 };
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
// bool isHovered = MouseInZone(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, slider_size);
//
// if (!sameLine)
// offset_y += size.y + padding.y;
//
// //Bg
// if (isHovered || current_element == elements_count)
// {
// //Drag
// if (Input::IsMouseClicked(0, elements_count, true))
// {
// current_element = elements_count;
//
// Vector2 cursorPos = CursorPos();
// *value = ((cursorPos.x - pos.x) * ((max - min) / slider_size.x)) + min;
// if (*value < min) *value = min;
// if (*value > max) *value = max;
// }
//
// drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, slider_size.x, slider_size.y, Colors::Slider_Hovered);
// drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y + 5.0f }, 5.0f, 5.0f, Colors::Slider_Progress);
//
// hover_element = true;
// }
// else
// {
// drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, slider_size.x, slider_size.y, Colors::Slider_Idle);
// drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y + 5.0f }, 5.0f, 5.0f, Colors::Slider_Progress);
// }
//
//
// //Value
// float oneP = slider_size.x / (max - min);
// drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, oneP * (*value - min), slider_size.y, Colors::Slider_Progress);
// //drawFilledRect(Vector2{ pos.x + oneP * (*value - min) - 10.0f, pos.y + slider_size.y - 5.0f + padding.y }, 20.0f, 20.0f, Colors::Slider_Button);
// DrawFilledCircle(Vector2{ pos.x + oneP * (*value - min), pos.y + slider_size.y + 3.3f + padding.y }, 10.0f, Colors::Slider_Button);
// DrawFilledCircle(Vector2{ pos.x + oneP * (*value - min), pos.y + slider_size.y + 3.3f + padding.y }, 5.0f, Colors::Slider_Progress);
//
// char buffer[32];
// sprintf_s(buffer, "%i", *value);
// Vector2 valuePos = Vector2{ pos.x + oneP * (*value - min), pos.y + slider_size.y + 25 + padding.y };
// TextCenter(buffer, valuePos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
//
// //Text
// Vector2 textPos = Vector2{ pos.x + 5, pos.y + 10 };
// TextLeft(name, textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
//
//
// sameLine = false;
// last_element_pos = pos;
// last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
// }
// static void SliderFloat(char* name, float* value, float min, float max, const char* format = "%.1f")
// {
// elements_count++;
//
// Vector2 size = Vector2{ 210, 40 };
// Vector2 slider_size = Vector2{ 421, 2 };
// Vector2 adjust_zone = Vector2{ 0, 20 };
// Vector2 padding = Vector2{ 10, 20 }; //15
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
// bool isHovered = MouseInZone(Vector2{ pos.x, pos.y + slider_size.y + padding.y - adjust_zone.y }, Vector2{ pos.x + slider_size.x, slider_size.y + adjust_zone.y * 1.5f });
//
// if (!sameLine)
// offset_y += size.y + padding.y - 5;
//
// //Bg
// if (isHovered || current_element == elements_count)
// {
// //Drag
// if (Input::IsMouseClicked(0, elements_count, true))
// {
// current_element = elements_count;
//
// Vector2 cursorPos = CursorPos();
//
// *value = ((cursorPos.x - pos.x) * ((max - min) / slider_size.x)) + min;
// if (*value < min) *value = min;
// if (*value > max) *value = max;
// }
//
// //drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, slider_size.x, slider_size.y, Colors::Slider_Hovered);
// //DrawFilledCircle(Vector2{ pos.x, pos.y + padding.y + 9.3f }, 3.1f, Colors::Slider_Progress);
// //DrawFilledCircle(Vector2{ pos.x + slider_size.x, pos.y + padding.y + 9.3f }, 3.1f, Colors::Slider_Hovered);
//
// hover_element = true;
// }
// else
// {
// //drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, slider_size.x, slider_size.y, Colors::Slider_Idle);
// //DrawFilledCircle(Vector2{ pos.x, pos.y + padding.y + 9.3f }, 3.1f, Colors::Slider_Progress);
// //DrawFilledCircle(Vector2{ pos.x + slider_size.x, pos.y + padding.y + 9.3f }, 3.1f, Colors::Slider_Idle);
// }
//
//
// //Text
// Vector2 textPos = Vector2{ pos.x, pos.y + 5 };
// TextLeft(name, textPos, Colors::Text, false);
//
// //Empty
// float oneP = slider_size.x / (max - min);
// drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, slider_size.x, slider_size.y, ue::FLinearColor(0.21f, 0.20f, 0.21f, 1.00f));
//
// //Value
// drawFilledRect(Vector2{ pos.x, pos.y + slider_size.y + padding.y }, oneP * (*value - min), slider_size.y, ue::FLinearColor(0.76f, 0.10f, 0.24f, 1.00f));
//
// Vector2 GrabPosition = Vector2(pos.x + oneP * (*value - min), pos.y + slider_size.y + 2.66f + padding.y);
// if (*value != min)
// Draw_Line(Vector2(GrabPosition.x, GrabPosition.y + 5), Vector2(GrabPosition.x, GrabPosition.y - 10), 2.1f, ue::FLinearColor(0.76f, 0.10f, 0.24f, 1.00f));
//
// char buffer[32];
// sprintf_s(buffer, format, *value);
// Vector2 valuePos = Vector2{ pos.x + slider_size.x, pos.y + 5 };
// TextCenter(buffer, valuePos, Colors::Text, false);
//
//
// sameLine = false;
// last_element_pos = pos;
// last_element_size = size;
// if (first_element_pos.x == 0.0f)
// first_element_pos = pos;
// }
//
//
//
// static bool checkbox_enabled[256];
// static void Combobox(char* name, Vector2 size, int* value, const char* arg, ...)
// {
// elements_count++;
//
// Vector2 padding = Vector2{ 5, 10 };
// Vector2 pos = Vector2{ menu_pos.x + padding.x + offset_x, menu_pos.y + padding.y + offset_y };
// if (sameLine)
// {
// pos.x = last_element_pos.x + last_element_size.x + padding.x;
// pos.y = last_element_pos.y;
// }
// if (pushY)
// {
// pos.y = pushYvalue;
// pushY = false;
// pushYvalue = 0.0f;
// offset_y = pos.y - menu_pos.y;
// }
// bool isHovered = MouseInZone(Vector2{ pos.x, pos.y - 15 }, size);
//
// //Bg
// if (isHovered || checkbox_enabled[elements_count])
// {
// drawFilledRect(Vector2{ pos.x, pos.y }, size.x, size.y, Colors::Combobox_Hovered);
//
// hover_element = true;
// }
// else
// {
// drawFilledRect(Vector2{ pos.x, pos.y }, size.x, size.y, Colors::Combobox_Idle);
// }
//
// if (!sameLine)
// offset_y += size.y + padding.y;
//
// //Text
// Vector2 textPos = Vector2{ pos.x + size.x + 5.0f, pos.y/* + size.y / 2*/ };
// TextLeft(name, textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
//
// //Elements
// bool isHovered2 = false;
// Vector2 element_pos = pos;
// int num = 0;
//
// if (checkbox_enabled[elements_count])
// {
// current_element_size.x = element_pos.x - 5.0f;
// current_element_size.y = element_pos.y - 5.0f;
// }
// va_list arguments;
// for (va_start(arguments, arg); arg != NULL; arg = va_arg(arguments, const char*))
// {
// //Selected Element
// if (num == *value)
// {
// Vector2 _textPos = Vector2{ pos.x + 5.0f, pos.y/*+ size.y / 2*/ };
// TextLeft((char*)arg, _textPos, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
// }
//
// if (checkbox_enabled[elements_count])
// {
// element_pos.y += 25.0f;
//
// isHovered2 = MouseInZone(Vector2{ element_pos.x, element_pos.y }, Vector2{ size.x, 25.0f });
// if (isHovered2)
// {
// hover_element = true;
// PostRenderer::drawFilledRect(Vector2{ element_pos.x, element_pos.y }, size.x, 25.0f, Colors::Combobox_Hovered);
//
// //Click
// if (Input::IsMouseClicked(0, elements_count, false))
// {
// *value = num;
// checkbox_enabled[elements_count] = false;
// }
// }
// else
// {
// PostRenderer::drawFilledRect(Vector2{ element_pos.x, element_pos.y }, size.x, 25.0f, Colors::Combobox_Idle);
// }
//
// PostRenderer::TextLeft((char*)arg, Vector2{ element_pos.x + 5.0f, element_pos.y/* + 13.0f*/ }, ue::FLinearColor{ 1.0f, 1.0f, 1.0f, 1.0f }, false);
// }
// num++;
// }
// va_end(arguments);
// if (checkbox_enabled[elements_count])
// {
// current_element_size.x = element_pos.x + 5.0f;
// current_element_size.y = element_pos.y + 5.0f;
// }
//
//