コード例 #1
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);
        }
コード例 #2
0
ファイル: Plugin.cs プロジェクト: ToniMacaroni/SaberFactoryV2
        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);
            });
        }
コード例 #3
0
ファイル: Plugin.cs プロジェクト: affederaffe/CustomPlatforms
 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);
 }
コード例 #4
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);
 }
コード例 #5
0
        public Plugin(Logger logger, Config config, Zenjector zenject)
        {
            zenject.UseLogger(logger);
            zenject.UseMetadataBinder <Plugin>();

            zenject.Install <ScvAppInstaller>(Location.App, config.Generated <PluginConfig>());
            zenject.Install <SvcMenuInstaller>(Location.Menu);
            zenject.Install <SvcGameInstaller>(Location.StandardPlayer | Location.MultiPlayer);
        }
コード例 #6
0
ファイル: Plugin.cs プロジェクト: PulseLane/PPCounter
 public Plugin(IPALogger logger, Config config, Zenjector zenject)
 {
     instance   = this;
     Logger.log = logger;
     Logger.log.Debug("Logger initialized.");
     zenject.Install <Installers.DataInstaller>(Location.App);
     zenject.Install <Installers.UtilsInstaller>(Location.App);
     Settings.PluginSettings.Instance = config.Generated <Settings.PluginSettings>();
 }
コード例 #7
0
ファイル: Plugin.cs プロジェクト: rithik-b/ControllerTweaks
        /// <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;

            zenjector.Install <ControllerTweaksRemapInstaller>(Location.Menu);
            zenjector.Install <ControllerTweaksMenuInstaller>(Location.Menu);
            zenjector.Install <ControllerTweaksGameInstaller>(Location.GameCore);
            zenjector.Install <ControllerTweaksStandardInstaller>(Location.StandardPlayer);
        }
コード例 #8
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, Config conf, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("BeatmapInformation initialized.");
     Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
     Log.Debug("Config loaded");
     zenjector.Install <BMInfoGameInstaller>(Location.Player);
     zenjector.Install <BMInfoMenuInstaller>(Location.Menu);
 }
コード例 #9
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.");
     s_harmony = new Harmony(HARMONY_ID);
     zenjector.Install <HttpStatusExtentionInstaller>(Location.Player);
     zenjector.Install <HttpStatusExtentionMenuAndGameInstaller>(Location.Menu | Location.Player);
     zenjector.Install <HttpStatusExxtentionAppInstaller>(Location.App);
 }
コード例 #10
0
        public void Init(Logger log, Config.Config config, Zenjector zenject)
        {
            Logger = log;
            ModListConfig.Instance ??= config.Generated <ModListConfig>();

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

            zenject.Install <MLAppInstaller>(Location.App, ModListConfig.Instance);
            zenject.Install <MLMenuInstaller>(Location.Menu);
        }
コード例 #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, Config config, Zenjector zenject)
        {
            Log = logger;

            Settings = config.Generated <SettingsStore>();

            zenject.Expose <GameEnergyUIPanel>("CEB_GameEnergyUIPanel");
            zenject.Install <CEBAppInstaller>(Location.App);
            zenject.Install <CEBMenuInstaller>(Location.Menu);
            zenject.Install <CEBGameInstaller>(Location.Player);
        }
コード例 #12
0
ファイル: Plugin.cs プロジェクト: ErisApps/HitScoreVisualizer
        public void Init(Logger logger, Config config, PluginMetadata pluginMetadata, Zenjector zenject)
        {
            Version = pluginMetadata.HVersion;

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

            zenject.Install <HsvAppInstaller>(Location.App, config.Generated <HSVConfig>());
            zenject.Install <HsvMenuInstaller>(Location.Menu);
            zenject.Install <HsvGameInstaller>(Location.Tutorial | Location.Player);
        }
コード例 #13
0
        public Plugin(IPALogger logger, Config config, Zenjector zenjector)
        {
            Logger.log = logger;

            PluginConfig pluginConfig = config.Generated <PluginConfig>();

            LayerUtils.pluginConfig = pluginConfig;
            zenjector.Install(Location.App, Container => Container.BindInstance(pluginConfig).AsSingle());
            zenjector.Install <CustomNotesCoreInstaller>(Location.App);
            zenjector.Install <CustomNotesMenuInstaller>(Location.Menu);
            zenjector.Install <CustomNotesGameInstaller>(Location.Player);
        }
