Exemplo n.º 1
0
        public async void Init(IPALogger logger, Config conf, Zenjector zenjector, PluginMetadata metadata)
        {
            _logger = logger;

            _harmony = new Harmony(HarmonyId);

            var pluginConfig = conf.Generated <PluginConfig>();

            if (!await LoadCsDescriptors())
            {
                return;
            }

            zenjector.UseLogger(logger);
            zenjector.UseHttpService();

            zenjector.Install <PluginAppInstaller>(Location.App, logger, pluginConfig, metadata);
            zenjector.Install <PluginMenuInstaller>(Location.Menu);
            zenjector.Install <PluginGameInstaller>(Location.Player | Location.MultiPlayer);

            zenjector.Mutate <SaberBurnMarkArea>("Environment", (ctx, ogBurnMark) =>
            {
                var newBurner = CommonHelpers.Upgrade(ogBurnMark, typeof(CustomSaberBurnMarkArea));
                ctx.Container.QueueForInject(newBurner);
            });
        }