Skip to content

Commit 62c5c4f

Browse files
committed
Override Max Modifier Limit
1 parent 46f2094 commit 62c5c4f

29 files changed

+92
-44
lines changed

.idea/.idea.ModifierModifier/.idea/discord.xml

Lines changed: 7 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: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.Linq;
3+
using System.Runtime.CompilerServices;
34
using BepInEx;
45
using HarmonyLib;
56
using CobwebAPI.API;
@@ -17,20 +18,24 @@ public class Main : BaseUnityPlugin
1718
//private Vector2 currentDrag = new Vector2();
1819
public Vector2 scrollPosition;
1920
public bool menuEnabled;
20-
private InputAction _inputAction = new InputAction(binding: "<Keyboard>/Insert");
21+
public bool overrideMaxLevel;
22+
public int addValue = 1;
23+
public bool devConsoleEnabled;
24+
private InputAction _MenuAction = new InputAction(binding: "<Keyboard>/Insert");
25+
// private InputAction _ConsoleAction = new InputAction("<Keyboard>/Grave");
2126

2227
public const string ModName = "ModifierModifier";
23-
public const string ModAuthor = "Bazinga";
24-
public const string ModGUID = "com.bazinga.modifiermodifier";
25-
public const string ModVersion = "1.1.1";
28+
public const string ModAuthor = "JustAWaffler";
29+
public const string ModGUID = "JustAWaffler.modifiermodifier";
30+
public const string ModVersion = "1.2.0";
2631
internal Harmony Harmony;
2732

2833
internal void Awake()
2934
{
3035
Harmony = new Harmony(ModGUID);
3136

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

3540

3641
Main.GUIStyle.alignment = TextAnchor.MiddleCenter;
@@ -41,16 +46,22 @@ internal void Awake()
4146
backgroundStyle.normal.textColor = Color.black;
4247
backgroundStyle.normal.background = Texture2D.grayTexture;
4348
menuEnabled = false;
44-
_inputAction.Enable();
49+
_MenuAction.Enable();
50+
//_ConsoleAction.Enable();
4551
}
4652

4753
private void Update()
4854
{
49-
if (_inputAction.triggered)
55+
if (_MenuAction.triggered)
5056
{
51-
Logger.LogInfo($"Menu Toggled: {menuEnabled}");
57+
Logger.LogMessage($"Menu Toggled: {menuEnabled}");
5258
menuEnabled = !menuEnabled;
5359
}
60+
61+
// if (_ConsoleAction.triggered)
62+
// {
63+
// devConsoleEnabled = !devConsoleEnabled;
64+
// }
5465
}
5566

5667
[HarmonyPatch(typeof(ModifierManager), "GetNonMaxedSurvivalMods")]
@@ -72,22 +83,36 @@ private void OnGUI()
7283
valX += 173;
7384
}
7485

75-
bool flag = GUI.Button(new Rect(25f + valX, (float) (25 + valY), 150f, 40f), mods.data.name,
86+
87+
overrideMaxLevel = GUI.Toggle(new Rect(0, -10, 70, 10), overrideMaxLevel, "Override Max Level");
88+
bool flag = GUI.Button(new Rect(25f + valX, (float) (25 + valY), 150f, 40f), mods.data.name + " : " + mods.levelInSurvival,
7689
Main.backgroundStyle);
7790
if (flag)
7891
{
79-
Logger.LogInfo(mods.data.name + "Has been clicked");
80-
mods.levelInSurvival = mods.data.maxLevel;
81-
82-
Logger.LogInfo(mods.levelInSurvival);
83-
Logger.LogInfo(mods.levelInVersus);
92+
Logger.LogMessage(mods.data.name + "Has been clicked");
93+
if (mods.levelInSurvival < mods.data.maxLevel)
94+
{
95+
mods.levelInSurvival += addValue;
96+
} else if (overrideMaxLevel)
97+
{
98+
mods.levelInSurvival += addValue;
99+
} else if (mods.levelInSurvival > mods.data.maxLevel & !overrideMaxLevel)
100+
{
101+
mods.levelInSurvival = mods.data.maxLevel;
102+
}
103+
104+
105+
//mods.levelInSurvival = mods.data.maxLevel;
106+
107+
Logger.LogMessage(mods.levelInSurvival);
108+
Logger.LogMessage(mods.levelInVersus);
84109
}
85110

86111
valY += 47;
87112
}
88113
GUI.EndGroup();
89114
}
90-
115+
91116

92117

93118
}
@@ -96,8 +121,8 @@ public void MaxMod(Modifier mod)
96121
{
97122

98123
//WaveModifiers.Give(mod.data.name, mod.data.maxLevel);
99-
Logger.LogInfo(mod.levelInSurvival);
100-
Logger.LogInfo(mod.levelInVersus);
124+
Logger.LogMessage(mod.levelInSurvival);
125+
Logger.LogMessage(mod.levelInVersus);
101126
}
102127
public List<Modifier> GetTotalNonMaxedModifiers()
103128
{
@@ -106,6 +131,7 @@ public List<Modifier> GetTotalNonMaxedModifiers()
106131
list.AddRange(ModifierManager.instance.GetNonMaxedSurvivalMods());
107132
return list;
108133
}
134+
109135