コード例 #14
0
 public void Init(IPALogger logger, PluginMetadata meta, Config config, Zenjector zenjector)
 {
     Instance   = this;
     s_meta     = meta;
     Logger.Log = logger;
     Logger.Log.Debug("Logger initialized.");
     s_pluginConfig = config.Generated <PluginConfig>();
     zenjector.Install(Location.App, container =>
     {
         container.BindInterfacesAndSelfTo <PluginConfig>().FromInstance(s_pluginConfig);
     });
     zenjector.Install <ESCAppInstaller>(Location.App);
     zenjector.Install <ESCMenuInstaller>(Location.Menu);
 }
コード例 #15
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);
 }
コード例 #16
0
ファイル: Plugin.cs プロジェクト: qe201020335/HRCounter
        public void InitWithConfig(IPALogger logger, IPA.Config.Config conf, Zenjector zenject)
        {
            Instance      = this;
            Logger.logger = logger;
            Log           = logger;
            Log.Info("HRCounter initialized.");
            Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
            Log.Debug("Config loaded");
            AssetBundleManager.LoadAssetBundle();
            zenject.Install <GameplayHearRateInstaller>(Location.Player);
            zenject.Install <Installers.GameplayCoreInstaller>(Location.Player);
            // we don't want to popup the pause menu during multiplayer, that's not gonna help anything!
            zenject.Install <GamePauseInstaller>(Location.StandardPlayer | Location.CampaignPlayer);

            Log.Debug("Installers!");
        }
コード例 #17
0
        void Awake()
        {
            Helpers.Logger.LogText("-= Monke Map Loader started =-");

            HarmonyPatches.ApplyHarmonyPatches();
            Zenjector.Install <MainInstaller>().OnProject();
        }
コード例 #18
0
ファイル: Plugin.cs プロジェクト: Caeden117/CountersPlus
        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.Expose <CoreGameHUDController>("Environment");

            zenjector.Install <CoreInstaller>(Location.App);
            zenjector.Install <MenuUIInstaller>(Location.Menu);

            zenjector.Install <CountersInstaller>(Location.StandardPlayer | Location.CampaignPlayer);
            zenjector.Install <MultiplayerCountersInstaller, MultiplayerLocalActivePlayerInstaller>();
        }
コード例 #19
0
        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.HVersion;

            _harmony = new Harmony("dev.auros.enhancements");
            zenjector.Install <XInstaller>(Location.App, config, metadata.HVersion);
            zenjector.Install <XGameInstaller>(Location.Player);
            zenjector.Install <XMenuInstaller>(Location.Menu);
        }
コード例 #20
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);
 }
コード例 #21
0
        public Plugin(IPALogger logger, Zenjector zenjector)
        {
            Log = logger;
            zenjector.UseMetadataBinder <Plugin>();

            // Register our Installer
            zenjector.Install <DiDMenuInstaller>(Location.Menu);
            zenjector.UseLogger(logger);
        }
コード例 #22
0
ファイル: Plugin.cs プロジェクト: Auros/Actions
        public Plugin(Conf conf, IPALogger log, Zenjector zenjector, PluginMetadata metadata)
        {
            Config config = conf.Generated <Config>();

            config.Version = metadata.HVersion;

            zenjector.UseLogger(log);
            zenjector.Install <ActionsCoreInstaller>(Location.App);
            zenjector.Install(Location.App, Container =>
            {
                Container.BindInstance(config).AsSingle();
                Container.BindInstance(metadata).WithId(nameof(Actions)).AsCached();
            });

            zenjector.Install <ActionsMenuInstaller>(Location.Menu);
            zenjector.Install <ActionsDashboardMenuInstaller>(Location.Menu);
            zenjector.Install <ActionsDashboardGameInstaller>(Location.Player);
        }
