Esempio n. 1
0
        private void AddConsoleCommands()
        {
            Globals.Helper.ConsoleCommands.Add("cbc_dump", "Dumps the current config values from Configurable Bundle Costs", (name, arg) => Globals.Monitor.Log(Globals.CurrentValues.ToString()));

            Globals.Helper.ConsoleCommands.Add("cbc_reload_packs", "Reloads the internal list of content packs", (name, arg) => ContentPackHelper.ReloadContentPacks());
            Globals.Helper.ConsoleCommands.Add("cbc_list_packs", "Lists the currently loaded content packs", (name, arg) =>
            {
                foreach (ContentPackData data in ContentPackHelper.GetContentPackList())
                {
                    Globals.Monitor.Log(data.GetFolderName());
                }
            }
                                               );
            Globals.Helper.ConsoleCommands.Add("cbc_reload_patches", "Reloads the internal list of patches", (name, arg) => ContentPackHelper.ReloadContentPacks(forcePatchReload: true));
            Globals.Helper.ConsoleCommands.Add("cbc_list_patches", "Lists the currently parsed patches", (name, arg) =>
            {
                foreach (ContentPackItem patch in ContentPackHelper.GetPatchList())
                {
                    Globals.Monitor.Log(patch.Name);
                }
            }
                                               );

            Globals.Helper.ConsoleCommands.Add("cbc_reload_config", "Forces the current config values to be reloaded. Note that this will overwrite any changes which have occurred on this save's config file." +
                                               "This command will have no effect outside of a loaded save.",
                                               (name, arg) =>
            {
                if (Context.IsWorldReady)
                {
                    Globals.Monitor.Log("Reloading config values from file.");
                    ContentPackHelper.ProcessConfigOverrides(forceReload: true);
                }
                else
                {
                    Globals.Monitor.Log("This console command should only be used inside a loaded save.");
                }
            }
                                               );
        }
Esempio n. 2
0
 private void CheckForContentPatcherAPI()
 {
     Monitor.Log(ContentPackHelper.TryLoadContentPatcherAPI() ? "Content Patcher API loaded" : "Failed to load Content Patcher API - ignoring extended content pack functionality");
 }