Ejemplo n.º 1
0
    public void UpdateExpertProfile()
    {
        if (Operation == SetOperation.Expert)
        {
            bool rewrite;
            if (EnabledList != null)
            {
                // Enable mods in both lists.
                int oldCount = DisabledList.Count;
                DisabledList.ExceptWith(EnabledList);
                rewrite = DisabledList.Count != oldCount;

                // Disable mods in neither list (not installed where the profile was made).
                oldCount = DisabledList.Count;
                DisabledList.UnionWith(ModSelectorService.Instance._allExpertMods.Except(EnabledList));
                rewrite |= DisabledList.Count != oldCount;
            }
            else
            {
                rewrite = true;
            }
            if (rewrite)
            {
                Save();
            }
        }
        else if (EnabledList != null)
        {
            EnabledList = null;
            Save();
        }
    }
Ejemplo n.º 2
0
    public void EnableAllOfType(ModSelectorService.ModType modType, bool save = true)
    {
        string[] modNames = ModSelectorService.Instance.GetModNames(modType).ToArray();
        DisabledList.ExceptWith(modNames);
        ProfileManager.UpdateProfileSelection();

        if (save)
        {
            Save();
        }
    }