コード例 #23
0
        void Awake()
        {
            Zenjector.Install <MainInstaller>().OnProject();
            Events.RoomJoined += RoomJoined;

            harmony = new Harmony(PluginInfo.GUID);
            if (!modEnabled)
            {
                OnEnable();
            }
        }
コード例 #24
0
ファイル: Plugin.cs プロジェクト: SamuelTulach/SaberHighlight
        public void Init(Config config, IPALogger logger, Zenjector zenjector)
        {
            Instance        = this;
            Log             = logger;
            CurrentSettings = config.Generated <Settings>();

            Highlights.HighlightScope[] requiredScopes = new
                                                         Highlights.HighlightScope[2]
            {
                Highlights.HighlightScope.Highlights,
                Highlights.HighlightScope.HighlightsRecordVideo,
            };

            var status = Highlights.CreateHighlightsSDK("SaberHighlight", requiredScopes);

            if (status != Highlights.ReturnCode.SUCCESS)
            {
                Log.Critical($"Failed to initialize highlights! ({status})");
                Highlights.UpdateLog();
                return;
            }

            Highlights.RequestPermissions(Highlight.LogCallback);

            Highlights.HighlightDefinition[] highlightDefinitions = new Highlights.HighlightDefinition[1];

            highlightDefinitions[0].Id            = "MAP_PLAY";
            highlightDefinitions[0].HighlightTags = Highlights.HighlightType.Achievement;

            highlightDefinitions[0].Significance = Highlights.HighlightSignificance.Good;

            highlightDefinitions[0].UserDefaultInterest  = true;
            highlightDefinitions[0].NameTranslationTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Map play"),
            };

            Highlights.ConfigureHighlights(highlightDefinitions, "en-US", Highlight.LogCallback);

            Highlights.OpenGroupParams ogp1 = new Highlights.OpenGroupParams();
            ogp1.Id = "MAP_PLAY_GROUP";
            ogp1.GroupDescriptionTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Map play group"),
            };

            Highlights.OpenGroup(ogp1, Highlight.LogCallback);

            zenjector.Install <Installer>(Location.Player);

            Log.Info("Loaded.");
        }
コード例 #25
0
 public Plugin(Conf conf, IPALogger logger, Zenjector zenjector)
 {
     zenjector.UseLogger(logger);
     zenjector.Install <PluginInstaller>(Location.App, conf.Generated <PluginConfig>());
     zenjector.Install <PresenceMenuInstaller>(Location.Menu);
     zenjector.Expose <CoreGameHUDController>("Gameplay");
     zenjector.Install <PresenceGameInstaller>(Location.StandardPlayer);
     zenjector.Install <PresenceGameInstaller>(Location.CampaignPlayer);
     zenjector.Install <PresenceTutorialInstaller>(Location.Tutorial);
     zenjector.Install <PresenceMultiplayerInstaller>(Location.MultiPlayer);
 }
コード例 #26
0
        public void Init(object _, IPALogger log, Zenjector zenjector)
        {
            Log = log;

            GameObject sabers;

            using (var stream = Assembly.GetManifestResourceStream(ClawsSaberResourceName))
            {
                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.Install(Location.Player, container =>
            {
                if (!IsEnabled)
                {
                    return;
                }
                container.BindInstance(SaberModelRegistration.Create <ClawsModelController>(int.MaxValue));
            });
        }
コード例 #27
0
ファイル: Plugin.cs プロジェクト: JonnyXDA/Technicolor
 public Plugin(Logger pluginLogger, Config config, Zenjector zenjector)
 {
     Log.Logger = new HeckLogger(pluginLogger);
     TechnicolorConfig.Instance = config.Generated <TechnicolorConfig>();
     zenjector.Install <PlayerInstaller>(Location.Player);
 }
コード例 #28
0
 public Plugin(Zenjector zenjector, Logger logger, Config config)
 {
     zenjector.Install <SmallMenuInstaller>(Location.Menu, logger, config.Generated <Settings>());
 }
コード例 #29
0
 public Plugin(Config config, Zenjector zenject)
 {
     zenject.Install <MPPHMenuInstaller>(Location.Menu, config.Generated <PluginConfig>());
 }