-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoader.cs
59 lines (51 loc) · 2 KB
/
Loader.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
// Some standard includes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
//Melon Loader include
using MelonLoader;
// Unity stuff inlcudes
using UnityEngine;
// for hooking game functions
//using HarmonyLib;
namespace ownned.ext
{
public class Loader : MelonMod
{
// Classes
Cheat cheat = new Cheat();
Window window = new Window();
// OnIngameStart()Function
public override void OnInitializeMelon() // or "public override void OnInitializeMelon()" for melon mod or plugin
{
// Center the window on the screen
window.windowRect.x = (Screen.width - window.windowRect.width) / 2;
window.windowRect.y = (Screen.height - window.windowRect.height) / 2;
MelonLogger.Msg(" [OWNNED.EXT] >> Melon Initialized sucessfully");
// Harmony has no use rn maybe later idk
//new HarmonyLib.Harmony("com.ikwy.ownned.ext").PatchAll();
}
// OnUpdate() Function, calls every second
public override void OnUpdate()
{
//MelonLogger.Msg("ownned.ext running");
if (Input.GetKeyDown(KeyCode.Insert)) // Toggle the menu when the Tab key is pressed and for new key sys "if (Keyboard.current.insertKey.wasPressedThisFrame)"
{
window.showMenu = !window.showMenu;
MelonLogger.Msg(" [OWNNED.EXT] >> Pressed Insert key");
}
// Cheat stuff shit running in here
cheat.runCheat();
}
public override void OnGUI() // add "public override" to this for melon mod
{
if (window.showMenu) // Only draw the menu when showMenu is true
{
window.windowRect = GUI.Window(0, window.windowRect, window.runMainWindow, "ownned.ext"); // Create the window with title "Menu"
}
}
}
}