-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScale.cs
24 lines (23 loc) · 1 KB
/
Scale.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
using HarmonyLib;
using TaleWorlds.Core;
namespace LongerCraftingParts
{
[HarmonyPatch(typeof(Crafting), "ScaleThePiece")]
internal class Scale
{
public static bool Prefix(CraftingPiece.PieceTypes scalingPieceType, ref int
percentage)
{
if(LongerCraftingParts.Settings.MCSISettings.Instance.MaxSize != 110)
{
percentage = (percentage - 90) * (LongerCraftingParts.Settings.MCSISettings.Instance.MaxSize / 20);
}
if (percentage < LongerCraftingParts.Settings.MCSISettings.Instance.MinSize)
percentage = LongerCraftingParts.Settings.MCSISettings.Instance.MinSize;
if (percentage > LongerCraftingParts.Settings.MCSISettings.Instance.MaxSize)
percentage = LongerCraftingParts.Settings.MCSISettings.Instance.MaxSize;
//MBInformationManager.AddQuickInformation(new TaleWorlds.Localization.TextObject(percentage.ToString()));
return true;
}
}
}