Beispiel #1
0
    public bool Enable()
    {
        if (Config.EnableMods)
        {
            return(false);
        }

        Config.EnableMods = true;
        ResourceLoader.EnableReplacements();
        CollectionManager.Default.SetFiles();
        ResidentResources.Reload();
        PathResolver.Enable();

        Config.Save();
        ObjectReloader.RedrawAll(RedrawType.Redraw);
        return(true);
    }
Beispiel #2
0
        public bool Disable()
        {
            if (!Config.IsEnabled)
            {
                return(false);
            }

            Config.IsEnabled = false;
            Service <ResidentResources> .Get().ReloadPlayerResources();

            if (Config.EnablePlayerWatch)
            {
                PlayerWatcher.SetStatus(false);
            }

            Config.Save();
            ObjectReloader.RedrawAll(RedrawType.WithoutSettings);
            return(true);
        }
Beispiel #3
0
        private void OnCommand(string command, string rawArgs)
        {
            const string modsEnabled  = "Your mods have now been enabled.";
            const string modsDisabled = "Your mods have now been disabled.";

            var args = rawArgs.Split(new[] { ' ' }, 2);

            if (args.Length > 0 && args[0].Length > 0)
            {
                switch (args[0])
                {
                case "reload":
                {
                    Service <ModManager> .Get().DiscoverMods();

                    Dalamud.Chat.Print(
                        $"Reloaded Penumbra mods. You have {Service< ModManager >.Get()?.Mods.Count} mods."
                        );
                    break;
                }

                case "redraw":
                {
                    if (args.Length > 1)
                    {
                        ObjectReloader.RedrawObject(args[1]);
                    }
                    else
                    {
                        ObjectReloader.RedrawAll();
                    }

                    break;
                }

                case "debug":
                {
                    SettingsInterface.MakeDebugTabVisible();
                    break;
                }

                case "enable":
                {
                    Dalamud.Chat.Print(Enable()
                            ? "Your mods are already enabled. To disable your mods, please run the following command instead: /penumbra disable"
                            : modsEnabled);
                    break;
                }

                case "disable":
                {
                    Dalamud.Chat.Print(Disable()
                            ? "Your mods are already disabled. To enable your mods, please run the following command instead: /penumbra enable"
                            : modsDisabled);
                    break;
                }

                case "toggle":
                {
                    SetEnabled(!Config.IsEnabled);
                    Dalamud.Chat.Print(Config.IsEnabled
                            ? modsEnabled
                            : modsDisabled);
                    break;
                }
                }

                return;
            }

            SettingsInterface.FlipVisibility();
        }
Beispiel #4
0
        public void RedrawAll(RedrawType setting)
        {
            CheckInitialized();

            _penumbra !.ObjectReloader.RedrawAll(setting);
        }