diff --git a/editor/ArtItem.cs b/editor/ArtItem.cs index cfd91f8..3622a7f 100644 --- a/editor/ArtItem.cs +++ b/editor/ArtItem.cs @@ -8,7 +8,7 @@ public class ArtItem public TileSet TileSet { get; set; } public Palette Palette { get; set; } public bool PaletteEditable { get; set; } - public string Name { get; set; } + public string Name { get; init; } public TileMap TileMap { get; set; } public List SpriteTileSets { get; } = new(); public List TileMapData { get; } = new(); diff --git a/editor/Cartridge.cs b/editor/Cartridge.cs index bf132e9..ca7ae33 100644 --- a/editor/Cartridge.cs +++ b/editor/Cartridge.cs @@ -1689,11 +1689,13 @@ private void ReadAssets() case Game.Asset.Types.Palette: _assetsLookup[asset] = item.Palette = GetPalette(offset, asset.FixedSize / 16); item.PaletteEditable = !asset.Hidden; // Hidden only applies to palettes for now... + // TODO we don't handle multiple palettes here yet break; case Game.Asset.Types.ForegroundTileMap: // We assume these are set first _assetsLookup[asset] = item.TileMap = new TileMap(Memory, offset, asset.GetLength(Memory)); item.TileMap.SetAllForeground(); + // TODO we don't support editing foreground/background yet break; case Game.Asset.Types.TileMap: { @@ -1861,7 +1863,7 @@ public byte[] MakeRom(bool log = true) var assetsToPack = new HashSet( Sonic1MasterSystem.AssetGroups.Values .SelectMany(x => x) // Flatten all the groups - .Distinct() // Remove duplicates + .Distinct() // Remove duplicates (by reference) .Select(x => new AssetToPack(x, Sonic1MasterSystem.Assets[x], _assetsLookup[Sonic1MasterSystem.Assets[x]], _assetsLookup[Sonic1MasterSystem.Assets[x]].GetData())) // Select the asset name, details and serialized data .Where(x => x.Asset.OriginalOffset != 0)); // Exclude any not yet configured with a source location diff --git a/editor/Forms/TileChooser.Designer.cs b/editor/Forms/TileChooser.Designer.cs index a5abb4a..fbc79fd 100644 --- a/editor/Forms/TileChooser.Designer.cs +++ b/editor/Forms/TileChooser.Designer.cs @@ -32,33 +32,36 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.tilePicker1 = new ItemPicker(); + this.tilePicker1 = new sth1edwv.Controls.ItemPicker(); this.SuspendLayout(); // // tilePicker1 // this.tilePicker1.FixedItemsPerRow = true; this.tilePicker1.ItemsPerRow = 16; - this.tilePicker1.Location = new System.Drawing.Point(3, 3); + this.tilePicker1.Location = new System.Drawing.Point(4, 3); + this.tilePicker1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.tilePicker1.Name = "tilePicker1"; this.tilePicker1.Scaling = 1; this.tilePicker1.SelectedIndex = -1; - this.tilePicker1.Size = new System.Drawing.Size(522, 524); + this.tilePicker1.ShowTransparency = false; + this.tilePicker1.Size = new System.Drawing.Size(609, 605); this.tilePicker1.TabIndex = 1; - this.tilePicker1.SelectionChanged += new System.EventHandler(this.tilePicker1_SelectionChanged); + this.tilePicker1.SelectionChanged += new System.EventHandler(this.tilePicker1_SelectionChanged); // // TileChooser // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ClientSize = new System.Drawing.Size(527, 527); + this.ClientSize = new System.Drawing.Size(615, 608); this.Controls.Add(this.tilePicker1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "TileChooser"; + this.ShowIcon = false; + this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Tile Chooser"; this.ResumeLayout(false); diff --git a/editor/Forms/TileChooser.resx b/editor/Forms/TileChooser.resx index 1af7de1..f298a7b 100644 --- a/editor/Forms/TileChooser.resx +++ b/editor/Forms/TileChooser.resx @@ -1,64 +1,4 @@ - - - + diff --git a/editor/GameObjects/TileMapData.cs b/editor/GameObjects/TileMapData.cs index cd7082f..118d71e 100644 --- a/editor/GameObjects/TileMapData.cs +++ b/editor/GameObjects/TileMapData.cs @@ -3,6 +3,10 @@ namespace sth1edwv.GameObjects { + /// + /// Represents some raw tilemap data in the form x, y, data, $ff. + /// This is used for things like the level names, PRESS BUTTON text, etc + /// public class TileMapData : IDataItem { public byte X { get; set; }