Exemplo n.º 1
0
        private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
        {
            var api = Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");

            if (api == null)
            {
                Monitor.Log("Install JsonAssets", LogLevel.Error);
                return;
            }

            ja = api;

            api.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets"));

            wearMoreRingsAPI = Helper.ModRegistry.GetApi <WearMoreRingsAPI>("bcmpinc.WearMoreRings");

            var api2 = Helper.ModRegistry.GetApi <GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (api2 == null)
            {
                return;
            }

            api2.RegisterModConfig(ModManifest, () => Config = new ModConfig(), () => Helper.WriteConfig(Config));
            api2.RegisterSimpleOption(ModManifest, "Enabled", "Control the magical effects of the ring", () => Config.MushroomTreeRingEnabled, (bool val) => Config.MushroomTreeRingEnabled = val);
            api2.RegisterClampedOption(ModManifest, "Base % Chance", "The base % chance that a tree can change", () => Convert.ToSingle(Config.MushroomTreeRingBasePercentChance), (float val) => Config.MushroomTreeRingBasePercentChance    = Convert.ToDouble(val), 0, 1);
            api2.RegisterSimpleOption(ModManifest, "Frequency to Gain Chance", "60 'ticks' per second, 60 seconds per minute", () => (int)Config.MushroomTreeRingChanceGainFrequency, (int val) => Config.MushroomTreeRingChanceGainFrequency = (uint)val);
            api2.RegisterSimpleOption(ModManifest, "Foraging Bonus", "Get up to 2% based on current foraging skill?", () => Config.MushroomTreeRingUseForagingBonus, (bool val) => Config.MushroomTreeRingUseForagingBonus = val);
            api2.RegisterSimpleOption(ModManifest, "Luck Bonus", "Use the day's luck in calculating chance?", () => Config.MushroomTreeRingUseLuckBonus, (bool val) => Config.MushroomTreeRingUseLuckBonus = val);
            api2.RegisterClampedOption(ModManifest, "Somewhat Lucky", "The % modified by being somewhat lucky", () => Convert.ToSingle(Config.MushroomTreeRingSomewhatLuckyBonusAmount), (float val) => Config.MushroomTreeRingSomewhatLuckyBonusAmount = Convert.ToDouble(val), 0, 1);
            api2.RegisterClampedOption(ModManifest, "Very Lucky", "The % modified by being very lucky", () => Convert.ToSingle(Config.MushroomTreeRingVeryLuckBonusAmount), (float val) => Config.MushroomTreeRingVeryLuckBonusAmount = Convert.ToDouble(val), 0, 1);
            api2.RegisterSimpleOption(ModManifest, "Chance Bonus", "Increase the chance of a Mushroom Tree for each chance gained.", () => Config.MushroomTreeRingUseChanceBonus, (bool val) => Config.MushroomTreeRingUseChanceBonus = val);
            api2.RegisterClampedOption(ModManifest, "Percent Gained Per Chance", "The % modified per chance gained.", () => Convert.ToSingle(Config.MushroomTreeRingChancePerIntervalPercent), (float val) => Config.MushroomTreeRingChancePerIntervalPercent = Convert.ToDouble(val), 0, 1);
        }
Exemplo n.º 2
0
        private void onGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            ja = Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");
            var spaceCore = Helper.ModRegistry.GetApi <SpaceCoreAPI>("spacechase0.SpaceCore");

            spaceCore.RegisterSerializerType(typeof(BugNetTool));
        }
Exemplo n.º 3
0
 private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
 {
     jsonAssets              = this.Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");
     jsonAssets.IdsAssigned += delegate(object sender2, EventArgs e2)
     {
         wt_id = jsonAssets.GetObjectId("White Turnip");
         sp_id = jsonAssets.GetObjectId("Spoiled Turnip");
     };
 }
Exemplo n.º 4
0
        private void onGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            this.jsonAssetsAPI = this.helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");
            string path = Path.Combine(this.Helper.DirectoryPath, "assets");

            this.jsonAssetsAPI.LoadAssets(path);
            this.jsonAssetsAPI.IdsAssigned += this.onIdsAssigned;
            this.animationAssetKey          = this.Helper.Content.GetActualAssetKey("assets/rope-animated.png", ContentSource.ModFolder);
            this.Monitor.Log($"loaded asset {this.animationAssetKey}");
        }
Exemplo n.º 5
0
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            var api = Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");

            if (api != null)
            {
                ja = api;
                Monitor.Log("Found Json Assets API", LogLevel.Info);
            }
            else
            {
                Monitor.Log("No Json Assets API", LogLevel.Info);
            }
        }
Exemplo n.º 6
0
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void onGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            var api = Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");

            if (api == null)
            {
                Log.error("No Json Assets API???");
                return;
            }
            ja = api;

            api.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets"));

            moreRings = Helper.ModRegistry.GetApi <MoreRingsApi>("bcmpinc.WearMoreRings");
        }
Exemplo n.º 7
0
 public static int getObjectIDFromAsset(string oreName)
 {
     if (jsonAssetsLoaded)
     {
         if (jsonAssets == null)
         {
             jsonAssets = Mod.instance.Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");
             if (jsonAssets == null)
             {
                 Mod.instance.Monitor.Log("Tried to load object " + oreName + " but could not find JsonAssets.", StardewModdingAPI.LogLevel.Error);
                 //jsonAssetsLoaded = false;
             }
             int ans = Mod.jsonAssets.GetObjectId(oreName);
             if (ans < 0)
             {
                 Mod.instance.Monitor.Log("Tried to load object " + oreName + " but JsonAssets could not find it.", StardewModdingAPI.LogLevel.Error);
                 return(-1000);
             }
             return(ans);
         }
     }
     return(-1000);
 }
Exemplo n.º 8
0
 private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
 {
     ja = Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");
 }
Exemplo n.º 9
0
 private void onGameLaunched(object sender, GameLaunchedEventArgs e)
 {
     ja = Helper.ModRegistry.GetApi <JsonAssetsAPI>("spacechase0.JsonAssets");
     ja.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets", "ja"));
     ja.IdsFixed += onIdsFixed;
 }