Skip to content

Commit

Permalink
[HaRepacker] Fix not properly displaying an image if its a WzUOLPrope…
Browse files Browse the repository at this point in the history
…rty node pointing to a canvas with '_inlink' or '_outlink' path
  • Loading branch information
LastBattle committed Dec 10, 2020
1 parent fc922c7 commit a385d84
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions HaRepacker/GUI/Panels/MainPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1390,15 +1390,13 @@ private void ShowObjectValue(WzObject obj)

// Image
WzObject linkValue = ((WzUOLProperty)obj).LinkValue;
if (linkValue is WzCanvasProperty)
if (linkValue is WzCanvasProperty canvasUOL)
{
canvasPropBox.Visibility = Visibility.Visible;
canvasPropBox.Image = BitmapToImageSource.ToWpfBitmap(linkValue.GetBitmap());
menuItem_saveImage.Visibility = Visibility.Visible;

WzCanvasProperty linkProperty = ((WzCanvasProperty)linkValue);
canvasPropBox.Image = BitmapToImageSource.ToWpfBitmap(canvasUOL.GetLinkedWzCanvasBitmap()); // in any event that the WzCanvasProperty is an '_inlink' or '_outlink'
menuItem_saveImage.Visibility = Visibility.Visible; // dont show change image, as its a UOL

SetImageRenderView(linkProperty);
SetImageRenderView(canvasUOL);
}
else if (linkValue is WzBinaryProperty) // Sound, used rarely in wz. i.e Sound.wz/Rune/1/Destroy
{
Expand Down

0 comments on commit a385d84

Please sign in to comment.