private void OnGameLaunched(object sender, GameLaunchedEventArgs e) { // Set our default config config = Helper.ReadConfig <ModConfig>(); // Hook into the APIs we utilize if (Helper.ModRegistry.IsLoaded("spacechase0.GenericModConfigMenu") && ApiManager.HookIntoGMCM(Helper)) { // Register our config options var configAPI = ApiManager.GetGMCMInterface(); configAPI.RegisterModConfig(ModManifest, () => config = new ModConfig(), () => Helper.WriteConfig(config)); configAPI.RegisterClampedOption(ModManifest, "Follower Speed (Walking)", "", () => config.walkingSpeed, (int val) => config.walkingSpeed = val, 1, 8); } // Hook into the APIs we utilize if (Helper.ModRegistry.IsLoaded("spacechase0.JsonAssets") && ApiManager.HookIntoJsonAssets(Helper)) { // Load in our ring assets var jsonAssetsApi = ApiManager.GetJsonAssetsApi(); jsonAssetsApi.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets", "[JA] Cosmetic Rings Pack")); } if (Helper.ModRegistry.IsLoaded("bcmpinc.WearMoreRings") && ApiManager.HookIntoIWMR(Helper)) { wearMoreRingsApi = ApiManager.GetIWMRApi(); } }
internal static void Initialize(IModHelper helper) { Helper = helper; CP = Helper.ModRegistry.GetApi <IContentPatcherApi>("Pathoschild.ContentPatcher"); if (CP is null) { Log.Alert("Content Patcher is not installed - RSV requires CP to run. Please install CP and restart your game."); return; } JA = Helper.ModRegistry.GetApi <IJsonAssetsApi>("spacechase0.JsonAssets"); if (JA == null) { Log.Warn("Json Assets API not found. This could lead to issues."); } MR = Helper.ModRegistry.GetApi <IWearMoreRingsApi>("bcmpinc.WearMoreRings"); if (MR == null) { Log.Trace("Wear More Rings API not found. Using base game ring slots only."); } SC = Helper.ModRegistry.GetApi <ISpaceCoreApi>("spacechase0.SpaceCore"); if (SC == null) { Log.Warn("SpaceCore API not found. This could lead to issues."); } QF = Helper.ModRegistry.GetApi <IQuestFrameworkApi>("purrplingcat.QuestFramework"); if (QF == null) { Log.Warn("Quest Framework API not found. This could lead to issues."); } }
internal static bool HookIntoIWMR(IModHelper helper) { wearMoreRingsApi = helper.ModRegistry.GetApi <IWearMoreRingsApi>("bcmpinc.WearMoreRings"); if (wearMoreRingsApi is null) { monitor.Log("Failed to hook into bcmpinc.WearMoreRings.", LogLevel.Error); return(false); } monitor.Log("Successfully hooked into bcmpinc.WearMoreRings.", LogLevel.Debug); return(true); }