public ActivityItemLoaderWindow(ModScanner scanner, ModActivityItemsLoader activityItemsLoader)
        {
            this.scanner             = scanner;
            this.activityItemsLoader = activityItemsLoader;

            InitializeComponent();

            if (Grabber.ActivityItemCache == null)
            {
                Grabber.ActivityItemCache = new ActivityItemCache(scanner, ".modcache");
            }

            loadingWorker                  = new BackgroundWorker();
            loadingWorker.DoWork          += (o, e) => LoadActivityItems();
            loadingWorker.ProgressChanged += (e, o) =>
            {
                if (o.UserState is Mod)
                {
                    loadingLabel.Content = ((Mod)o.UserState).Folder;
                }
                if (o.UserState is string)
                {
                    loadingLabel.Content = (string)o.UserState;
                }
            };
            loadingWorker.RunWorkerCompleted   += (o, e) => Close();
            loadingWorker.WorkerReportsProgress = true;
            loadingWorker.RunWorkerAsync();
        }
        /// <summary>Disables a mod and returns the new location of the mod</summary>
        public void DisableMod(Mod mod)
        {
            var source      = mod.FullFolderPath;
            var destination = Path.Combine(DisabledModPath, mod.Folder);

            Directory.Move(source, destination);

            InvalidateCache();

            mod.IsEnabled      = false;
            mod.FullFolderPath = destination;
            mod.IconPath       = ModScanner.FindModImagePath(destination);
        }
        /// <summary>Enables a mod and returns the new location of the mod</summary>
        public void EnableMod(Mod mod)
        {
            var source      = mod.FullFolderPath;
            var destination = Path.Combine(settings.Get().CCInstallDirectory, mod.Folder);

            Directory.Move(source, destination);

            InvalidateCache();

            mod.IsEnabled      = true;
            mod.FullFolderPath = destination;
            mod.IconPath       = ModScanner.FindModImagePath(destination);
        }
        public ActivityItemLoaderWindow(ModScanner scanner, ModActivityItemsLoader activityItemsLoader)
        {
            this.scanner = scanner;
            this.activityItemsLoader = activityItemsLoader;

            InitializeComponent();

            if (Grabber.ActivityItemCache == null)
                Grabber.ActivityItemCache = new ActivityItemCache(scanner, ".modcache");

            loadingWorker = new BackgroundWorker();
            loadingWorker.DoWork += (o, e) => LoadActivityItems();
            loadingWorker.ProgressChanged += (e, o) =>
                {
                    if(o.UserState is Mod)
                        loadingLabel.Content = ((Mod)o.UserState).Folder;
                    if (o.UserState is string)
                        loadingLabel.Content = (string)o.UserState;
                };
            loadingWorker.RunWorkerCompleted += (o, e) => Close();
            loadingWorker.WorkerReportsProgress = true;
            loadingWorker.RunWorkerAsync();
        }
Пример #5
0
 public PresetManager(ModScanner scanner, ModManager modManager)
 {
     this.scanner    = scanner;
     this.modManager = modManager;
 }
 public PresetManager(ModScanner scanner, ModManager modManager)
 {
     this.scanner = scanner;
     this.modManager = modManager;
 }