hide local plugins by default

to see local plugins, click the "show only enabled" button (next to search bar) twice
This commit is contained in:
2022-12-14 14:40:12 -05:00
parent 05d222f9aa
commit ceb924e344

View File

@@ -26,6 +26,7 @@ public class MyGuiScreenPluginConfig : MyGuiScreenBase
private const float Spacing = 0.0175f;
private static bool allItemsVisible = true;
private static bool _hideLocalPlugins = true;
public readonly Dictionary<string, bool> AfterRebootEnableFlags = new();
@@ -349,14 +350,19 @@ public class MyGuiScreenPluginConfig : MyGuiScreenBase
/// <param name="btn">The button to assign this event to.</param>
private void OnVisibilityClick(MyGuiControlButton btn)
{
if (allItemsVisible)
if (allItemsVisible && _hideLocalPlugins)
{
allItemsVisible = false;
btn.Icon = IconShow;
}
else
else if (_hideLocalPlugins)
{
allItemsVisible = true;
_hideLocalPlugins = false;
}
else
{
_hideLocalPlugins = true;
btn.Icon = IconHide;
}
@@ -405,6 +411,8 @@ public class MyGuiScreenPluginConfig : MyGuiScreenBase
foreach (var plugin in list)
{
var enabled = AfterRebootEnableFlags[plugin.Id];
if (plugin.IsLocal && _hideLocalPlugins) continue;
if (noFilter && (plugin.Hidden || !allItemsVisible) && !enabled)
continue;