Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
Fix compiling error
Fix crash on creating new object
  • Loading branch information
Arch-Mina committed Dec 23, 2020
1 parent eed3917 commit 1d7bcb9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Assets Editor/DatEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ private void ObjListView_SelectionChanged(object sender, System.Windows.Controls
else if (ObjectMenu.SelectedIndex == 1)
{
LoadSelectedObjectAppearances(MainWindow.appearances.Object[ObjListView.SelectedIndex]);
Debug.WriteLine(MainWindow.appearances.Object[ObjListView.SelectedIndex]);
Byte[] test = OTB.GenerateItemSpriteHash(MainWindow.appearances.Object[ObjListView.SelectedIndex]);
}
else if (ObjectMenu.SelectedIndex == 2)
LoadSelectedObjectAppearances(MainWindow.appearances.Effect[ObjListView.SelectedIndex]);
Expand Down Expand Up @@ -1188,7 +1186,7 @@ private void NewObjectDialogHost_OnDialogClosing(object sender, DialogClosingEve
}
int spritecount = (int)(frameIdleGroup.SpriteInfo.Layers * frameIdleGroup.SpriteInfo.PatternWidth * frameIdleGroup.SpriteInfo.PatternHeight * frameIdleGroup.SpriteInfo.PatternDepth * int.Parse(NIdleGroupCount.Text));
for (int i = 0; i < spritecount; i++)
frameIdleGroup.SpriteInfo.SpriteId.Add(118489);
frameIdleGroup.SpriteInfo.SpriteId.Add(0);

newObject.Id = (uint)(MainWindow.appearances.Outfit[^1].Id + 1);
newObject.FrameGroup.Add(frameIdleGroup);
Expand All @@ -1207,7 +1205,7 @@ private void NewObjectDialogHost_OnDialogClosing(object sender, DialogClosingEve
frameMoveGroup.SpriteInfo.Animation = spriteMoveAnimation;
spritecount = (int)(frameMoveGroup.SpriteInfo.Layers * frameMoveGroup.SpriteInfo.PatternWidth * frameMoveGroup.SpriteInfo.PatternHeight * frameMoveGroup.SpriteInfo.PatternDepth * int.Parse(NMoveGroupCount.Text));
for (int i = 0; i < spritecount; i++)
frameMoveGroup.SpriteInfo.SpriteId.Add(118489);
frameMoveGroup.SpriteInfo.SpriteId.Add(0);
newObject.FrameGroup.Add(frameMoveGroup);
}
MainWindow.appearances.Outfit.Add(newObject);
Expand All @@ -1226,7 +1224,7 @@ private void NewObjectDialogHost_OnDialogClosing(object sender, DialogClosingEve
}
int spritecount = (int)(frameIdleGroup.SpriteInfo.Layers * frameIdleGroup.SpriteInfo.PatternWidth * frameIdleGroup.SpriteInfo.PatternHeight * frameIdleGroup.SpriteInfo.PatternDepth * int.Parse(NIdleGroupCount.Text));
for (int i = 0; i < spritecount; i++)
frameIdleGroup.SpriteInfo.SpriteId.Add(118489);
frameIdleGroup.SpriteInfo.SpriteId.Add(0);

newObject.Id = (uint)(MainWindow.appearances.Object[^1].Id + 1);
newObject.FrameGroup.Add(frameIdleGroup);
Expand All @@ -1246,7 +1244,7 @@ private void NewObjectDialogHost_OnDialogClosing(object sender, DialogClosingEve
}
int spritecount = (int)(frameIdleGroup.SpriteInfo.Layers * frameIdleGroup.SpriteInfo.PatternWidth * frameIdleGroup.SpriteInfo.PatternHeight * frameIdleGroup.SpriteInfo.PatternDepth * int.Parse(NIdleGroupCount.Text));
for (int i = 0; i < spritecount; i++)
frameIdleGroup.SpriteInfo.SpriteId.Add(118489);
frameIdleGroup.SpriteInfo.SpriteId.Add(0);

newObject.Id = (uint)(MainWindow.appearances.Effect[^1].Id + 1);
newObject.FrameGroup.Add(frameIdleGroup);
Expand All @@ -1266,7 +1264,7 @@ private void NewObjectDialogHost_OnDialogClosing(object sender, DialogClosingEve
}
int spritecount = (int)(frameIdleGroup.SpriteInfo.Layers * frameIdleGroup.SpriteInfo.PatternWidth * frameIdleGroup.SpriteInfo.PatternHeight * frameIdleGroup.SpriteInfo.PatternDepth * int.Parse(NIdleGroupCount.Text));
for (int i = 0; i < spritecount; i++)
frameIdleGroup.SpriteInfo.SpriteId.Add(118489);
frameIdleGroup.SpriteInfo.SpriteId.Add(0);

newObject.Id = (uint)(MainWindow.appearances.Missile[^1].Id + 1);
newObject.FrameGroup.Add(frameIdleGroup);
Expand Down

0 comments on commit 1d7bcb9

Please sign in to comment.