-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMultitoolMod.cs
48 lines (41 loc) · 1.79 KB
/
MultitoolMod.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
using MelonLoader;
using BTD_Mod_Helper;
using BTD_Mod_Helper.Api;
using BTD_Mod_Helper.Api.Display;
using Multitool;
using UnityEngine;
using Il2CppAssets.Scripts.Unity.UI_New.Popups;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;
[assembly: MelonInfo(typeof(MultitoolMod), Multitool.ModHelperData.Name, Multitool.ModHelperData.Version, Multitool.ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
namespace Multitool;
class MultitoolMod : BloonsTD6Mod
{
public override void OnUpdate()
{
if (InGame.instance != null && InGame.instance.bridge != null)
{
if (Input.GetKeyDown(KeyCode.F5))
{
Il2CppSystem.Action<int> wantedRound = (Il2CppSystem.Action<int>)delegate (int newRound)
{ if (newRound > 0) { InGame.instance.bridge.SetRound(newRound - 1); } };
PopupScreen.instance.ShowSetValuePopup("Round",
"What would you like to set the round to?", wantedRound, 3);
}
if (Input.GetKeyDown(KeyCode.F6))
{
Il2CppSystem.Action<int> wantedMoney = (Il2CppSystem.Action<int>)delegate (int newMoney)
{ InGame.instance.bridge.SetCash(newMoney); };
PopupScreen.instance.ShowSetValuePopup("Cash",
"What would you like to set your cash to?", wantedMoney, 650);
}
if (Input.GetKeyDown(KeyCode.F7))
{
Il2CppSystem.Action<int> wantedHealth = (Il2CppSystem.Action<int>)delegate (int newHealth)
{ InGame.instance.bridge.SetSandboxHealth(newHealth); };
PopupScreen.instance.ShowSetValuePopup("Lives",
"What would you like to set your health to?", wantedHealth, 100);
}
}
}
}