public static void RSDKvB_Load_Animation(EditorAnimation BridgeHost, string filepath) { RSDKvB.Animation animsetvB = new RSDKvB.Animation(new RSDKvB.Reader(filepath)); RSDKvB_Load_AnimHeader(BridgeHost, animsetvB); RSDKvB_Load_CollisionBoxes(BridgeHost, animsetvB); for (int a = 0; a < animsetvB.Animations.Count; a++) { var animset = new EditorAnimation.EditorAnimationInfo(EngineType.RSDKvB, BridgeHost); animset.LoadFrom(EngineType.RSDKvB, animsetvB.Animations[a]); BridgeHost.Animations.Add(animset); } }
public static void RSDKvB_Save_Animation(EditorAnimation BridgeHost, string filepath) { RSDKvB.Animation animsetvB = new RSDKvB.Animation(); RSDKvB_Save_AnimHeader(BridgeHost, animsetvB); for (int a = 0; a < BridgeHost.Animations.Count; a++) { RSDKvB.Animation.AnimationEntry animvB = new RSDKvB.Animation.AnimationEntry(); BridgeHost.Animations[a].SaveTo(EngineType.RSDKvB, animvB); animsetvB.Animations.Add(animvB); } RSDKvB_Save_CollisionBoxes(BridgeHost, animsetvB); animsetvB.Write(new RSDKvB.Writer(filepath)); }
public static void RSDKvB_Load_CollisionBoxes(EditorAnimation BridgeHost, RSDKvB.Animation animsetvB) { var collisionBoxes = new List <EditorAnimation.EditorRetroHitBox>(); for (int i = 0; i < animsetvB.CollisionBoxes.Count; i++) { var hitboxEntry = new EditorAnimation.EditorRetroHitBox(); for (int j = 0; j < animsetvB.CollisionBoxes[i].Hitboxes.Length; j++) { hitboxEntry.Hitboxes[j].Bottom = animsetvB.CollisionBoxes[i].Hitboxes[j].Bottom; hitboxEntry.Hitboxes[j].Top = animsetvB.CollisionBoxes[i].Hitboxes[j].Top; hitboxEntry.Hitboxes[j].Left = animsetvB.CollisionBoxes[i].Hitboxes[j].Left; hitboxEntry.Hitboxes[j].Right = animsetvB.CollisionBoxes[i].Hitboxes[j].Right; } collisionBoxes.Add(hitboxEntry); } BridgeHost.RetroCollisionBoxes = collisionBoxes; }
public static void RSDKvB_Save_CollisionBoxes(EditorAnimation BridgeHost, RSDKvB.Animation animsetvB) { animsetvB.CollisionBoxes = new List <RSDKvB.Animation.sprHitbox>(8); for (int a = 0; a < BridgeHost.RetroCollisionBoxes.Count; a++) { animsetvB.CollisionBoxes.Insert(a, new RSDKvB.Animation.sprHitbox()); for (int f = 0; f < 8; f++) { if (animsetvB.CollisionBoxes[a].Hitboxes == null) { animsetvB.CollisionBoxes[a].Hitboxes = new RSDKvB.Animation.sprHitbox.HitboxInfo[8]; } animsetvB.CollisionBoxes[a].Hitboxes[f].Bottom = BridgeHost.RetroCollisionBoxes[a].Hitboxes[f].Bottom; animsetvB.CollisionBoxes[a].Hitboxes[f].Top = BridgeHost.RetroCollisionBoxes[a].Hitboxes[f].Top; animsetvB.CollisionBoxes[a].Hitboxes[f].Left = BridgeHost.RetroCollisionBoxes[a].Hitboxes[f].Left; animsetvB.CollisionBoxes[a].Hitboxes[f].Right = BridgeHost.RetroCollisionBoxes[a].Hitboxes[f].Right; } } }
public static void RSDKvB_Save_AnimHeader(EditorAnimation BridgeHost, RSDKvB.Animation animsetvB) { animsetvB.SpriteSheets = BridgeHost.SpriteSheets.ToList(); }
public static void RSDKvB_Load_AnimHeader(EditorAnimation BridgeHost, RSDKvB.Animation animsetvB) { BridgeHost.SpriteSheets = new System.Collections.ObjectModel.ObservableCollection <string>(animsetvB.SpriteSheets); BridgeHost.CollisionBoxes = GetV3HitboxList(); }