-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.cs
847 lines (719 loc) · 34.2 KB
/
Plugin.cs
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
using BepInEx;
using UnityEngine;
using UnityEngine.InputSystem;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Reflection;
namespace ChurnVectorCheats
{
[BepInPlugin("husko.churnvector.cheats", "Churn Vector Cheats", MyPluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
private enum Tab
{
MainCheats,
SpecialCheats,
InteractiveSpots
}
private Tab _currentTab = Tab.MainCheats;
private bool _showMenu;
private Rect _menuRect = new(20, 20, 330, 240); // Initial position and size of the menu
// Define separate arrays to store activation status for each tab
private readonly bool[] _mainCheatsActivated = new bool[8];
private readonly bool[] _specialCheatsActivated = new bool[2]; // Adjust the size as per your requirement
private readonly bool[] _interactiveSpotsActivated = new bool[2];
// Default max values
private int _breedingStandUses = 3;
private int _gloryHoleUses = 1;
private int _plushyUses = 1;
private float _inflationLevel; // Variable to track inflation level
private const string VersionLabel = MyPluginInfo.PLUGIN_VERSION;
private static bool _invertDressed = true;
private static bool _invertSee = true;
private GameObject _orbitCameraObject;
private MonoBehaviour _orbitCameraComponent;
private bool _cursorLockCodeExecuted = false; // Add boolean flag to track cursor lock code execution
// List to store button labels and corresponding actions for the current cheats tab
private readonly List<(string label, Action action)> _mainCheatsButtonActions = new()
{
("Toggle Doors", ToggleDoorObjects),
("Toggle Sky and Fog", ToggleSkyAndFogObjects),
("Toggle Ball Colliders", ToggleBallColliders),
("Toggle Character Clothes", ToggleCharacterClothes),
("Toggle Character Visibility", ToggleCharacterVisibility),
// Add more buttons and actions here
};
// Modify the ghostModeButtonActions list to include a button for Special Cheats
private readonly List<(string label, Action action)> _specialCheatsButtonActions = new()
{
("Flying Ghost Cock", ToggleFlyingGhostCock),
("Continous Cumming", ToggleContinuousCumming),
// Add more buttons for Special Cheats here
};
/// <summary>
/// Initializes the plugin on Awake event
/// </summary>
private void Awake()
{
// Log the plugin's version number and successful startup
Logger.LogInfo($"Plugin Churn Vector Cheats v{VersionLabel} loaded!");
}
/// <summary>
/// Handles toggling the menu on and off with the Insert or F1 key.
/// </summary>
private void Update()
{
// Toggle menu visibility with Insert or F1 key
if (Keyboard.current.insertKey.wasPressedThisFrame || Keyboard.current.f1Key.wasPressedThisFrame)
{
_showMenu = !_showMenu;
if (!_showMenu) // If menu is closed
{
_cursorLockCodeExecuted = false; // Reset cursor lock code execution flag
}
UpdateCursorState(); // Update cursor state when menu visibility changes
}
}
// Method to update cursor state based on menu visibility
void UpdateCursorState()
{
if (_showMenu)
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
else
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
}
/// <summary>
/// Handles drawing the menu and all of its elements on the screen.
/// </summary>
private void OnGUI()
{
// Only draw the menu if it's supposed to be shown
if (_showMenu)
{
// Find the GameObject with the name "OrbitCamera" if not found already
if (_orbitCameraObject == null)
{
_orbitCameraObject = GameObject.Find("OrbitCamera");
}
// Find the component named "OrbitCamera" inside the orbitCameraObject if not found already
if (_orbitCameraObject != null && _orbitCameraComponent == null)
{
_orbitCameraComponent = _orbitCameraObject.GetComponent("OrbitCamera") as MonoBehaviour;
}
// Disable the OrbitCamera component when the menu is open
if (_orbitCameraComponent != null)
{
_orbitCameraComponent.enabled = false;
}
// Update cursor state when menu visibility changes
UpdateCursorState();
// Apply dark mode GUI style
GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
// Draw the IMGUI window
_menuRect = GUI.Window(0, _menuRect, MenuWindow, "----< Cheats Menu >----");
// Calculate position for version label at bottom left corner
float versionLabelX = _menuRect.xMin + 10; // 10 pixels from left edge
float versionLabelY = _menuRect.yMax - 20; // 20 pixels from bottom edge
// Draw version label at bottom left corner
GUI.contentColor = new Color(0.5f, 0.5f, 0.5f); // Dark grey silver color
GUI.Label(new Rect(versionLabelX, versionLabelY, 100, 20), "v" + VersionLabel);
// Calculate the width of the author label
float authorLabelWidth = GUI.skin.label.CalcSize(new GUIContent("by Official-Husko")).x + 10; // Add some extra width for padding
// Calculate position for author label at bottom right corner
float authorLabelX = _menuRect.xMax - authorLabelWidth; // 10 pixels from right edge
float authorLabelY = versionLabelY + 2; // Align with version label
// Draw the author label as a clickable label
if (GUI.Button(new Rect(authorLabelX, authorLabelY, authorLabelWidth, 20), "<color=cyan>by</color> <color=yellow>Official-Husko</color>", GUIStyle.none))
{
// Open a link in the user's browser when the label is clicked
Application.OpenURL("https://github.com/Official-Husko/Churn-Vector-Cheats");
}
}
else
{
// Enable the OrbitCamera component when the menu is closed
if (_orbitCameraComponent != null)
{
_orbitCameraComponent.enabled = true;
}
// Lock the cursor and hide it when the menu is closed
if (!_cursorLockCodeExecuted) // Check if cursor lock code was not executed yet
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
_cursorLockCodeExecuted = true; // Set cursor lock code execution flag
}
}
}
/// <summary>
/// Handles the GUI for the main menu
/// </summary>
/// <param name="windowID">The ID of the window</param>
private void MenuWindow(int windowID)
{
// Make the whole window draggable
GUI.DragWindow(new Rect(0, 0, _menuRect.width, 20));
// Begin a vertical group for menu elements
GUILayout.BeginVertical();
// Draw tabs
GUILayout.BeginHorizontal();
// Draw the Main Cheats tab button
DrawTabButton(Tab.MainCheats, "Main Cheats");
// Draw the Special Cheats tab button
DrawTabButton(Tab.SpecialCheats, "Special Cheats");
// Draw Interactive Spots tab button
DrawTabButton(Tab.InteractiveSpots, "Interactive Spots");
GUILayout.EndHorizontal();
// Draw content based on the selected tab
switch (_currentTab)
{
// Draw the Main Cheats tab
case Tab.MainCheats:
DrawMainCheatsTab();
break;
// Draw the Special Cheats tab
case Tab.SpecialCheats:
DrawSpecialCheatsTab();
break;
// Draw the Interactive Spots tab
case Tab.InteractiveSpots:
DrawInteractiveSpotsTab();
break;
}
// End the vertical group
GUILayout.EndVertical();
}
/// <summary>
/// Draws a tab button
/// </summary>
/// <param name="tab">The tab to draw</param>
/// <param name="label">The label to display on the button</param>
private void DrawTabButton(Tab tab, string label)
{
// Change background color based on the selected tab
GUI.backgroundColor = _currentTab == tab ? Color.grey : Color.white;
// If the button is clicked, set the current tab to the clicked tab
if (GUILayout.Button(label))
{
_currentTab = tab;
}
}
/// <summary>
/// Gets the activation status array for the currently selected tab
/// </summary>
/// <returns>The activation status array for the current tab. If the tab is not recognized, null is returned.</returns>
private bool[] GetCurrentTabActivationArray()
{
switch (_currentTab)
{
case Tab.MainCheats:
// Return the activation status array for the main cheats tab
return _mainCheatsActivated;
case Tab.SpecialCheats:
// Return the activation status array for the special cheats tab
return _specialCheatsActivated;
case Tab.InteractiveSpots:
// Return the activation status array for the interactive spots tab
return _interactiveSpotsActivated;
default:
// If the tab is not recognized, return null
return null;
}
}
/// <summary>
/// Toggles the activation state of the button at the given index on the currently selected tab.
/// If the index is not within the range of the activation status array for the current tab, nothing is done.
/// </summary>
/// <param name="buttonIndex">The index of the button to toggle activation status for</param>
private void ToggleButtonActivation(int buttonIndex)
{
// Get the activation status array for the current tab. If the tab is not recognized, return.
bool[] currentTabActivationArray = GetCurrentTabActivationArray();
if (currentTabActivationArray == null)
{
return;
}
// If the index is within the range of the activation status array, toggle the activation status
if (buttonIndex >= 0 && buttonIndex < currentTabActivationArray.Length)
{
currentTabActivationArray[buttonIndex] = !currentTabActivationArray[buttonIndex];
}
}
/// <summary>
/// Method to draw content for the Main Cheats tab
/// </summary>
private void DrawMainCheatsTab()
{
GUILayout.BeginVertical();
// Draw buttons from the list
for (int i = 0; i < _mainCheatsButtonActions.Count; i++)
{
GUILayout.BeginHorizontal();
DrawActivationDot(_mainCheatsActivated[i]); // Draw activation dot based on activation status
// Draws a button for each cheat with the label,
// activation status, and invokes the action associated
// with the button when pressed
if (GUILayout.Button(_mainCheatsButtonActions[i].label))
{
ToggleButtonActivation(i); // Toggle activation status
_mainCheatsButtonActions[i].action.Invoke(); // Invoke the action associated with the button
}
GUILayout.EndHorizontal();
}
GUILayout.EndVertical();
}
/// <summary>
/// Draws the Special Cheats tab in the mod's UI
/// </summary>
private void DrawSpecialCheatsTab()
{
// Begin vertical layout for the tab
GUILayout.BeginVertical();
// Iterate through the list of special cheat buttons
for (int i = 0; i < _specialCheatsButtonActions.Count; i++)
{
// Begin horizontal layout for the button row
GUILayout.BeginHorizontal();
// Draw an activation dot based on the activation status
DrawActivationDot(_specialCheatsActivated[i]);
// Draw a button for the special cheat
if (GUILayout.Button(_specialCheatsButtonActions[i].label))
{
// Toggle the activation status of the button
ToggleButtonActivation(i);
// Invoke the action associated with the button
_specialCheatsButtonActions[i].action.Invoke();
}
// End the horizontal layout for the button row
GUILayout.EndHorizontal();
}
// Draws an option to toggle and edit inflation
DrawInflationOption();
// End the vertical layout for the tab
GUILayout.EndVertical();
}
// Draws the Interactive Spots tab in the mod's UI
private void DrawInteractiveSpotsTab()
{
// Draws an option to toggle and edit breeding stands uses
DrawBreedingStandUsesOption();
// Draws an option to toggle and edit glory hole uses
DrawGloryHoleUsesOption();
// Draws an option to toggle and edit plushy uses
DrawPlushyUsesOption();
}
/// <summary>
/// Handles button click for toggling doors in the scene
/// </summary>
private static void ToggleDoorObjects()
{
// Debug log the action being performed
Debug.Log("Toggle Doors");
// Pattern to match door GameObjects
// Allows for door names to have optional (N) at the end, where N is a number
string doorPattern = "DoorPrefab(\\s*\\(\\d+\\))*";
// Find all GameObjects in the scene, including inactive ones
GameObject[] allObjects = Resources.FindObjectsOfTypeAll<GameObject>();
// Iterate through all GameObjects in the scene
foreach (GameObject obj in allObjects)
{
// Check if the name of the GameObject matches the pattern
if (Regex.IsMatch(obj.name, doorPattern))
{
// Toggle the active state of the GameObject
obj.SetActive(!obj.activeSelf);
}
}
}
/// <summary>
/// Handles button click for toggling sky and fog objects in the scene
/// </summary>
private static void ToggleSkyAndFogObjects()
{
// Debug log the action being performed
Debug.Log("Toggle Sky and Fog");
// Pattern to match sky and fog GameObjects
string skyAndFogPattern = "Sky and Fog Volume";
// Find all GameObjects in the scene, including inactive ones
GameObject[] allObjects = Resources.FindObjectsOfTypeAll<GameObject>();
foreach (GameObject obj in allObjects)
{
// Check if the name of the GameObject matches the pattern
if (obj.name.Contains(skyAndFogPattern))
{
// Toggle the active state of the GameObject
obj.SetActive(!obj.activeSelf);
}
}
}
/// <summary>
/// Handles button click for toggling balls collision
/// </summary>
private static void ToggleBallColliders()
{
// Debug log the action being performed
Debug.Log("Toggle Balls Collision");
// Pattern to match ball GameObjects
string ballPattern = "Balls";
// Find all GameObjects in the scene, including inactive ones
GameObject[] allObjects = Resources.FindObjectsOfTypeAll<GameObject>();
foreach (GameObject obj in allObjects)
{
// Check if the name of the GameObject matches the pattern
if (Regex.IsMatch(obj.name, ballPattern))
{
// Get the collider component attached to the GameObject
Collider collider = obj.GetComponent<Collider>();
// If the collider component exists
if (collider != null)
{
// Toggle the enabled state of the collider
collider.enabled = !collider.enabled;
}
}
}
}
/// <summary>
/// Toggles the visibility of the clothes on all characters in the scene
/// </summary>
private static void ToggleCharacterClothes()
{
// Debug log the action being performed
Debug.Log("Toggle Character Clothes");
// Find all CharacterAnimatorControllers in the scene
CharacterAnimatorController[] characterControllers = FindObjectsOfType<CharacterAnimatorController>();
// Loop through each controller and toggle the clothes visibility
foreach (CharacterAnimatorController controller in characterControllers)
{
if (controller != null)
{
// Invert the state of the clothes visibility if the _invertDressed flag is set
controller.SetClothes(!_invertDressed);
}
}
// Toggle the _invertDressed flag to keep track of the current state
_invertDressed = !_invertDressed;
}
/// <summary>
/// Toggles the visibility of all characters in the scene
/// </summary>
private static void ToggleCharacterVisibility()
{
// Debug log the action being performed
Debug.Log("Toggle Character Visibility");
// Find all CharacterDetectors in the scene
CharacterDetector[] characterDetectors = FindObjectsOfType<CharacterDetector>();
// Loop through each CharacterDetector and toggle the visibility setting
foreach (CharacterDetector detector in characterDetectors)
{
if (detector != null)
{
// Invert the current visibility setting when toggling
detector.SetIgnorePlayer(_invertSee);
}
}
// Toggle the _invertSee flag to keep track of the current state
_invertSee = !_invertSee;
}
/// <summary>
/// Toggles the number of uses each breeding stand can be used
/// </summary>
private void ToggleBreedingStandUses()
{
// Debug log the action being performed
Debug.Log("Toggle Breeding Stand Uses");
// Find all breeding stands in the scene
BreedingStand[] breedingStands = FindObjectsOfType<BreedingStand>();
// Loop through each breeding stand and adjust its number of uses
foreach (BreedingStand stand in breedingStands)
{
var type = stand.GetType();
// Get a reference to the field that stores the number of uses
var field = type.GetField("condomsAllowedUntilBreak", BindingFlags.Instance | BindingFlags.NonPublic);
// If the field exists and is of the correct type, set its value
if (field != null && field.FieldType == typeof(int))
{
field.SetValue(stand, _breedingStandUses);
}
}
}
/// <summary>
/// Toggles the number of uses each glory hole can be used.
///
/// This method finds all glory holes in the scene and modifies their number of uses
/// to match the value of _gloryHoleUses.
/// </summary>
private void ToggleGloryHoleUses()
{
// Debug log the action being performed
Debug.Log("Toggle Glory Hole Uses");
// Find all glory holes in the scene
GloryHole[] gloryHoles = FindObjectsOfType<GloryHole>();
// Loop through each glory hole and adjust its number of uses
foreach (GloryHole stand in gloryHoles)
{
var type = stand.GetType();
// Get a reference to the field that stores the number of uses
var field = type.GetField("condomsAllowedUntilBreak", BindingFlags.Instance | BindingFlags.NonPublic);
// If the field exists and is of the correct type, set its value
if (field != null && field.FieldType == typeof(int))
{
field.SetValue(stand, _gloryHoleUses);
}
}
}
/// <summary>
/// Handles button click for toggling Plushy Uses.
/// </summary>
private void TogglePlushyUses()
{
// Debug log the action being performed
Debug.Log("Toggle Plushy Uses");
// Find all plushies in the scene
PlushFuckStation[] plushies = FindObjectsOfType<PlushFuckStation>();
// Loop through each plushing and adjust its number of uses
foreach (PlushFuckStation stand in plushies)
{
var type = stand.GetType();
// Get a reference to the field that stores the number of uses
// This field is declared as private and non-public in PlushFuckStation.cs
var field = type.GetField("condomsAllowedUntilBreak", BindingFlags.Instance | BindingFlags.NonPublic);
// If the field exists and is of the correct type, set its value
if (field != null && field.FieldType == typeof(int))
{
// Set the number of uses to the configured value
field.SetValue(stand, _plushyUses);
}
}
}
/// <summary>
/// Handles button click for toggling Flying Ghost Cock.
/// </summary>
private static void ToggleFlyingGhostCock()
{
// Debug log the action being performed
Debug.Log("Toggle Flying Ghost Cock");
// Find the player object in the scene
GameObject player = GameObject.Find("Player(Clone)");
if (player == null)
{
return;
}
// Find the "Gradual transform test" object under the player
Transform gradualTransformTest = player.transform.Find("Gradual transform test");
if (gradualTransformTest == null)
{
return;
}
// Enable/disable the "Body" child object of the "Gradual transform test" object
Transform bodyTransform = gradualTransformTest.Find("Body");
if (bodyTransform != null)
{
bodyTransform.gameObject.SetActive(!bodyTransform.gameObject.activeSelf);
}
}
/// <summary>
/// Toggles the continuous cumming for the player's Dick.
/// </summary>
private static void ToggleContinuousCumming()
{
// Debug log the action being performed
Debug.Log("Toggle Continuous Cumming");
// Find the player object in the scene
GameObject player = GameObject.Find("Player(Clone)");
if (player != null)
{
// Get the DickCum component attached to the player object
DickCum dickCum = player.GetComponent<DickCum>();
if (dickCum != null)
{
// Use reflection to access the private 'cumming' field and toggle its value
FieldInfo field = dickCum.GetType().GetField("cumming", BindingFlags.NonPublic | BindingFlags.Instance);
if (field != null)
{
// Get the current value of the 'cumming' field
bool cummingValue = (bool)field.GetValue(dickCum);
// Set the new value of the 'cumming' field
field.SetValue(dickCum, !cummingValue);
}
}
}
}
/// <summary>
/// Draws a small dot with a green color if the activation status is true, and red if it's false.
/// This method uses the current tab activation status array to determine the dot color.
/// </summary>
/// <param name="activated">The activation status to determine the dot color.</param>
private void DrawActivationDot(bool activated)
{
GetCurrentTabActivationArray(); // Consider current tab activation status array
GUILayout.Space(10); // Add some space to center the dot vertically
Color dotColor = activated ? Color.green : Color.red; // Determine dot color based on activation status
GUIStyle dotStyle = new GUIStyle(GUI.skin.label); // Create a new GUIStyle for the dot label
dotStyle.normal.textColor = dotColor; // Set the color of the dot label
GUILayout.Label("●", dotStyle, GUILayout.Width(20), GUILayout.Height(20)); // Draw dot with the specified style
}
/// <summary>
/// Adjusts the inflation level and applies it to all characters if the new inflation level is different from the current level.
/// </summary>
/// <param name="newInflationLevel">The new inflation level to apply.</param>
private void AdjustAndApplyInflation(float newInflationLevel)
{
// Check if the new inflation level is different from the current level
if (Math.Abs(_inflationLevel - newInflationLevel) > 0)
{
// Update the inflation level
_inflationLevel = newInflationLevel;
// Apply inflation to all characters
ApplyInflationToCharacters();
}
}
/// <summary>
/// Applies the current inflation level to all characters in the scene.
/// </summary>
private void ApplyInflationToCharacters()
{
// Find all CharacterAnimatorControllers in the scene
CharacterAnimatorController[] characterControllers = FindObjectsOfType<CharacterAnimatorController>();
// Loop through each controller and apply the current inflation level
foreach (CharacterAnimatorController controller in characterControllers)
{
// Check if the controller is not null
if (controller != null)
{
// Apply the current inflation level to the controller
controller.SetCumInflationAmount(_inflationLevel);
}
}
}
/// <summary>
/// Draws the inflation option GUI. This includes a dot indicating if inflation is enabled or disabled,
/// a label indicating inflation, and two buttons for adjusting the inflation level. Finally, there is an input
/// field for manually setting the inflation level.
/// </summary>
private void DrawInflationOption()
{
// Begin horizontal layout for the inflation option
GUILayout.BeginHorizontal();
// Draw dot indicating if inflation is enabled or disabled
DrawActivationDot(_inflationLevel != 0); // Use inflation level to set dot color
// Label indicating inflation
GUILayout.Label("Inflation");
// Plus button for increasing inflation
if (GUILayout.Button("+", GUILayout.Width(20)))
{
AdjustAndApplyInflation(_inflationLevel + 0.1f); // Increase inflation by 0.1
}
// Minus button for decreasing inflation
if (GUILayout.Button("-", GUILayout.Width(20)))
{
AdjustAndApplyInflation(_inflationLevel - 0.1f); // Decrease inflation by 0.1
}
// Input field for inflation level
float newInflationLevel;
float.TryParse(GUILayout.TextField(_inflationLevel.ToString(CultureInfo.InvariantCulture), GUILayout.Width(40)), out newInflationLevel);
// Check if the new inflation level is different from the current level
if (Math.Abs(newInflationLevel - _inflationLevel) > 0)
{
AdjustAndApplyInflation(newInflationLevel); // Adjust inflation to the new value
}
// End horizontal layout for the inflation option
GUILayout.EndHorizontal();
}
/// <summary>
/// Draws the Breeding Stand Uses option in the mod menu
/// </summary>
private void DrawBreedingStandUsesOption()
{
// Begin horizontal layout for the max condoms option
GUILayout.BeginHorizontal();
// Draw the activation dot and use the breeding stand uses value to set its color
DrawActivationDot(_breedingStandUses != 3); // Draw the activation dot
// Add a label for the text field
GUILayout.Label("Breeding Stand Uses:"); // Add a label for the text field
// Draw the text field and capture user input
string inputText = GUILayout.TextField(_breedingStandUses.ToString(), GUILayout.Width(40)); // Draw the text field
// Try to parse the input text as an integer
if (int.TryParse(inputText, out int newMaxUses))
{
// Check if the new value is different from the current value
if (newMaxUses != _breedingStandUses) // Check if the new value is different from the current value
{
// Update the breeding stand uses value
_breedingStandUses = newMaxUses; // Update the breeding stand uses value
// Execute the corresponding code for the new input value
// For example, you can call a method here
ToggleBreedingStandUses(); // Execute the corresponding code for the new input value
}
}
// End horizontal layout for the max condoms option
GUILayout.EndHorizontal(); // End horizontal layout for the max condoms option
}
/// <summary>
/// Draws the Glory Hole Uses option in the mod menu
/// </summary>
private void DrawGloryHoleUsesOption()
{
// Begin horizontal layout for the Glory Hole Uses option
GUILayout.BeginHorizontal();
// Draw the activation dot and use the Glory Hole Uses value to set its color
DrawActivationDot(_gloryHoleUses != 1);
// Add a label for the text field
GUILayout.Label("Glory Hole Uses:"); // The label for the text field
// Draw the text field and capture user input
string inputText = GUILayout.TextField(_gloryHoleUses.ToString(), GUILayout.Width(40)); // The text field for the Glory Hole Uses value
// Try to parse the input text as an integer
if (int.TryParse(inputText, out int newMaxUses))
{
// Check if the new value is different from the current value
if (newMaxUses != _gloryHoleUses)
{
// Update the Glory Hole Uses value
_gloryHoleUses = newMaxUses;
// Execute the corresponding code for the new input value
// For example, you can call a method here
ToggleGloryHoleUses();
}
}
// End horizontal layout for the Glory Hole Uses option
GUILayout.EndHorizontal();
}
/// <summary>
/// Draws the Plushy Uses option in the mod menu
/// </summary>
private void DrawPlushyUsesOption()
{
// Begin horizontal layout for the Plushy Uses option
GUILayout.BeginHorizontal();
// Draw the activation dot and use the Plushy Uses value to set its color
DrawActivationDot(_plushyUses != 1); // 1 = disabled, 0 = enabled
// Add a label for the text field
GUILayout.Label("Plushy Uses:"); // The text that appears next to the text field
// Draw the text field and capture user input
string inputText = GUILayout.TextField(_plushyUses.ToString(), GUILayout.Width(40)); // The text field that the user can edit
// Try to parse the input text as an integer
if (int.TryParse(inputText, out int newMaxUses))
{
// Check if the new value is different from the current value
if (newMaxUses != _plushyUses)
{
// Update the Plushy Uses value
_plushyUses = newMaxUses;
// Execute the corresponding code for the new input value
// For example, you can call a method here
TogglePlushyUses();
}
}
// End horizontal layout for the Plushy Uses option
GUILayout.EndHorizontal();
}
}
}