-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,33 @@ | ||
using System; | ||
using HaruhiChokuretsuLib.Archive.Data; | ||
using SkiaSharp; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SerialLoops.Lib.Items | ||
{ | ||
internal class CharacterSpriteItem | ||
public class CharacterSpriteItem : Item | ||
{ | ||
public CharacterSprite Sprite { get; set; } | ||
|
||
public CharacterSpriteItem(CharacterSprite sprite) : base($"SPR_{sprite.Character}_{sprite.MouthAnimationIndex}_{sprite.EyeAnimationIndex}", ItemType.Character_Sprite) | ||
{ | ||
Sprite = sprite; | ||
} | ||
|
||
public override void Refresh(Project project) | ||
{ | ||
} | ||
|
||
public List<(SKBitmap frame, int timing)> GetClosedMouthAnimation(Project project) | ||
{ | ||
MessageInfoFile messageInfo = project.Dat.Files.First(f => f.Name == "MESSINFOS").CastTo<MessageInfoFile>(); | ||
return Sprite.GetClosedMouthAnimation(project.Grp, messageInfo); | ||
} | ||
|
||
public List<(SKBitmap frame, int timing)> GetLipFlapAnimation(Project project) | ||
{ | ||
MessageInfoFile messageInfo = project.Dat.Files.First(f => f.Name == "MESSINFOS").CastTo<MessageInfoFile>(); | ||
return Sprite.GetLipFlapAnimation(project.Grp, messageInfo); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Eto.Forms; | ||
using HaruhiChokuretsuLib.Util; | ||
using SerialLoops.Lib; | ||
using SerialLoops.Lib.Items; | ||
using SerialLoops.Utility; | ||
|
||
namespace SerialLoops.Editors | ||
{ | ||
public class CharacterSpriteEditor : Editor | ||
{ | ||
private CharacterSpriteItem _sprite; | ||
private AnimatedImage _animatedImage; | ||
|
||
public CharacterSpriteEditor(CharacterSpriteItem item, Project project, ILogger log) : base(item, log, project) | ||
{ | ||
} | ||
|
||
public override Panel GetEditorPanel() | ||
{ | ||
_sprite = (CharacterSpriteItem)Description; | ||
_animatedImage = new AnimatedImage(_sprite.GetLipFlapAnimation(_project)); | ||
_animatedImage.Play(); | ||
|
||
return new StackLayout | ||
{ | ||
Items = | ||
{ | ||
_animatedImage | ||
}, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters