Exemple #1
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            PluginInterface = pluginInterface;

            Configuration = PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
            Configuration.Initialize(PluginInterface);

            GameUtils = new GameUtils(PluginInterface);

            ModManager = new ModManager(this);
            ModManager.DiscoverMods(Configuration.CurrentCollection);

            ResourceLoader = new ResourceLoader(this);

            PluginInterface.CommandManager.AddHandler(CommandName, new CommandInfo(OnCommand)
            {
                HelpMessage = "/penumbra - toggle ui\n/penumbra reload - reload mod file lists & discover any new mods"
            });

            ResourceLoader.Init();
            ResourceLoader.Enable();

            SettingsInterface = new SettingsInterface(this);
            PluginInterface.UiBuilder.OnBuildUi += SettingsInterface.Draw;

            PluginDebugTitleStr = $"{Name} - Debug Build";

            if (Configuration.EnableHttpApi)
            {
                CreateWebServer();
            }
        }
Exemple #2
0
        private void OnCommand(string command, string rawArgs)
        {
            var args = rawArgs.Split(' ');

            if (args.Length > 0 && args[0].Length > 0)
            {
                switch (args[0])
                {
                case "reload":
                {
                    ModManager.DiscoverMods();
                    PluginInterface.Framework.Gui.Chat.Print(
                        $"Reloaded Penumbra mods. You have {ModManager.Mods.ModSettings.Count} mods, {ModManager.Mods.EnabledMods.Length} of which are enabled."
                        );
                    break;
                }
                }

                return;
            }

            SettingsInterface.Visible = !SettingsInterface.Visible;
        }
Exemple #3
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            PluginInterface = pluginInterface;

            Configuration = PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
            Configuration.Initialize(PluginInterface);

            ModManager = new ModManager(new DirectoryInfo(Configuration.BaseFolder));
            ModManager.DiscoverMods();

            ResourceLoader = new ResourceLoader(this);


            PluginInterface.CommandManager.AddHandler(CommandName, new CommandInfo(OnCommand)
            {
                HelpMessage = "/penumbra 0 will disable penumbra, /penumbra 1 will enable it."
            });

            ResourceLoader.Init();
            ResourceLoader.Enable();

            SettingsInterface = new SettingsInterface(this);
            PluginInterface.UiBuilder.OnBuildUi += SettingsInterface.Draw;
        }