Skip to content

Commit

Permalink
Load/Update/Save WzCanvasProperty with '_outlink' path
Browse files Browse the repository at this point in the history
  • Loading branch information
lastbattle committed Jun 7, 2018
1 parent 1717103 commit b715981
Show file tree
Hide file tree
Showing 2 changed files with 235 additions and 185 deletions.
18 changes: 14 additions & 4 deletions HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ private void ShowObjectValue(WzObject obj)
mp3Player.Visible = false;

WzCanvasProperty canvas = (WzCanvasProperty)obj;
if (canvas.HaveInlinkProperty())
if (canvas.HaveInlinkProperty() || canvas.HaveOutlinkProperty())
{
Image img = canvas.GetInlinkWzCanvasProperty()?.GetBitmap();
Image img = canvas.GetLinkedWzCanvasProperty()?.GetBitmap();
canvasPropBox.Image = img;
}
else
Expand Down Expand Up @@ -263,9 +263,9 @@ private void saveImageButton_Click(object sender, EventArgs e)
}
if (wzCanvasPropertyObjLocation != null)
{
if (wzCanvasPropertyObjLocation.HaveInlinkProperty()) // Check for inlink objects
if (wzCanvasPropertyObjLocation.HaveInlinkProperty() || wzCanvasPropertyObjLocation.HaveOutlinkProperty()) // Check for inlink objects
{
WzImageProperty foundCanvas = wzCanvasPropertyObjLocation.GetInlinkWzCanvasProperty();
WzImageProperty foundCanvas = wzCanvasPropertyObjLocation.GetLinkedWzCanvasProperty();
if (foundCanvas is WzCanvasProperty)
{
wzCanvasPropertyObjLocation = (WzCanvasProperty)foundCanvas;
Expand Down Expand Up @@ -441,6 +441,16 @@ private void changeImageButton_Click(object sender, EventArgs e)
//actions.Add(UndoRedoManager.ObjectRemoved((WzNode)parentCanvasNode, childInlinkNode));
childInlinkNode.Delete(); // Delete '_inlink' node
}
else if (selectedWzCanvas.HaveOutlinkProperty()) // if its an inlink property, remove that before updating base image.
{
selectedWzCanvas.RemoveProperty(selectedWzCanvas[WzCanvasProperty.OutlinkPropertyName]);

WzNode parentCanvasNode = (WzNode)DataTree.SelectedNode;
WzNode childInlinkNode = WzNode.GetChildNode(parentCanvasNode, WzCanvasProperty.OutlinkPropertyName);

// Add undo actions
//actions.Add(UndoRedoManager.ObjectRemoved((WzNode)parentCanvasNode, childInlinkNode));
}
else
{

Expand Down
Loading

0 comments on commit b715981

Please sign in to comment.