Skip to content

Commit 569b898

Browse files
author
JФSԐPЊҤЇ ҠЯДԞФЩSҜЇ
committed
Version 1.1.0
1 parent e330a8d commit 569b898

File tree

4 files changed

+48
-29
lines changed

4 files changed

+48
-29
lines changed

.idea/.idea.ModifierModifier/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ModifierModifier/Main.cs

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
using System.Linq;
44
using BepInEx;
55
using HarmonyLib;
6-
using CobwebAPI;
76
using CobwebAPI.API;
87
using UnityEngine;
8+
using UnityEngine.EventSystems;
9+
using UnityEngine.InputSystem;
10+
using UnityEngine.Internal;
11+
using UnityEngineInternal.Input;
912
using UnityEngine.PlayerLoop;
13+
using UnityEngine.UI;
1014

1115

1216
namespace ModifierModifier
@@ -20,19 +24,20 @@ public class Main : BaseUnityPlugin
2024
private Vector2 currentDrag = new Vector2();
2125
public Vector2 scrollPosition;
2226
public bool menuEnabled;
27+
private InputAction _inputAction = new InputAction(binding: "<Keyboard>/Insert");
2328

2429
public const string ModName = "ModifierModifier";
2530
public const string ModAuthor = "Bazinga";
2631
public const string ModGUID = "com.bazinga.modifiermodifier";
27-
public const string ModVersion = "1.0.0";
32+
public const string ModVersion = "1.1.0";
2833
internal Harmony Harmony;
2934

3035
internal void Awake()
3136
{
3237
Harmony = new Harmony(ModGUID);
3338

3439
Harmony.PatchAll();
35-
Logger.LogInfo($"{ModName} successfully loaded! Made by {ModAuthor}");
40+
Logger.LogInfo($"{ModName} successfully loaded! Made by {ModAuthor} \n Toggle Menu with the INS or INSERT key");
3641

3742

3843
Main.GUIStyle.alignment = TextAnchor.MiddleCenter;
@@ -43,46 +48,53 @@ internal void Awake()
4348
backgroundStyle.normal.textColor = Color.black;
4449
backgroundStyle.normal.background = Texture2D.grayTexture;
4550
menuEnabled = false;
51+
_inputAction.Enable();
4652
}
4753

48-
void Update()
54+
private void Update()
4955
{
50-
if (Input.GetKeyDown(KeyCode.Insert))
56+
if (_inputAction.triggered)
5157
{
58+
Logger.LogInfo($"Menu Toggled: {menuEnabled}");
5259
menuEnabled = !menuEnabled;
5360
}
5461
}
5562

5663
[HarmonyPatch(typeof(ModifierManager), "GetNonMaxedWavesMods")]
5764
private void OnGUI()
5865
{
59-
6066
var menuRect = new Rect(0, 25f, Screen.width / 2, Screen.height / 2);
61-
GUI.BeginGroup(menuRect, GUIStyle);
67+
6268
int valX = 0;
6369
int valY = 0;
64-
foreach (var mods in GetTotalNonMaxedModifiers())
70+
if (menuEnabled)
6571
{
66-
if ((valY + 77) >= (Screen.height / 2))
67-
{
68-
valY = 0;
69-
valX += 173;
70-
}
72+
GUI.BeginGroup(menuRect, GUIStyle);
7173

72-
bool flag = GUI.Button(new Rect(25f + valX, (float) (25 + valY), 150f, 40f), mods.data.name,
73-
Main.backgroundStyle);
74-
if (flag)
74+
foreach (var mods in GetTotalNonMaxedModifiers())
7575
{
76-
Logger.LogInfo(mods.data.name + "Has been clicked");
77-
mods.levelInWaves = mods.data.maxLevel;
78-
79-
Logger.LogInfo(mods.levelInWaves);
80-
Logger.LogInfo(mods.levelInVersus);
76+
if ((valY + 77) >= (Screen.height / 2))
77+
{
78+
valY = 0;
79+
valX += 173;
80+
}
81+
82+
bool flag = GUI.Button(new Rect(25f + valX, (float) (25 + valY), 150f, 40f), mods.data.name,
83+
Main.backgroundStyle);
84+
if (flag)
85+
{
86+
Logger.LogInfo(mods.data.name + "Has been clicked");
87+
mods.levelInWaves = mods.data.maxLevel;
88+
89+
Logger.LogInfo(mods.levelInWaves);
90+
Logger.LogInfo(mods.levelInVersus);
91+
}
92+
93+
valY += 47;
8194
}
82-
83-
valY += 47;
95+
GUI.EndGroup();
8496
}
85-
GUI.EndGroup();
97+
8698

8799

88100
}
@@ -95,7 +107,8 @@ void ModifierModifierWindow(int windowID)
95107

96108
public void MaxMod(Modifier mod)
97109
{
98-
WaveModifiers.Give(mod.data.name, mod.data.maxLevel);
110+
111+
CobwebAPI.API.WaveModifiers.Give(mod.data.name, mod.data.maxLevel);
99112
Logger.LogInfo(mod.levelInWaves);
100113
Logger.LogInfo(mod.levelInVersus);
101114
}

ModifierModifier/ModifierModifier.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<HintPath>..\References\BepInEx.dll</HintPath>
4141
</Reference>
4242
<Reference Include="CobwebAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
43-
<HintPath>C:\Users\kizz4\Downloads\CobwebAPI.dll</HintPath>
43+
<HintPath>References\CobwebAPI.dll</HintPath>
4444
</Reference>
4545
<Reference Include="MyScriptAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
4646
<HintPath>..\References\MyScriptAssembly.dll</HintPath>
@@ -49,6 +49,9 @@
4949
<Reference Include="System.Core" />
5050
<Reference Include="System.Data" />
5151
<Reference Include="System.Xml" />
52+
<Reference Include="Unity.InputSystem, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null">
53+
<HintPath>..\..\..\..\Steam Games\steamapps\common\SpiderHeck Demo\SPIDERHECK_Data\Managed\Unity.InputSystem.dll</HintPath>
54+
</Reference>
5255
<Reference Include="Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
5356
<HintPath>..\References\Unity.TextMeshPro.dll</HintPath>
5457
</Reference>
@@ -64,9 +67,6 @@
6467
<Reference Include="UnityEngine.InputLegacyModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
6568
<HintPath>..\..\..\..\Steam Games\steamapps\common\SpiderHeck Demo\SPIDERHECK_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
6669
</Reference>
67-
<Reference Include="UnityEngine.InputModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
68-
<HintPath>..\..\..\..\Steam Games\steamapps\common\SpiderHeck Demo\SPIDERHECK_Data\Managed\UnityEngine.InputModule.dll</HintPath>
69-
</Reference>
7070
<Reference Include="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
7171
<HintPath>..\..\..\..\Steam Games\steamapps\common\SpiderHeck Demo\SPIDERHECK_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
7272
</Reference>
8.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)