34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using moe.yuyui.weebsights_port.Assorts;
|
|
using moe.yuyui.weebsights_port.Enums;
|
|
using moe.yuyui.weebsights_port.Items;
|
|
using moe.yuyui.weebsights_port.Locales;
|
|
using SPTarkov.DI.Annotations;
|
|
using SPTarkov.Server.Core.DI;
|
|
using SPTarkov.Server.Core.Models.Utils;
|
|
|
|
namespace moe.yuyui.weebsights_port;
|
|
|
|
[Injectable(TypePriority = OnLoadOrder.PostSptModLoader + 1)]
|
|
public class Mod(ISptLogger<Mod> logger, EnglishLocale englishLocale, MechanicAssort mechanicAssort, ItemGenerator itemGenerator): IOnLoad
|
|
{
|
|
public Task OnLoad()
|
|
{
|
|
if (!englishLocale.LoadLocales())
|
|
{
|
|
logger.Error("[Weeb Iron Sights] Failed to load locales, you may see garbled text");
|
|
}
|
|
|
|
var sightsMbus = itemGenerator.GenerateWeebSights<ESightsMbus>();
|
|
var sightsMcx = itemGenerator.GenerateWeebSights<ESightsMcx>();
|
|
if (!mechanicAssort.InjectAssortFromItemClone(sightsMbus))
|
|
{
|
|
logger.Critical("[Weeb Iron Sights] Failed to inject MBUS Sights");
|
|
}
|
|
|
|
if (!mechanicAssort.InjectAssortFromItemClone(sightsMcx))
|
|
{
|
|
logger.Critical("[Weeb Iron Sights] Failed to inject MCX Sights");
|
|
}
|
|
return Task.CompletedTask;
|
|
}
|
|
} |