110136
}
111137

ModifierModifier/ModifierModifier.csproj

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,62 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="BepInEx.Unity" Version="6.0.0-be.554" PrivateAssets="all" />
21-
<PackageReference Include="BepInEx.AutoPlugin" Version="1.0.1" PrivateAssets="all" />
22-
23-
<PackageReference Include="UnityEngine.Modules" Version="2020.3.13" PrivateAssets="all" />
24-
</ItemGroup>
25-
26-
<ItemGroup>
27-
<Reference Include="CobwebAPI, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null">
28-
<HintPath>References\CobwebAPI.dll</HintPath>
20+
<Reference Include="0Harmony">
21+
<HintPath>References\0Harmony.dll</HintPath>
22+
</Reference>
23+
<Reference Include="BepInEx.Core">
24+
<HintPath>References\BepInEx.Core.dll</HintPath>
25+
</Reference>
26+
<Reference Include="BepInEx.Unity">
27+
<HintPath>References\BepInEx.Unity.dll</HintPath>
2928
</Reference>
30-
<Reference Include="MyScriptAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
31-
<HintPath>References\MyScriptAssembly.dll</HintPath>
29+
<Reference Include="CobwebAPI">
30+
<HintPath>..\References\CobwebAPI.dll</HintPath>
31+
</Reference>
32+
<Reference Include="MyScriptAssembly">
33+
<HintPath>..\References\MyScriptAssembly.dll</HintPath>
34+
</Reference>
35+
<Reference Include="Unity.InputSystem">
36+
<HintPath>..\References\Unity.InputSystem.dll</HintPath>
3237
</Reference>
3338
<Reference Include="Unity.InputSystem, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null">
3439
<HintPath>References\Unity.InputSystem.dll</HintPath>
3540
</Reference>
36-
<Reference Include="Unity.Netcode.Components, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
37-
<HintPath>References\Unity.Netcode.Components.dll</HintPath>
41+
<Reference Include="Unity.Netcode.Components">
42+
<HintPath>..\References\Unity.Netcode.Components.dll</HintPath>
43+
</Reference>
44+
<Reference Include="Unity.Netcode.Runtime">
45+
<HintPath>..\References\Unity.Netcode.Runtime.dll</HintPath>
3846
</Reference>
39-
<Reference Include="Unity.Netcode.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
40-
<HintPath>References\Unity.Netcode.Runtime.dll</HintPath>
47+
<Reference Include="Unity.TextMeshPro">
48+
<HintPath>..\References\Unity.TextMeshPro.dll</HintPath>
4149
</Reference>
42-
<Reference Include="Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
43-
<HintPath>References\Unity.TextMeshPro.dll</HintPath>
50+
<Reference Include="UnityEngine">
51+
<HintPath>..\References\UnityEngine.dll</HintPath>
4452
</Reference>
45-
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
46-
<HintPath>References\UnityEngine.dll</HintPath>
53+
<Reference Include="UnityEngine.CoreModule">
54+
<HintPath>..\References\UnityEngine.CoreModule.dll</HintPath>
4755
</Reference>
48-
<Reference Include="UnityEngine.IMGUIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
49-
<HintPath>References\UnityEngine.IMGUIModule.dll</HintPath>
56+
<Reference Include="UnityEngine.IMGUIModule">
57+
<HintPath>..\References\UnityEngine.IMGUIModule.dll</HintPath>
5058
</Reference>
51-
<Reference Include="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
52-
<HintPath>References\UnityEngine.TextRenderingModule.dll</HintPath>
59+
<Reference Include="UnityEngine.TextRenderingModule">
60+
<HintPath>..\References\UnityEngine.TextRenderingModule.dll</HintPath>
5361
</Reference>
54-
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
55-
<HintPath>References\UnityEngine.UI.dll</HintPath>
62+
<Reference Include="UnityEngine.UI">
63+
<HintPath>..\References\UnityEngine.UI.dll</HintPath>
5664
</Reference>
57-
<Reference Include="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
58-
<HintPath>References\UnityEngine.UIModule.dll</HintPath>
65+
<Reference Include="UnityEngine.UIModule">
66+
<HintPath>..\References\UnityEngine.UIModule.dll</HintPath>
5967
</Reference>
6068
</ItemGroup>
6169

6270
<Target Name="Copy" AfterTargets="Build" Condition="'$(SpiderHeck)' != ''">
6371
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(SpiderHeck)\BepInEx\plugins\" UseSymboliclinksIfPossible="true" />
6472
</Target>
6573

74+
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
75+
<Exec Command="call postbuild $(TargetPath)" />
76+
</Target>
77+
6678
</Project>
110 KB
Binary file not shown.
28.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)