-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItemStatsMod.cs
39 lines (35 loc) · 1021 Bytes
/
ItemStatsMod.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
using System;
using System.Runtime.CompilerServices;
using BepInEx.Bootstrap;
using ItemStats;
using RoR2;
namespace CommandItemCount
{
static class ItemStatsMod
{
private static bool? _enabled;
internal static bool enabled
{
get
{
if (_enabled == null)
{
_enabled = Chainloader.PluginInfos.ContainsKey("dev.ontrigger.itemstats");
}
return (bool)_enabled;
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
internal static string GetStats(ItemIndex itemIndex, int itemCount, CharacterMaster master)
{
try
{
return ItemStats.ItemStatsMod.GetStatsForItem(itemIndex, itemCount, new StatContext(master));
}
catch (Exception)
{
return null;
}
}
}
}