示例#1
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     instance   = this;
     Logger.log = logger;
     Logger.log.Debug("Logger initialized.");
     zenjector.OnMenu <PlaylistDownloaderInstaller>();
 }
示例#2
0
        public void Init(object _, IPALogger log, Zenjector zenjector)
        {
            Log = log;

            GameObject sabers;

            using (var stream = Assembly.GetManifestResourceStream(ClawsSaberName))
            {
                sabers = AssetBundle.LoadFromStream(stream).LoadAsset <GameObject>("_CustomSaber");
            }

            foreach (Transform t in sabers.transform)
            {
                if (t.name == "LeftSaber")
                {
                    LeftSaber = t.gameObject;
                }
                else if (t.name == "RightSaber")
                {
                    RightSaber = t.gameObject;
                }
                if (LeftSaber != null && RightSaber != null)
                {
                    break;
                }
            }

            zenjector.OnGame <SaberModelInstaller>();
        }
示例#3
0
        public Plugin(IPALogger logger, IPAConfig config, Zenjector zenject)
        {
            Instance = this;

            DateTime time = DateTime.UtcNow;

            isAprilFools = time.Month == 4 && time.Day == 1;

            zenject.UseLogger(logger);
            zenject.UseMetadataBinder <Plugin>();

            if (isAprilFools)
            {
                zenject.Expose <CoreGameHUDController>("Environment");
            }

            zenject.Expose <GameEnergyUIPanel>("Environment");
            zenject.Expose <ComboUIController>("Environment");
            zenject.Expose <ScoreMultiplierUIController>("Environment");
            zenject.Expose <SongProgressUIController>("Environment");
            zenject.Expose <ImmediateRankUIPanel>("Environment");

            // Multiplayer support broke with Sira3... maybe someday I'll look into it.
            zenject.Install <AppConfigInstaller>(Location.App, config.Generated <PluginConfig>());
            zenject.Install <MenuUIInstaller>(Location.Menu);
            zenject.Install <PanelModifierInstaller>(Location.StandardPlayer | Location.CampaignPlayer);
        }
示例#4
0
 public Plugin(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     log      = logger;
     zenjector.OnMenu <NiceMissMenuInstaller>();
     zenjector.OnGame <NiceMissGameInstaller>(false);
 }
示例#5
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("SRMV2Extention initialized.");
     zenjector.OnMenu <SRMExtentionInstaller>();
 }
示例#6
0
 public void Init(Logger logger, Config config, Zenjector zenjector)
 {
     zenjector.OnApp <OnAppInstaller>().WithParameters(logger, config.Generated <Configuration.PluginConfig>());
     zenjector.OnMenu <OnMenuInstaller>();
     zenjector.OnGame <OnGameInstaller>(false);
     zenjector.OnGame <OnGameInstaller>(true).ShortCircuitForCampaign().ShortCircuitForMultiplayer().ShortCircuitForStandard(); // Counters+...
 }
示例#7
0
 public Plugin(Conf conf, IPALogger logger, Zenjector zenjector)
 {
     Logger.Log = logger;
     zenjector.OnApp <LevelTweaksCoreInstaller>().WithParameters(conf.Generated <Config>());
     zenjector.OnMenu <LevelTweaksMenuInstaller>();
     harmony = new Harmony("dev.auros.leveltweaks");
 }
示例#8
0
 public Plugin(IPALogger logger, Config config, Zenjector zenjector)
 {
     Logger.log = logger;
     zenjector.OnApp <CustomNotesCoreInstaller>().WithParameters(config.Generated <PluginConfig>());
     zenjector.OnMenu <CustomNotesMenuInstaller>();
     zenjector.OnGame <CustomNotesGameInstaller>(false).ShortCircuitForTutorial();
 }
示例#9
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);
            });
        }
        void Awake()
        {
            Helpers.Logger.LogText("-= Monke Map Loader started =-");

            HarmonyPatches.ApplyHarmonyPatches();
            Zenjector.Install <MainInstaller>().OnProject();
        }
示例#11
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("Fever initialized.");
     zenjector.OnGame <GameInstaller>();
 }
