forked from Perfare/AssetStudio
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AK][CLI] Add support for portrait sprites
- Loading branch information
Showing
10 changed files
with
223 additions
and
34 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
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
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,24 @@ | ||
using AssetStudio; | ||
|
||
|
||
namespace Arknights | ||
{ | ||
internal class PortraitSprite | ||
{ | ||
public string Name { get; set; } | ||
public ClassIDType Type { get; } | ||
public SerializedFile AssetsFile { get; set; } | ||
public string Container { get; set; } | ||
public Texture2D Texture { get; set; } | ||
public Texture2D AlphaTexture { get; set; } | ||
public Rectf TextureRect { get; set; } | ||
public bool Rotate { get; set; } | ||
public float DownscaleMultiplier { get; } | ||
|
||
public PortraitSprite() | ||
{ | ||
Type = ClassIDType.AkPortraitSprite; | ||
DownscaleMultiplier = 1f; | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
AssetStudioCLI/Components/Arknights/PortraitSpriteConfig.cs
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,41 @@ | ||
namespace Arknights.PortraitSpriteMono | ||
{ | ||
internal class PortraitRect | ||
{ | ||
public float X { get; set; } | ||
public float Y { get; set; } | ||
public float W { get; set; } | ||
public float H { get; set; } | ||
} | ||
|
||
internal class AtlasSprite | ||
{ | ||
public string Name { get; set; } | ||
public string Guid { get; set; } | ||
public int Atlas { get; set; } | ||
public PortraitRect Rect { get; set; } | ||
public bool Rotate { get; set; } | ||
} | ||
|
||
internal class TextureIDs | ||
{ | ||
public int m_FileID { get; set; } | ||
public long m_PathID { get; set; } | ||
} | ||
|
||
internal class AtlasInfo | ||
{ | ||
public int Index { get; set; } | ||
public TextureIDs Texture { get; set; } | ||
public TextureIDs Alpha { get; set; } | ||
public int Size { get; set; } | ||
} | ||
|
||
internal class PortraitSpriteConfig | ||
{ | ||
public string m_Name { get; set; } | ||
public AtlasSprite[] _sprites { get; set; } | ||
public AtlasInfo _atlas { get; set; } | ||
public int _index { get; set; } | ||
} | ||
} |
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
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