Skip to content

Commit

Permalink
Keep replacement image number when replacing an image in a POG file
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanityBringer committed Dec 10, 2022
1 parent 357d15a commit 11dbefd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PiggyDump/ImageEditorPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ public void AddImageFromBitmap(Bitmap img, string name)

public void ReplaceSelectedFromBitmap(Bitmap img, string name)
{
PIGImage oldbitmap = imageProvider.Bitmaps[ImageListView.SelectedIndices[0]];
PIGImage bitmap = PiggyBitmapUtilities.CreatePIGImage(img, localPalette, inverseColormap, name.Substring(0, Math.Min(name.Length, 8)));
bitmap.ReplacementNum = oldbitmap.ReplacementNum;
imageProvider.Bitmaps[ImageListView.SelectedIndices[0]] = bitmap;
RebuildItem(ImageListView.SelectedItems[0]);
ChangeImage(ImageListView.SelectedIndices[0]);
Expand Down

0 comments on commit 11dbefd

Please sign in to comment.