示例#12
0
 public void Init(IPA.Logging.Logger logger, Zenjector zenjector, PluginMetadata metadata)
 {
     Log           = logger;
     VersionNumber = metadata.Version?.ToString() ?? Assembly.GetExecutingAssembly().GetName().Version.ToString(3);
     harmony       = new Harmony(HarmonyId);
     zenjector.Install <SongBrowserMenuInstaller>(Location.Menu);
 }
示例#13
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public Plugin(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     harmony  = new Harmony(HarmonyId);
     zenjector.OnMenu <NoBoomInstaller>();
 }
示例#14
0
        public Plugin(IPA.Config.Config conf, IPALogger logger, PluginMetadata metadata)
        {
            Log = logger;
            Config config = conf.Generated <Config>();

            Harmony = new Harmony("dev.auros.sirautil");

            // Set Config Verison
            config.Version = metadata.Version;

            // Setup Zenjector
            _zenjectManager = new ZenjectManager();
            PluginInitInjector.AddInjector(typeof(Zenjector), (prev, __, meta) =>
            {
                if (prev != null)
                {
                    return(prev);
                }
                var zen = new Zenjector(meta.Id);
                _zenjectManager.Add(zen);
                return(zen);
            });

            // Setup Own Zenject Stuff
            var zenjector = new Zenjector("SiraUtil");

            _zenjectManager.Add(zenjector);

            zenjector.OnApp <SiraInstaller>().WithParameters(config);
            zenjector.OnGame <SiraSaberInstaller>();

            zenjector.OnGame <SiraSaberEffectInstaller>()
            .Mutate <SaberBurnMarkArea>((ctx, obj) =>
            {
                var burnArea = obj as SaberBurnMarkArea;
                // Override (or modify) the component BEFORE it's installed
                var siraBurnArea = burnArea.gameObject.AddComponent <SiraSaberBurnMarkArea>();
                ctx.Container.QueueForInject(siraBurnArea);
                ctx.Container.Bind <SaberBurnMarkArea>().To <SiraSaberBurnMarkArea>().FromInstance(siraBurnArea).AsCached();
            })
            .Mutate <SaberBurnMarkSparkles>((ctx, obj) =>
            {
                var burnSparkles     = obj as SaberBurnMarkSparkles;
                var siraBurnSparkles = burnSparkles.gameObject.AddComponent <SiraSaberBurnMarkSparkles>();
                ctx.Container.QueueForInject(siraBurnSparkles);
                ctx.Container.Bind <SaberBurnMarkSparkles>().To <SiraSaberBurnMarkSparkles>().FromInstance(siraBurnSparkles).AsCached();
            })
            .Mutate <ObstacleSaberSparkleEffectManager>((ctx, obj) =>
            {
                var obstacleSparkles     = obj as ObstacleSaberSparkleEffectManager;
                var siraObstacleSparkles = obstacleSparkles.gameObject.AddComponent <SiraObstacleSaberSparkleEffectManager>();
                UnityEngine.Object.Destroy(obstacleSparkles);
                ctx.Container.QueueForInject(siraObstacleSparkles);
                ctx.Container.Bind <ObstacleSaberSparkleEffectManager>().To <SiraObstacleSaberSparkleEffectManager>().FromInstance(siraObstacleSparkles).AsCached();
            })
            .ShortCircuitForMultiplayer();

            zenjector.OnGame <SiraGameInstaller>().ShortCircuitForMultiplayer();
        }
示例#15
0
        public void Init(Logger log, PluginMetadata pluginMetadata, Zenjector zenject)
        {
            LoggerInstance = log;
            _metadata      = pluginMetadata;

            zenject.OnApp <AppInstaller>();
            zenject.OnMenu <Installers.MenuInstaller>();
        }
示例#16
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("HttpStatusExtention initialized.");
     zenjector.OnGame <HttpStatusExtentionInstaller>().OnlyForStandard();
     _ = ScoreDataBase.Instance.Initialize();
 }
示例#17
0
 public void Init(Logger logger, Config config, Zenjector zenject)
 {
     zenject.OnApp <InstaAppInstaller>().WithParameters(logger, config.Generated <Configuration.PluginConfig>());
     zenject.OnMenu <InstaMenuInstaller>();
     zenject.OnGame <InstaGameInstaller>()
     .Expose <StandardLevelFailedController>()
     .OnlyForStandard();
 }
