From c4e797d4032ad53c461fd1503846481f29b65a90 Mon Sep 17 00:00:00 2001 From: MattN-L Date: Mon, 11 Mar 2024 16:54:52 -0400 Subject: [PATCH] Fix for tiles with only one variant not displaying correctly --- PCK-Studio/Forms/Editor/TextureAtlasEditor.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs b/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs index fe569733..63829c17 100644 --- a/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs +++ b/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs @@ -164,9 +164,10 @@ private void SetImageDisplayed(int index) selectTilePictureBox.Start(animation); } - if (variantComboBox.Enabled = variantLabel.Visible = variantComboBox.Visible = - dataTile.Tile.HasColourEntry) + if (dataTile.Tile.HasColourEntry) { + variantComboBox.Enabled = variantLabel.Visible = variantComboBox.Visible = dataTile.Tile.ColourEntry.Variants.Length > 1; + if (dataTile.Tile.ColourEntry.IsWaterColour && _colourTable.WaterColors.Count > 0) { foreach (var col in _colourTable.WaterColors) @@ -178,10 +179,7 @@ private void SetImageDisplayed(int index) dataTile.Tile.ColourEntry.DefaultName = _colourTable.WaterColors[0].Name; } - if (dataTile.Tile.ColourEntry.Variants.Length > 1) - { - variantComboBox.Items.AddRange(dataTile.Tile.ColourEntry.Variants); - } + variantComboBox.Items.AddRange(dataTile.Tile.ColourEntry.Variants); variantComboBox.SelectedItem = dataTile.Tile.ColourEntry.DefaultName; }