-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrinityMenu.cs
More file actions
1202 lines (1046 loc) · 43 KB
/
TrinityMenu.cs
File metadata and controls
1202 lines (1046 loc) · 43 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
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
using System;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
namespace Trinity
{
/// <summary>
/// Trinity Mod Menu for MDickie's Infinite Lives
/// Clean CS:GO-style cheat menu interface
/// </summary>
public class TrinityMenu : MonoBehaviour
{
// Menu State
private bool _menuVisible = false;
private bool _initialized = false;
// Menu Navigation
private int _currentTab = 0;
private Vector2 _scrollPosition = Vector2.zero;
// Menu Tabs
private readonly string[] _tabs = { "PLAYER", "COMBAT", "WORLD", "MISC" };
// Toggle States - Player
private bool _godMode = false;
private bool _infiniteStamina = false;
private bool _infiniteLives = false;
private bool _superSpeed = false;
private bool _superJump = false;
private bool _invisibility = false;
private bool _noCooldown = false;
// Toggle States - Combat
private bool _oneHitKill = false;
private bool _noRecoil = false;
private bool _rapidFire = false;
private bool _superStrength = false;
private bool _autoBlock = false;
// Toggle States - World
private bool _freezeTime = false;
private bool _unlockAllMaps = false;
private bool _unlockAllChars = false;
private bool _noPolice = false;
// Toggle States - Misc
private bool _infiniteMoney = false;
private bool _espEnabled = false;
private bool _flyMode = false;
private bool _teleportReady = false;
private float _teleportDistance = 10f;
private Vector3 _savedPosition = Vector3.zero;
private int _teleportLocationId = 1;
private int _spawnItemId = 1;
private float _spawnOffset = 2f;
// Names cache
private readonly System.Collections.Generic.Dictionary<int, string> _locationNames = new System.Collections.Generic.Dictionary<int, string>();
// Slider Values
private float _speedMultiplier = 1.0f;
private float _jumpMultiplier = 1.0f;
private float _damageMultiplier = 1.0f;
private int _moneyAmount = 999999;
// UI Colors - CS:GO Style
private readonly Color _bgColor = new Color(0.04f, 0.05f, 0.08f, 0.97f);
private readonly Color _headerColor = new Color(0.07f, 0.08f, 0.11f, 1f);
private readonly Color _accentColor = new Color(0.21f, 0.69f, 0.78f, 1f);
private readonly Color _accentHover = new Color(0.28f, 0.78f, 0.86f, 1f);
private readonly Color _textColor = new Color(0.93f, 0.96f, 0.99f, 1f);
private readonly Color _textDim = new Color(0.6f, 0.65f, 0.74f, 1f);
private readonly Color _toggleOn = new Color(0.21f, 0.69f, 0.78f, 1f);
private readonly Color _toggleOff = new Color(0.22f, 0.24f, 0.3f, 1f);
private readonly Color _tabActive = new Color(0.12f, 0.13f, 0.17f, 1f);
private readonly Color _tabInactive = new Color(0.09f, 0.1f, 0.13f, 1f);
private readonly Color _separatorColor = new Color(0.16f, 0.18f, 0.23f, 1f);
private readonly Color _borderColor = new Color(0.26f, 0.28f, 0.34f, 1f);
private readonly Color _espColor = new Color(0.21f, 0.69f, 0.78f, 1f);
private readonly Color _espBack = new Color(0.05f, 0.07f, 0.1f, 0.7f);
// UI Dimensions
private readonly float _menuWidth = 760f;
private readonly float _menuHeight = 520f;
private float _menuX;
private float _menuY;
// Textures
private Texture2D _bgTexture;
private Texture2D _headerTexture;
private Texture2D _accentTexture;
private Texture2D _toggleOnTexture;
private Texture2D _toggleOffTexture;
private Texture2D _tabActiveTexture;
private Texture2D _tabInactiveTexture;
private Texture2D _separatorTexture;
private Texture2D _sliderBgTexture;
private Texture2D _sliderFillTexture;
private Texture2D _accentHoverTexture;
private Texture2D _panelTexture;
private Texture2D _borderTexture;
private Texture2D _navTexture;
private Texture2D _highlightTexture;
private Texture2D _shadowTexture;
private Texture2D _espDotTexture;
private Texture2D _espBackTexture;
// Styles
private GUIStyle _headerStyle;
private GUIStyle _tabStyle;
private GUIStyle _labelStyle;
private GUIStyle _toggleLabelStyle;
private GUIStyle _valueStyle;
private GUIStyle _buttonStyle;
private GUIStyle _sliderStyle;
private GUIStyle _sliderThumbStyle;
private GUIStyle _espStyle;
void Start()
{
Initialize();
}
void Update()
{
// Toggle menu with INSERT key or F1
if (Input.GetKeyDown(KeyCode.Insert) || Input.GetKeyDown(KeyCode.F1))
{
_menuVisible = !_menuVisible;
}
// Apply cheats every frame when active
ApplyCheats();
// Quick teleport hotkey (optional): Ctrl + T to teleport forward
if (Input.GetKeyDown(KeyCode.T) && (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)))
{
TeleportForward(_teleportDistance);
}
}
private void Initialize()
{
if (_initialized) return;
_menuX = (Screen.width - _menuWidth) / 2f;
_menuY = (Screen.height - _menuHeight) / 2f;
// Create textures
_bgTexture = MakeTexture(2, 2, _bgColor);
_headerTexture = MakeTexture(2, 2, _headerColor);
_accentTexture = MakeTexture(2, 2, _accentColor);
_accentHoverTexture = MakeTexture(2, 2, _accentHover);
_toggleOnTexture = MakeTexture(2, 2, _toggleOn);
_toggleOffTexture = MakeTexture(2, 2, _toggleOff);
_tabActiveTexture = MakeTexture(2, 2, _tabActive);
_tabInactiveTexture = MakeTexture(2, 2, _tabInactive);
_separatorTexture = MakeTexture(2, 2, _separatorColor);
_sliderBgTexture = MakeTexture(2, 2, new Color(0.15f, 0.16f, 0.22f, 1f));
_sliderFillTexture = MakeTexture(2, 2, _accentColor);
_panelTexture = MakeTexture(2, 2, new Color(0.11f, 0.12f, 0.16f, 0.96f));
_borderTexture = MakeTexture(2, 2, _borderColor);
_navTexture = MakeTexture(2, 2, new Color(0.08f, 0.09f, 0.12f, 1f));
_highlightTexture = MakeTexture(2, 2, new Color(1f, 1f, 1f, 0.06f));
_shadowTexture = MakeTexture(2, 2, new Color(0f, 0f, 0f, 0.35f));
_espDotTexture = MakeTexture(2, 2, _espColor);
_espBackTexture = MakeTexture(2, 2, _espBack);
_initialized = true;
Debug.Log("[Trinity] Menu initialized.");
}
private void InitStyles()
{
if (_headerStyle != null) return;
_headerStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 21,
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleLeft,
padding = new RectOffset(4, 0, 0, 0)
};
_headerStyle.normal.textColor = _textColor;
_tabStyle = new GUIStyle(GUI.skin.button)
{
fontSize = 11,
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleCenter
};
_tabStyle.normal.textColor = _textColor;
_tabStyle.hover.textColor = _accentColor;
_tabStyle.normal.background = null;
_tabStyle.hover.background = null;
_tabStyle.active.background = null;
_labelStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 13,
alignment = TextAnchor.MiddleLeft
};
_labelStyle.normal.textColor = _textColor;
_toggleLabelStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 13,
alignment = TextAnchor.MiddleLeft
};
_toggleLabelStyle.normal.textColor = _textColor;
_valueStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 12,
alignment = TextAnchor.MiddleRight
};
_valueStyle.normal.textColor = _accentColor;
_buttonStyle = new GUIStyle(GUI.skin.button)
{
fontSize = 12,
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleCenter
};
_buttonStyle.normal.textColor = Color.white;
_buttonStyle.normal.background = _accentTexture;
_buttonStyle.hover.background = _accentHoverTexture;
_buttonStyle.active.background = _accentTexture;
_sliderStyle = new GUIStyle(GUI.skin.horizontalSlider);
_sliderStyle.normal.background = _sliderBgTexture;
_sliderStyle.fixedHeight = 8f;
_sliderThumbStyle = new GUIStyle(GUI.skin.horizontalSliderThumb);
_sliderThumbStyle.normal.background = _accentTexture;
_sliderThumbStyle.fixedWidth = 14f;
_sliderThumbStyle.fixedHeight = 14f;
_espStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 11,
alignment = TextAnchor.MiddleLeft
};
_espStyle.normal.textColor = _textDim;
}
void OnGUI()
{
Initialize();
InitStyles();
if (_espEnabled)
{
DrawEsp();
}
if (!_menuVisible) return;
Rect windowRect = new Rect(_menuX, _menuY, _menuWidth, _menuHeight);
// subtle shadow
Rect shadowRect = new Rect(windowRect.x + 6f, windowRect.y + 10f, windowRect.width, windowRect.height);
GUI.DrawTexture(shadowRect, _shadowTexture);
GUI.DrawTexture(windowRect, _bgTexture);
GUI.DrawTexture(new Rect(windowRect.x - 2f, windowRect.y - 2f, windowRect.width + 4f, 2f), _borderTexture);
GUI.DrawTexture(new Rect(windowRect.x - 2f, windowRect.y + windowRect.height, windowRect.width + 4f, 2f), _borderTexture);
GUI.DrawTexture(new Rect(windowRect.x - 2f, windowRect.y - 2f, 2f, windowRect.height + 4f), _borderTexture);
GUI.DrawTexture(new Rect(windowRect.x + windowRect.width, windowRect.y - 2f, 2f, windowRect.height + 4f), _borderTexture);
float headerHeight = 58f;
Rect headerRect = new Rect(_menuX, _menuY, _menuWidth, headerHeight);
GUI.DrawTexture(headerRect, _headerTexture);
// top sheen
GUI.DrawTexture(new Rect(headerRect.x, headerRect.y, headerRect.width, 10f), _highlightTexture);
GUI.Label(new Rect(headerRect.x + 16f, headerRect.y + 12f, 260f, 24f), "TRINITY", _headerStyle);
GUIStyle subStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 11,
alignment = TextAnchor.MiddleLeft
};
subStyle.normal.textColor = _textDim;
GUI.Label(new Rect(headerRect.x + 16f, headerRect.y + 32f, 320f, 18f), "Infinite Lives • INSERT / F1 toggles", subStyle);
float navWidth = 190f;
Rect navRect = new Rect(_menuX + 14f, headerRect.yMax + 12f, navWidth, _menuHeight - headerHeight - 26f);
GUI.DrawTexture(navRect, _navTexture);
GUI.DrawTexture(new Rect(navRect.x, navRect.y, navRect.width, 12f), _highlightTexture);
GUILayout.BeginArea(new Rect(navRect.x + 14f, navRect.y + 12f, navRect.width - 28f, navRect.height - 24f));
GUILayout.Space(4f);
for (int i = 0; i < _tabs.Length; i++)
{
bool active = i == _currentTab;
Rect btnRect = GUILayoutUtility.GetRect(navRect.width - 28f, 34f, GUILayout.ExpandWidth(true));
btnRect.height = 32f;
GUI.DrawTexture(btnRect, active ? _tabActiveTexture : _tabInactiveTexture);
if (active)
{
GUI.DrawTexture(new Rect(btnRect.x, btnRect.y, 4f, btnRect.height), _accentTexture);
}
GUIStyle navStyle = new GUIStyle(_tabStyle)
{
fontSize = 12,
alignment = TextAnchor.MiddleLeft,
padding = new RectOffset(14, 0, 0, 0)
};
navStyle.normal.textColor = active ? _textColor : _textDim;
string tabLabel = $"● {_tabs[i]}";
if (GUI.Button(btnRect, tabLabel, navStyle))
{
_currentTab = i;
}
GUILayout.Space(6f);
}
GUILayout.EndArea();
Rect contentRect = new Rect(navRect.xMax + 14f, headerRect.yMax + 12f, _menuWidth - navWidth - 34f, _menuHeight - headerHeight - 26f);
GUI.DrawTexture(contentRect, _panelTexture);
GUILayout.BeginArea(new Rect(contentRect.x + 18f, contentRect.y + 18f, contentRect.width - 36f, contentRect.height - 36f));
_scrollPosition = GUILayout.BeginScrollView(_scrollPosition, GUILayout.Width(contentRect.width - 36f), GUILayout.Height(contentRect.height - 36f));
switch (_currentTab)
{
case 0: DrawPlayerTab(); break;
case 1: DrawCombatTab(); break;
case 2: DrawWorldTab(); break;
case 3: DrawMiscTab(); break;
}
GUILayout.EndScrollView();
GUILayout.EndArea();
// Footer info strip
GUIStyle footerStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 9,
alignment = TextAnchor.MiddleCenter
};
footerStyle.normal.textColor = new Color(0.4f, 0.4f, 0.45f, 1f);
GUI.Label(new Rect(_menuX, _menuY + _menuHeight - 28f, _menuWidth, 16f), $"Location: {GetLocationName(World.location)} • Cheats Active: {GetActiveCheatCount()} • FPS: {Mathf.RoundToInt(1f / Time.deltaTime)}", footerStyle);
GUI.Label(new Rect(_menuX, _menuY + _menuHeight - 14f, _menuWidth, 16f), "Trinity v1.0 | Build 2025", footerStyle);
}
private void DrawPlayerTab()
{
DrawSectionHeader("SURVIVABILITY");
_godMode = DrawToggle("God Mode", _godMode, "Take no damage");
_infiniteStamina = DrawToggle("Infinite Stamina", _infiniteStamina, "Never get tired");
_infiniteLives = DrawToggle("Infinite Lives", _infiniteLives, "Unlimited respawns");
DrawSeparator();
DrawSectionHeader("MOVEMENT");
_superSpeed = DrawToggle("Super Speed", _superSpeed, "Move faster");
_speedMultiplier = DrawSlider("Speed Multiplier", _speedMultiplier, 1f, 5f);
_superJump = DrawToggle("Super Jump", _superJump, "Jump higher");
_jumpMultiplier = DrawSlider("Jump Multiplier", _jumpMultiplier, 1f, 5f);
_flyMode = DrawToggle("Fly Mode", _flyMode, "Hold SPACE to fly");
DrawSeparator();
DrawSectionHeader("STEALTH");
_invisibility = DrawToggle("Invisibility", _invisibility, "NPCs can't see you");
DrawSeparator();
if (DrawButton("MAX ALL STATS"))
{
MaxAllStats();
}
if (DrawButton("FULL HEAL"))
{
FullHeal();
}
}
private void DrawCombatTab()
{
DrawSectionHeader("OFFENSE");
_oneHitKill = DrawToggle("One Hit Kill", _oneHitKill, "Kill enemies instantly");
_superStrength = DrawToggle("Super Strength", _superStrength, "Deal massive damage");
_damageMultiplier = DrawSlider("Damage Multiplier", _damageMultiplier, 1f, 10f);
DrawSeparator();
DrawSectionHeader("WEAPONS");
_rapidFire = DrawToggle("Rapid Fire", _rapidFire, "No weapon cooldown");
_noRecoil = DrawToggle("No Recoil", _noRecoil, "Perfect accuracy");
_noCooldown = DrawToggle("No Cooldown", _noCooldown, "Abilities ready instantly");
DrawSeparator();
DrawSectionHeader("DEFENSE");
_autoBlock = DrawToggle("Auto Block", _autoBlock, "Automatically block attacks");
DrawSeparator();
if (DrawButton("KILL ALL ENEMIES"))
{
KillAllEnemies();
}
}
private void DrawWorldTab()
{
DrawSectionHeader("TIME");
_freezeTime = DrawToggle("Freeze Time", _freezeTime, "Stop the clock");
DrawSeparator();
DrawSectionHeader("UNLOCKS");
_unlockAllMaps = DrawToggle("Unlock All Maps", _unlockAllMaps, "Access all locations");
_unlockAllChars = DrawToggle("Unlock All Characters", _unlockAllChars, "Play as anyone");
DrawSeparator();
DrawSectionHeader("WORLD CONTROL");
_noPolice = DrawToggle("No Police", _noPolice, "Disable law enforcement");
DrawSeparator();
DrawSectionHeader("TELEPORT");
_teleportDistance = DrawSlider("Forward Distance", _teleportDistance, 1f, 50f);
GUILayout.BeginHorizontal();
if (DrawButton("TELEPORT FORWARD"))
{
TeleportForward(_teleportDistance);
}
if (DrawButton("SAVE POSITION"))
{
SavePosition();
}
if (DrawButton("LOAD POSITION"))
{
LoadPosition();
}
GUILayout.EndHorizontal();
string locName = GetLocationName(_teleportLocationId);
_teleportLocationId = (int)DrawSlider($"Location ID ({locName})", _teleportLocationId, 0, 65);
if (DrawButton("TELEPORT TO LOCATION ID"))
{
TeleportToLocation(_teleportLocationId);
}
if (DrawButton("TELEPORT TO NEAREST PLAYER"))
{
TeleportToNearestPlayer();
}
if (DrawButton("TELEPORT TO HOME"))
{
TeleportHome();
}
if (DrawButton("CLEAR WANTED LEVEL"))
{
ClearWanted();
}
DrawSeparator();
DrawSectionHeader("ITEM SPAWNER");
string itemName = GetItemName(_spawnItemId);
_spawnItemId = (int)DrawSlider($"Item ID ({itemName})", _spawnItemId, 1, 150);
_spawnOffset = DrawSlider("Spawn Offset", _spawnOffset, 0f, 10f);
GUILayout.BeginHorizontal();
if (DrawButton("SPAWN AT PLAYER"))
{
SpawnItemAtPlayer(_spawnItemId, 0f);
}
if (DrawButton("SPAWN IN FRONT"))
{
SpawnItemAtPlayer(_spawnItemId, _spawnOffset);
}
GUILayout.EndHorizontal();
}
private void DrawMiscTab()
{
DrawSectionHeader("ECONOMY");
_infiniteMoney = DrawToggle("Infinite Money", _infiniteMoney, "Never run out of cash");
_moneyAmount = (int)DrawSlider("Set Money", _moneyAmount, 0, 9999999);
if (DrawButton("ADD $10,000"))
{
AddMoney(10000);
}
if (DrawButton("ADD $100,000"))
{
AddMoney(100000);
}
DrawSeparator();
DrawSectionHeader("VISUALS");
_espEnabled = DrawToggle("ESP / Wallhack", _espEnabled, "See through walls");
DrawSeparator();
DrawSectionHeader("HOTKEYS");
DrawLabel("INSERT / F1 - Toggle Menu");
DrawLabel("God Mode applies automatically");
DrawSeparator();
if (DrawButton("RESET ALL SETTINGS"))
{
ResetAllSettings();
}
}
#region UI Drawing Helpers
private void DrawSectionHeader(string text)
{
GUIStyle sectionStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 11,
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleLeft
};
sectionStyle.normal.textColor = _accentColor;
GUILayout.Space(8f);
GUILayout.Label(text, sectionStyle);
GUILayout.Space(4f);
}
private bool DrawToggle(string label, bool value, string tooltip = "")
{
GUILayout.BeginHorizontal();
// Toggle box
Rect toggleRect = GUILayoutUtility.GetRect(24f, 20f, GUILayout.Width(24f));
GUI.DrawTexture(toggleRect, value ? _toggleOnTexture : _toggleOffTexture);
if (value)
{
// Checkmark
GUIStyle checkStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 14,
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleCenter
};
checkStyle.normal.textColor = Color.white;
GUI.Label(toggleRect, "X", checkStyle);
}
// Label
GUILayout.Space(8f);
GUIStyle lblStyle = new GUIStyle(_toggleLabelStyle);
lblStyle.normal.textColor = value ? _textColor : _textDim;
GUILayout.Label(label, lblStyle, GUILayout.Width(150f));
// Tooltip
if (!string.IsNullOrEmpty(tooltip))
{
GUIStyle tipStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 10,
alignment = TextAnchor.MiddleLeft
};
tipStyle.normal.textColor = new Color(0.5f, 0.5f, 0.55f, 1f);
GUILayout.Label(tooltip, tipStyle);
}
GUILayout.EndHorizontal();
// Handle click on toggle box
if (Event.current.type == EventType.MouseDown && toggleRect.Contains(Event.current.mousePosition))
{
value = !value;
Event.current.Use();
}
GUILayout.Space(2f);
return value;
}
private float DrawSlider(string label, float value, float min, float max)
{
GUILayout.BeginHorizontal();
GUILayout.Label(label, _labelStyle, GUILayout.Width(130f));
value = GUILayout.HorizontalSlider(value, min, max, _sliderStyle, _sliderThumbStyle, GUILayout.Width(180f));
GUILayout.Space(10f);
GUILayout.Label(value.ToString("F1"), _valueStyle, GUILayout.Width(50f));
GUILayout.EndHorizontal();
GUILayout.Space(4f);
return value;
}
private void DrawLabel(string text)
{
GUIStyle infoStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 11,
alignment = TextAnchor.MiddleLeft
};
infoStyle.normal.textColor = _textDim;
GUILayout.Label(" " + text, infoStyle);
GUILayout.Space(2f);
}
private bool DrawButton(string text)
{
GUILayout.Space(4f);
bool clicked = GUILayout.Button(text, _buttonStyle, GUILayout.Height(28f));
GUILayout.Space(2f);
return clicked;
}
private void DrawSeparator()
{
GUILayout.Space(8f);
Rect sepRect = GUILayoutUtility.GetRect(_menuWidth - 60f, 1f);
GUI.DrawTexture(sepRect, _separatorTexture);
GUILayout.Space(8f);
}
private Texture2D MakeTexture(int width, int height, Color color)
{
Color[] pixels = new Color[width * height];
for (int i = 0; i < pixels.Length; i++)
{
pixels[i] = color;
}
Texture2D texture = new Texture2D(width, height);
texture.SetPixels(pixels);
texture.Apply();
return texture;
}
#endregion
#region Cheat Functions
private void ApplyCheats()
{
try
{
// Check if game objects exist
if (Players.gaq <= 0 || Players.gas == null || Players.gas.Length <= Players.gaq || Players.gas[Players.gaq] == null)
return;
Player player = Players.gas[Players.gaq];
if (Characters.star <= 0 || Characters.c == null || Characters.c.Length <= Characters.star)
return;
Character character = Characters.c[Characters.star];
// God Mode
if (_godMode)
{
player.fnn = player.fno;
player.fnp = 100f;
}
// Infinite Stamina
if (_infiniteStamina)
{
player.fnu = 1000f;
player.fnv = 1000f;
}
// Infinite Lives
if (_infiniteLives)
{
Progress.lives = 999;
}
// Super Speed
if (_superSpeed && character.stat != null)
{
character.stat[1] = 100f * _speedMultiplier;
}
// Super Jump
if (_superJump && character.stat != null)
{
character.stat[3] = 100f * _jumpMultiplier;
}
// Invisibility
if (_invisibility)
{
character.visibility = 0f;
}
else if (character.visibility == 0f)
{
character.visibility = 1f;
}
// One Hit Kill
if (_oneHitKill && character.stat != null)
{
character.stat[2] = 999f;
}
// Super Strength
if (_superStrength && !_oneHitKill && character.stat != null)
{
character.stat[2] = 100f * _damageMultiplier;
}
// Freeze Time
if (_freezeTime)
{
Progress.clockSpeed = 0f;
}
else if (Progress.clockSpeed == 0f)
{
Progress.clockSpeed = 30f;
}
// Infinite Money
if (_infiniteMoney)
{
Progress.bank = _moneyAmount;
Progress.showBank = Progress.bank;
}
// Unlock All Maps
if (_unlockAllMaps && Progress.mapUnlock != null)
{
for (int i = 0; i < Progress.mapUnlock.Length; i++)
{
Progress.mapUnlock[i] = 2;
}
}
// Unlock All Characters
if (_unlockAllChars && Progress.charUnlock != null)
{
for (int i = 0; i < Progress.charUnlock.Length; i++)
{
Progress.charUnlock[i] = 2;
}
}
// No Police
if (_noPolice)
{
character.warrant = 0;
character.crime = 0;
Progress.offences = 0;
}
// Fly Mode
if (_flyMode && Input.GetKey(KeyCode.Space))
{
player.fmp += 0.5f;
}
// No Cooldown
if (_noCooldown)
{
player.fvx = 0f;
}
// Super stats in super mode
if (character.transform > 0 && character.superStat != null)
{
if (_superStrength || _oneHitKill)
{
for (int i = 1; i < character.superStat.Length; i++)
{
character.superStat[i] = 200f;
}
}
}
}
catch (Exception)
{
// Silently handle - game state not ready
}
}
private void MaxAllStats()
{
try
{
if (Characters.star <= 0 || Characters.c == null) return;
Character character = Characters.c[Characters.star];
if (character.stat != null)
{
for (int i = 1; i < character.stat.Length; i++)
{
character.stat[i] = 100f;
}
}
if (character.superStat != null)
{
for (int i = 1; i < character.superStat.Length; i++)
{
character.superStat[i] = 200f;
}
}
Debug.Log("[Trinity] All stats maxed!");
}
catch (Exception) { }
}
private void FullHeal()
{
try
{
if (Players.gaq <= 0 || Players.gas == null) return;
Player player = Players.gas[Players.gaq];
if (Characters.star <= 0 || Characters.c == null) return;
Character character = Characters.c[Characters.star];
player.fnn = player.fno;
player.fnp = 100f;
player.fnu = player.fnv;
character.health = 100f;
character.spirit = 100f;
character.injury = 0;
Debug.Log("[Trinity] Fully healed!");
}
catch (Exception) { }
}
private void KillAllEnemies()
{
try
{
if (Players.gas == null) return;
int killed = 0;
for (int i = 1; i <= Players.gal && i < Players.gas.Length; i++)
{
if (i != Players.gaq && Players.gas[i] != null)
{
Player enemy = Players.gas[i];
if (enemy.fme != Characters.star)
{
enemy.fnn = 0f;
enemy.fnm = 1;
killed++;
}
}
}
Debug.Log("[Trinity] Killed " + killed + " enemies!");
}
catch (Exception) { }
}
private void TeleportHome()
{
try
{
if (Characters.star <= 0 || Characters.c == null) return;
Character character = Characters.c[Characters.star];
if (character.home > 0)
{
World.location = character.home;
Debug.Log("[Trinity] Teleported to home!");
}
}
catch (Exception) { }
}
private void ClearWanted()
{
try
{
if (Characters.star <= 0 || Characters.c == null) return;
Character character = Characters.c[Characters.star];
character.warrant = 0;
character.crime = 0;
character.warrantVictim = 0;
character.warrantWitness = 0;
Progress.offences = 0;
Progress.detention = 0;
Debug.Log("[Trinity] Wanted level cleared!");
}
catch (Exception) { }
}
private void AddMoney(int amount)
{
try
{
Progress.bank += amount;
Progress.showBank = Progress.bank;
Debug.Log("[Trinity] Added $" + amount + "!");
}
catch (Exception) { }
}
private void ResetAllSettings()
{
_godMode = false;
_infiniteStamina = false;
_infiniteLives = false;
_superSpeed = false;
_superJump = false;
_invisibility = false;
_noCooldown = false;
_oneHitKill = false;
_noRecoil = false;
_rapidFire = false;
_superStrength = false;
_autoBlock = false;
_freezeTime = false;
_unlockAllMaps = false;
_unlockAllChars = false;
_noPolice = false;
_infiniteMoney = false;
_espEnabled = false;
_flyMode = false;
_speedMultiplier = 1.0f;
_jumpMultiplier = 1.0f;
_damageMultiplier = 1.0f;
Debug.Log("[Trinity] All settings reset!");
}
private int GetActiveCheatCount()
{
bool[] toggles =
{
_godMode,
_infiniteStamina,
_infiniteLives,
_superSpeed,
_superJump,
_invisibility,
_noCooldown,
_oneHitKill,
_noRecoil,
_rapidFire,
_superStrength,
_autoBlock,
_freezeTime,
_unlockAllMaps,
_unlockAllChars,
_noPolice,
_infiniteMoney,
_espEnabled,
_flyMode
};
return toggles.Count(t => t);
}
private void TeleportForward(float distance)
{
try
{
Transform t = GetPlayerTransform();
if (t == null) return;
Vector3 forward = t.forward;
forward.y = 0f;
if (forward.sqrMagnitude < 0.001f) forward = Vector3.forward;
forward.Normalize();
t.position += forward * distance;
Debug.Log($"[Trinity] Teleported forward {distance:0.0}m");
}
catch (Exception) { }
}
private Transform GetRootTransform(Player player)
{
try
{
if (player == null || player.fsx == null || player.fsx.Length == 0) return null;
for (int i = 0; i < player.fsx.Length; i++)
{
var go = player.fsx[i];
if (go != null) return go.transform;
}
return null;
}
catch (Exception)
{
return null;
}
}
private bool TryGetPlayerPosition(Player player, out Vector3 pos)
{
pos = Vector3.zero;
try
{
Transform t = GetRootTransform(player);
if (t != null)
{
pos = t.position;
return true;
}
if (player != null)
{
pos = new Vector3(player.fmo, player.fmp, player.fmq);
if (!float.IsNaN(pos.x) && !float.IsNaN(pos.y) && !float.IsNaN(pos.z))
return true;
}
}