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+... }
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(); }
/// <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(); }
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>(); }
/// <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>(); }
public Plugin(IPALogger logger, Zenjector zenjector) { Instance = this; log = logger; zenjector.OnMenu <NiceMissMenuInstaller>(); zenjector.OnGame <NiceMissGameInstaller>(false); }
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(); }
/// <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(); }
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>(); }
/// <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(); }
public void Init(Logger logger, Config config, PluginMetadata pluginMetadata, Zenjector zenject) { _metadata = pluginMetadata; zenject.OnApp <HsvAppInstaller>().WithParameters(logger, config.Generated <HSVConfig>()); zenject.OnMenu <HsvMenuInstaller>(); zenject.OnGame <HsvGameInstaller>(); }
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); }
public Plugin(IPALogger logger, IPAConfig config, Zenjector zenjector) { PluginConfig conf = config.Generated <PluginConfig>(); zenjector.OnApp <AppInstaller>().WithParameters(logger, conf); zenjector.OnMenu <Installers.MenuInstaller>(); zenjector.OnGame <GameInstaller>().Expose <LevelFailedTextEffect>().OnlyForStandard(); zenjector.OnGame <GameInstaller>(false).Expose <LevelFailedTextEffect>().OnlyForMultiplayer(); bool dir = Directory.Exists($@"{UnityGame.UserDataPath}\CustomFailText\"); if (!dir) { Directory.CreateDirectory($@"{UnityGame.UserDataPath}\CustomFailText\"); } }
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>(); }
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(); }
public Plugin(IPA.Logging.Logger logger, Zenjector zenjector, PluginMetadata pluginMetadata) { instance = this; Logger.log = logger; harmony = new Harmony("com.github.zingabopp.bailoutmode"); PluginMetadata = pluginMetadata; Zenjector = zenjector; zenjector.OnGame <BailOutInstaller>(false); //BS_Utils.Utilities.BSEvents.lateMenuSceneLoadedFresh += MenuLoadedFresh; }
/// <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, Config conf, Zenjector zenjector) { Instance = this; Log = logger; Log.Info("BeatmapInformation initialized."); Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>(); Log.Debug("Config loaded"); zenjector.OnGame <BMInfoGameInstaller>().OnlyForStandard(); zenjector.OnMenu <BMInfoMenuInstaller>(); }
public Plugin(IPALogger logger, Config config, Zenjector zenjector) { Instance = this; Plugin.Log = logger; Plugin.Log?.Debug("Logger initialized."); PluginConfig.Instance = config.Generated <PluginConfig>(); zenjector.OnGame <RecorderInstaller>(); }
public Plugin(IPALogger logger, Zenjector zenjector, PluginMetadata pluginMetadata) { Instance = this; PluginMetadata = pluginMetadata; Log = logger; zenjector.OnApp <AvatarInstaller>(); zenjector.OnGame <GameAvatarInstaller>().OnlyForMultiplayer(); HttpClient = new HttpClient(); HttpClient.DefaultRequestHeaders.Add("User-Agent", Plugin.UserAgent); }
public void Init(IPALogger logger, Config conf, Zenjector zenjector) { _logger = logger; var pluginConfig = conf.Generated <PluginConfig>(); var saberFactoryDir = new DirectoryInfo(UnityGame.UserDataPath).CreateSubdirectory("Saber Factory"); LoadCSDescriptors(); zenjector.OnApp <AppInstaller>().WithParameters(logger, pluginConfig, saberFactoryDir); zenjector.OnMenu <Installers.MenuInstaller>(); zenjector.OnGame <GameInstaller>(false); }
public Plugin(IPALogger logger, Config conf, Zenjector zenjector, PluginMetadata pluginMetadata) { Instance = this; PluginMetadata = pluginMetadata; Log = logger; Config = conf.Generated <PluginConfig>(); zenjector.OnApp <MPCoreInstaller>(); zenjector.OnMenu <MPMenuInstaller>(); zenjector.OnGame <MPGameInstaller>(); HttpOptions options = new HttpOptions("MultiplayerExtensions", new Version(pluginMetadata.Version.ToString())); BeatSaver = new BeatSaver(options); }
public void Init(IPALogger _logger, Zenjector zenjector) { Instance = this; Logger = _logger; Logger.Debug("Logger initialized."); #if DEBUG zenjector.OnApp <TestInstaller>(); //zenjector.OnGame<TestInstaller>().Expose<ScoreController>(); #endif webSocketServer = new Server.Server(); zenjector.OnGame <ClientInstaller>(false); zenjector.On <GameCoreSceneSetup>().Pseudo((_) => {}).Expose <ScoreUIController>(); }
public void InitWithConfig(Config conf, Zenjector zenjector) { Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>(); Log.Debug("Config loaded"); //new GameObject("FocusModController").AddComponent<FocusModController>(); harmony = new Harmony("Kinsi55.BeatSaber.FocusMod"); harmony.PatchAll(Assembly.GetExecutingAssembly()); zenjector.OnGame <FocusModInstaller>() //.Expose<AudioTimeSyncController>() .ShortCircuitForMultiplayer() .ShortCircuitForTutorial(); }
public Plugin(IPALogger logger, [Config.Name("CountersPlus")] Config conf, Zenjector zenjector) { Instance = this; Logger = logger; MainConfig = conf.Generated <MainConfigModel>(); harmony = new HarmonyObj(HARMONY_ID); zenjector.OnApp <CoreInstaller>(); zenjector.OnGame <CountersInstaller>() .Expose <CoreGameHUDController>() .ShortCircuitForTutorial() .ShortCircuitForMultiplayer(); // still dont have the time for this zenjector.OnMenu <MenuUIInstaller>(); }
public Plugin(IPALogger logger, [Config.Name("CountersPlus")] Config conf, Zenjector zenjector) { Instance = this; Logger = logger; MainConfig = conf.Generated <MainConfigModel>(); harmony = new HarmonyObj(HARMONY_ID); zenjector.OnApp <CoreInstaller>(); zenjector.OnGame <CountersInstaller>() .Expose <CoreGameHUDController>() .ShortCircuitForTutorial() .ShortCircuitForMultiplayer(); // This is until I can safely confirm that C+ works with Multiplayer. zenjector.OnMenu <MenuUIInstaller>(); }
public void Init(IPALogger logger, Config config, Zenjector zenjector, PluginMetadata meta) { Logger.log = logger; if (PluginManager.GetPluginFromId("ShaderExtensions") == null) { if (!LoadShaderDescriptors()) { return; } } zenjector.OnApp <DSCoreInstaller>().WithParameters(config.Generated <PluginConfig>()); zenjector.OnGame <DSGameInstaller>(false).ShortCircuitForTutorial(); zenjector.OnMenu <DSMenuInstaller>(); }
public Plugin(IPALogger logger, Config conf, Zenjector zenjector, PluginMetadata pluginMetadata) { Instance = this; PluginMetadata = pluginMetadata; Log = logger; Config = conf.Generated <PluginConfig>(); zenjector.OnApp <MPCoreInstaller>(); zenjector.OnMenu <MPMenuInstaller>(); zenjector.OnGame <MPGameInstaller>().OnlyForMultiplayer(); HttpOptions options = new HttpOptions("MultiplayerExtensions", new Version(pluginMetadata.Version.ToString())); BeatSaver = new BeatSaver(options); HttpClient = new HttpClient(); HttpClient.DefaultRequestHeaders.Add("User-Agent", Plugin.UserAgent); }
public Plugin(Conf conf, IPALogger logger, Zenjector zenjector, PluginMetadata metadata) { Log = logger; Config config = conf.Generated <Config>(); Config.Value = config; if (config.Version.ToString() == "0.0.0" && config.Clock.Position == new UnityEngine.Vector3(0f, 2.8f, 2.45f)) { config.Clock.Position = new UnityEngine.Vector3(0f, 3f, 3.9f); } config.Version = metadata.Version; _harmony = new Harmony("dev.auros.enhancements"); zenjector.OnApp <XInstaller>().WithParameters(config, metadata.Version); zenjector.OnGame <XGameInstaller>(false).ShortCircuitForTutorial(); zenjector.OnMenu <XMenuInstaller>(); }
public async void Init(IPALogger logger, Config conf, Zenjector zenjector) { _logger = logger; _harmony = new Harmony("com.tonimacaroni.saberfactory"); var pluginConfig = conf.Generated <PluginConfig>(); // Only create the folder if it's enabled // since some people don't want to have the folder in the top game directory if (pluginConfig.CreateCustomSabersFolder) { Directory.CreateDirectory(Path.Combine(UnityGame.InstallPath, "CustomSabers")); } if (!await LoadCSDescriptors()) { return; } zenjector.OnApp <AppInstaller>().WithParameters(logger, pluginConfig); zenjector.OnMenu <Installers.MenuInstaller>(); zenjector.OnGame <GameInstaller>(false); }
public Plugin(IPA.Config.Config conf, IPALogger logger, PluginMetadata metadata) { Log = logger; _pluginMetadata = metadata; 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, meta); _zenjectManager.Add(zen); return(zen); }); // Setup Own Zenject Stuff var zenjector = new Zenjector("SiraUtil", metadata); _zenjectManager.Add(zenjector); zenjector.OnApp <SiraInstaller>().WithParameters(config); zenjector.OnGame <SiraSaberInstaller>(false).ShortCircuitForTutorial(); zenjector.OnMenu <SiraMenuInstaller>(); zenjector.OnGame <SiraSaberEffectInstaller>() .Mutate <SaberBurnMarkArea>(InstallSaberArea) .Mutate <SaberBurnMarkSparkles>(InstallSaberSparkles) .Mutate <ObstacleSaberSparkleEffectManager>(InstallObstacleEffectManager) .Expose <SaberClashEffect>() .ShortCircuitForMultiplayer(); zenjector.OnGame <SiraGameLevelInstaller>() .Mutate <PrepareLevelCompletionResults>((ctx, completionResults) => { if (!ctx.Container.HasBinding <Submission>()) { ctx.Container.BindInterfacesAndSelfTo <Submission>().AsSingle(); } var binding = completionResults.GetComponent <ZenjectBinding>(); var siraCompletionResults = completionResults.Upgrade <PrepareLevelCompletionResults, Submission.SiraPrepareLevelCompletionResults>(); binding.SetField("_ifNotBound", true); ctx.Container.QueueForInject(siraCompletionResults); ctx.Container.Unbind(typeof(PrepareLevelCompletionResults)); ctx.Container.Bind <PrepareLevelCompletionResults>().To <Submission.SiraPrepareLevelCompletionResults>().FromInstance(siraCompletionResults).AsCached(); }).OnlyForStandard(); zenjector.OnGame <SiraGameLevelInstaller>() .Mutate <MissionLevelFinishedController>((ctx, controller) => { if (!ctx.Container.HasBinding <Submission>()) { ctx.Container.BindInterfacesAndSelfTo <Submission>().AsSingle(); } var siraController = controller.Upgrade <MissionLevelFinishedController, Submission.SiraMissionLevelFinishedController>(); ctx.Container.QueueForInject(siraController); ctx.AddInjectable(siraController); }).OnlyForCampaigns(); zenjector.OnGame <SiraGameInstaller>(true).ShortCircuitForMultiplayer(); zenjector.On <GameplayCoreInstaller>().Pseudo(Container => { if (System.DateTime.Now.Month == 4 && System.DateTime.Now.Day == 1 && AprilFools.maxInSession >= AprilFools.sessionTrack) { Container.BindInterfacesTo <AprilFools>().AsSingle(); } }).OnlyForStandard(); // multi specific for toni zenjector.OnGame <SiraMultiGameInstaller>(false) .Mutate <SaberBurnMarkArea>(InstallSaberArea) .Mutate <SaberBurnMarkSparkles>(InstallSaberSparkles) .Mutate <ObstacleSaberSparkleEffectManager>(InstallObstacleEffectManager) .Expose <SaberClashEffect>().OnlyForMultiplayer(); }