Editor/Tool/ArchToolSettings.cs

Editor utility for storing which architecture subtools are hidden. Reads and writes per-tool hidden flags via EditorCookie and can unhide all tools by iterating ArchShelves.

File Access
using Editor;

namespace Sunless.Architecture;

// Which subtools this author has taken off their shelves. A tool nobody wants used to be a library nobody
// installed; with one library it is a setting, so a map with no roads on it need not carry the road column.
public static class ArchToolSettings
{
	public static bool Hidden( string ident ) => EditorCookie.Get( Key( ident ), false );

	public static void Hide( string ident, bool hidden ) => EditorCookie.Set( Key( ident ), hidden );

	public static void ShowEverything()
	{
		foreach ( var shell in ArchShelves.Shells )
		{
			foreach ( var entry in ArchShelves.All( shell ) )
			{
				Hide( entry.Ident, false );
			}
		}
	}

	static string Key( string ident ) => $"arch.shelf.hidden.{ident}";
}