示例#18
0
 public Plugin(PluginMetadata pluginMetadata, Logger logger, Config config, Zenjector zenjector)
 {
     zenjector.UseLogger(logger);
     zenjector.UseHttpService();
     zenjector.Install <PlatformsAppInstaller>(Location.App, pluginMetadata.Assembly, config.Generated <PluginConfig>());
     zenjector.Install <PlatformsMenuInstaller>(Location.Menu);
     zenjector.Install <PlatformsGameInstaller>(Location.Player);
 }
示例#19
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public Plugin(IPALogger logger, Zenjector zenjector)
 {
     Instance   = this;
     Plugin.Log = logger;
     Plugin.Log?.Debug("Logger initialized.");
     zenjector.OnMenu <PauseChampMenuInstaller>();
     zenjector.OnGame <PauseChampGameInstaller>().OnlyForStandard();
 }
示例#20
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("CustomEnergyBar initialized.");
     zenjector.OnGame <GameInstaller>(false).OnlyForMultiplayer();
     zenjector.OnGame <GameInstaller>().OnlyForStandard();
 }
示例#21
0
        public void Init(Logger logger, Config config, PluginMetadata metaData, Zenjector zenject)
        {
            _metadata = metaData;

            zenject.OnApp <AppInstaller>().WithParameters(logger, config.Generated <Configuration>());
            zenject.OnMenu <MenuInstaller>();
            zenject.OnGame <GamePlayCoreInstaller>();
        }
示例#22
0
        public void Init(IPALogger logger, Config conf, Zenjector zenjector)
        {
            Name = Assembly.GetExecutingAssembly().GetName().Name;

            zenjector.OnApp <CustomPillowsAppInstaller>().WithParameters(conf.Generated <PluginConfig>(), logger);
            zenjector.OnMenu <CustomPillowsMenuInstaller>();
            zenjector.OnGame <CustomPillowsGameInstaller>();
        }
示例#23
0
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Logger = logger;
     Logger.Debug("Logger Initialized.");
     zenjector.Install <HttpPlayerInstaller>(Location.Player);
     zenjector.Install <HttpAppInstaller>(Location.App);
     this._harmony = new Harmony(HARMONY_ID);
 }
示例#24
0
        public Plugin(IPALogger logger, Config conf, Zenjector zenjector)
        {
            var pluginConfig = conf.Generated <PluginConfig>();

            zenjector.OnApp <AppInstaller>().WithParameters(pluginConfig, logger);
            zenjector.OnMenu <Installers.MenuInstaller>();
            zenjector.OnGame <GameInstaller>(false);
        }
示例#25
0
        public Plugin(IPALogger logger, Conf conf, Zenjector zenjector)
        {
            Log      = logger;
            Config   = conf.Generated <Config>();
            _harmony = new Harmony(HarmonyID);

            zenjector.OnApp <LocalizerInstaller>();
        }
示例#26
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("CameraPlusUIPlus initialized.");
     _harmony = new Harmony(HARMONY_ID);
     zenjector.OnMenu <CameraUIPlusInstaller>();
 }
示例#27
0
 public Plugin(IPALogger logger, Zenjector zenjector)
 {
     Instance  = this;
     Log       = logger;
     Harmony   = new Harmony(HarmonyId);
     Zenjector = zenjector;
     Zenjector.OnApp <AvatarInstaller>();
     Plugin.Log?.Debug("Init finished.");
 }
示例#28
0
 public void Init(IPA.Logging.Logger log, Config conf, Zenjector zenjector)
 {
     Instance      = this;
     Logger.logger = log;
     Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
     Logger.logger.Debug("Config loaded");
     Harmony = new HarmonyLib.Harmony(HarmonyID);
     zenjector.Install <CMMMenuInstaller>(Location.Menu);
 }
示例#29
0
        public Plugin(IPALogger logger, Zenjector zenjector)
        {
            Log = logger;
            zenjector.UseMetadataBinder <Plugin>();

            // Register our Installer
            zenjector.Install <DiDMenuInstaller>(Location.Menu);
            zenjector.UseLogger(logger);
        }
示例#30
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public Plugin(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("PlaylistManager initialized.");
     harmony = new Harmony(HarmonyId);
     zenjector.OnMenu <PlaylistViewInstaller>();
     DownloaderUtils.Init();
 }