Allows enabling/disabling installed extensions#1275
Allows enabling/disabling installed extensions#1275jtreminio wants to merge 5 commits intomcmonkeyprojects:masterfrom
Conversation
|
I think you overcomplicated this -- you can already disable extensions by putting EDIT: on discord fair counter to this was given |
| } | ||
|
|
||
| /// <summary>Returns normalized "src/Extensions/{folderName}/" for a direct child folder match, or null if not found.</summary> | ||
| public static string GetNormalizedExtensionFolderPath(string folderName) |
There was a problem hiding this comment.
This function does nothing
| } | ||
|
|
||
| /// <summary>Builds <see cref="DisabledExtensions"/> and returns disabled extension folders.</summary> | ||
| public HashSet<string> BuildDisabledExtensionsAndGetDisabledFolders() |
There was a problem hiding this comment.
This function is slowly manually rebuilding a list that's already saved? And is redundant
| { | ||
| return false; | ||
| } | ||
| int removed = Program.ServerSettings.Extensions.DisabledExtensions.RemoveAll(f => string.Equals(f, folderName, StringComparison.OrdinalIgnoreCase)); |
There was a problem hiding this comment.
these string.equals ordinal things still do not need to exist as commented before
| /// <summary>Removes an extension folder from the disabled list in settings.</summary> | ||
| public bool RemoveDisabledExtensionSetting(string folderName) | ||
| { | ||
| folderName = folderName?.Trim(); |
There was a problem hiding this comment.
all these cleanups and checks aren't needed
| public HashSet<string> InstalledExtensionFolders = []; | ||
|
|
||
| /// <summary>Folder names of disabled extensions.</summary> | ||
| public HashSet<string> DisabledExtensions = []; |
There was a problem hiding this comment.
This field is a duplicate tracker of what's already in settings
| <th>Actions</th> | ||
| </tr> | ||
| @foreach (ExtensionsManager.ExtensionInfo ext in Program.Extensions.KnownExtensions.Where(e => !Program.Extensions.LoadedExtensionFolders.Contains(e.FolderName) && !e.Tags.Contains("hidden"))) | ||
| @foreach (ExtensionsManager.ExtensionInfo ext in Program.Extensions.KnownExtensions.Where(e => !Program.Extensions.InstalledExtensionFolders.Contains(e.FolderName) && !e.Tags.Contains("hidden"))) |
| public HashSet<string> LoadedExtensionFolders = []; | ||
|
|
||
| /// <summary>Hashset of folder names of all extensions currently installed (loaded or disabled).</summary> | ||
| public HashSet<string> InstalledExtensionFolders = []; |
There was a problem hiding this comment.
This is a redundant duplicate of already tracked data
I can keep the button in its current slot, or move it somewhere else.
All enabled:
Pending restart after disable:
One disabled: