-
Notifications
You must be signed in to change notification settings - Fork 0
/
CropInfo.cs
33 lines (28 loc) · 853 Bytes
/
CropInfo.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
using System;
using System.Linq;
using BepInEx;
using HarmonyLib;
using UnityEngine;
namespace FarmDoctor;
[HarmonyPatch]
public class CropInfo
{
[HarmonyPostfix, HarmonyPatch(typeof(ActionMode), "UpdateInput")]
public static void UpdateInput(ActionMode __instance)
{
if (EInput.action == EAction.Examine && !__instance.IsBuildMode && !EClass.ui.isPointerOverUI)
{
Cell _cell = EClass.scene.mouseTarget.pos.cell;
if (_cell != null)
{
PlantData plantData = EClass._map.TryGetPlant(_cell);
Thing thing = (plantData != null) ? plantData.seed : null;
if (thing != null)
{
SE.Rotate();
EClass.ui.AddLayer<LayerInfo>().Set(thing, true);
}
}
}
}
}