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:
@@ -26,6 +26,7 @@ public class MyGuiScreenPluginConfig : MyGuiScreenBase
|
|||||||
private const float Spacing = 0.0175f;
|
private const float Spacing = 0.0175f;
|
||||||
|
|
||||||
private static bool allItemsVisible = true;
|
private static bool allItemsVisible = true;
|
||||||
|
private static bool _hideLocalPlugins = true;
|
||||||
|
|
||||||
public readonly Dictionary<string, bool> AfterRebootEnableFlags = new();
|
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>
|
/// <param name="btn">The button to assign this event to.</param>
|
||||||
private void OnVisibilityClick(MyGuiControlButton btn)
|
private void OnVisibilityClick(MyGuiControlButton btn)
|
||||||
{
|
{
|
||||||
if (allItemsVisible)
|
if (allItemsVisible && _hideLocalPlugins)
|
||||||
{
|
{
|
||||||
allItemsVisible = false;
|
allItemsVisible = false;
|
||||||
btn.Icon = IconShow;
|
btn.Icon = IconShow;
|
||||||
}
|
}
|
||||||
else
|
else if (_hideLocalPlugins)
|
||||||
{
|
{
|
||||||
allItemsVisible = true;
|
allItemsVisible = true;
|
||||||
|
_hideLocalPlugins = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_hideLocalPlugins = true;
|
||||||
btn.Icon = IconHide;
|
btn.Icon = IconHide;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,6 +412,8 @@ public class MyGuiScreenPluginConfig : MyGuiScreenBase
|
|||||||
{
|
{
|
||||||
var enabled = AfterRebootEnableFlags[plugin.Id];
|
var enabled = AfterRebootEnableFlags[plugin.Id];
|
||||||
|
|
||||||
|
if (plugin.IsLocal && _hideLocalPlugins) continue;
|
||||||
|
|
||||||
if (noFilter && (plugin.Hidden || !allItemsVisible) && !enabled)
|
if (noFilter && (plugin.Hidden || !allItemsVisible) && !enabled)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user