Example #1
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 capi = Helper.ModRegistry.GetApi <GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (capi != null)
            {
                capi.RegisterModConfig(ModManifest, () => Config = new Configuration(), () => Helper.WriteConfig(Config));
                capi.RegisterSimpleOption(ModManifest, "Altar Location", "The (internal) name of the location the magic altar should be placed at.", () => Config.AltarLocation, (string val) => Config.AltarLocation = val);
                capi.RegisterSimpleOption(ModManifest, "Altar X", "The X tile position of where the magic altar should be placed.", () => Config.AltarX, (int val) => Config.AltarX = val);
                capi.RegisterSimpleOption(ModManifest, "Altar Y", "The Y tile position of where the magic altar should be placed.", () => Config.AltarY, (int val) => Config.AltarY = val);
                capi.RegisterSimpleOption(ModManifest, "Key: Cast", "The key to initiate casting a spell.", () => Config.Key_Cast, (SButton val) => Config.Key_Cast           = val);
                capi.RegisterSimpleOption(ModManifest, "Key: Swap Spells", "The key to swap spell sets.", () => Config.Key_SwapSpells, (SButton val) => Config.Key_SwapSpells = val);
                capi.RegisterSimpleOption(ModManifest, "Key: Spell 1", "The key for spell 1.", () => Config.Key_Spell1, (SButton val) => Config.Key_Spell1 = val);
                capi.RegisterSimpleOption(ModManifest, "Key: Spell 2", "The key for spell 2.", () => Config.Key_Spell2, (SButton val) => Config.Key_Spell2 = val);
                capi.RegisterSimpleOption(ModManifest, "Key: Spell 3", "The key for spell 3.", () => Config.Key_Spell3, (SButton val) => Config.Key_Spell3 = val);
                capi.RegisterSimpleOption(ModManifest, "Key: Spell 4", "The key for spell 4.", () => Config.Key_Spell4, (SButton val) => Config.Key_Spell4 = val);
                capi.RegisterSimpleOption(ModManifest, "Key: Spell 5", "The key for spell 5.", () => Config.Key_Spell5, (SButton val) => Config.Key_Spell5 = val);
            }

            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"));
        }
Example #2
0
        /*********
        ** Private methods
        *********/
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            config = Helper.ReadConfig <ModConfig>();

            ModConfig.Initialize(this);

            jsonAssetsApi = Helper.ModRegistry.GetApi <JsonAssetsApi>("spacechase0.JsonAssets");
            jsonAssetsApi.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets", "JsonAssets"));
        }
Example #3
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"));
        }