-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFriendlyFramesMod.cs
41 lines (35 loc) · 1.28 KB
/
FriendlyFramesMod.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
using Assets.Scripts.Objects;
using HarmonyLib;
using BepInEx;
namespace FriendlyFramesMod
{
[BepInPlugin("FriendlyFrames", "Friendly Frames", "0.0.1.0")]
class FriendlyFramesMod : BaseUnityPlugin
{
private void Awake()
{
//READ THE README FIRST!
//Harmony harmony = new Harmony("FriendlyFramesMod");
//harmony.PatchAll();
UnityEngine.Debug.Log("FriendlyFramesMod Loaded -- Remember to recalculate rooms when you first use this mod!");
Prefab.OnPrefabsLoaded += PatchPrefabs;
}
private void PatchPrefabs()
{
Structure.AllStructurePrefabs.ForEach(s =>
{
if (s.GetPrefabName().StartsWith("StructureFrame"))
{
if (s.BuildStates.Count == 3)
{
UnityEngine.Debug.Log("Patching " + s.GetPrefabName() + " BlockGravity");
s.BuildStates[1].BlockGravity = false;
s.BuildStates[1].Tool.ToolExit = s.BuildStates[0].Tool.ToolExit;
s.BuildStates[2].Tool.ToolExit = s.BuildStates[0].Tool.ToolExit;
}
}
}
);
}
}
}