-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathScalableWorldOrbs.cs
31 lines (27 loc) · 1011 Bytes
/
ScalableWorldOrbs.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
using FrooxEngine;
using HarmonyLib;
using ResoniteModLoader;
namespace ScalableWorldOrbs {
public class ScalableWorldOrbs : ResoniteMod {
public override string Name => "ScalableWorldOrbs";
public override string Author => "Delta";
public override string Version => "2.0.0";
public override string Link => "https://github.com/XDelta/ScalableWorldOrbs";
[AutoRegisterConfigKey]
private static readonly ModConfigurationKey<bool> Enabled = new ModConfigurationKey<bool>("Enabled", "Mod Enabled", () => true);
private static ModConfiguration Config;
public override void OnEngineInit() {
Config = GetConfiguration();
Config.Save(true);
Harmony harmony = new("net.deltawolf.ScalableWorldOrbs");
harmony.PatchAll();
}
[HarmonyPatch(typeof(WorldOrb), "SetupOrb")]
class WorldOrb_SetupOrb_Patch {
public static void Postfix(WorldOrb __instance) {
if (!Config.GetValue(Enabled)) { return; }
__instance.Slot.GetComponent<Grabbable>().Scalable.Value = true;
}
}
}
}