Editor/Tileset/TilesetEditorWindow.cs

This class implements an editor window for tileset assets. It defines window properties, sets up the layout, and loads the selected tileset data into the content view upon opening.

using Editor;

namespace Saandy.Editor.Tilemapper;

[EditorForAssetType( "tileset" )]
public sealed class TilesetEditorWindow : Window, IAssetEditor
{
	public bool CanOpenMultipleAssets => false;
	private readonly TilesetEditorContent Content;

	public TilesetEditorWindow()
	{
		WindowTitle = "Tileset Editor";
		DeleteOnClose = true;
		Size = new Vector2( 1360, 900 );
		MinimumSize = new Vector2( 1000, 640 );
		// Window owns its outer layout (title/menu/status chrome). Its Canvas is
		// the managed client area and automatically follows window resizing.
		Content = new TilesetEditorContent( this );
		Canvas = Content;
		StatusBar.Visible = false;
		Show();
	}

	public void AssetOpen( Asset asset )
	{
		if ( asset == null ) { return; }
		WindowTitle = $"Tileset Editor — {asset.Name}";
		Content.SetAsset( asset );
	}

	public void SelectMember( string memberName ) { }
}