Skip to content

Commit

Permalink
Fix for tiles with only one variant not displaying correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
MattN-L committed Mar 11, 2024
1 parent c645cef commit c4e797d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions PCK-Studio/Forms/Editor/TextureAtlasEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}
Expand Down

0 comments on commit c4e797d

Please sign in to comment.