mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-12 15:21:58 +00:00
PckStudio(Skin) - Add 'theme' member to constructor
This commit is contained in:
@@ -68,11 +68,12 @@ namespace PckStudio.Core.Extensions
|
||||
int skinId = asset.GetId();
|
||||
|
||||
string name = asset.GetProperty("DISPLAYNAME");
|
||||
string theme = asset.GetProperty("THEMENAME");
|
||||
Image texture = asset.GetTexture();
|
||||
SkinANIM anim = asset.GetProperty("ANIM", SkinANIM.FromString);
|
||||
IEnumerable<SkinBOX> boxes = asset.GetMultipleProperties("BOX").Select(kv => SkinBOX.FromString(kv.Value));
|
||||
IEnumerable<SkinPartOffset> offsets = asset.GetMultipleProperties("OFFSET").Select(kv => SkinPartOffset.FromString(kv.Value));
|
||||
return new Skin.Skin(name, skinId, texture, anim, boxes, offsets);
|
||||
IEnumerable<SkinBOX> boxes = asset.GetPropertyValues("BOX").Select(SkinBOX.FromString);
|
||||
IEnumerable<SkinPartOffset> offsets = asset.GetPropertyValues("OFFSET").Select(SkinPartOffset.FromString);
|
||||
return new Skin.Skin(name, theme, skinId, texture, anim, boxes, offsets);
|
||||
}
|
||||
|
||||
public static void SetSkin(this PckAsset asset, Skin.Skin skin, LOCFile localisation)
|
||||
|
||||
@@ -23,29 +23,34 @@ namespace PckStudio.Core.Skin
|
||||
|
||||
public bool HasCape => CapeId != -1;
|
||||
|
||||
public Skin(string name, Image texture)
|
||||
public Skin(string name, Image texture) : this(name, "", texture) { }
|
||||
|
||||
public Skin(string name, string theme, Image texture, SkinANIM anim = default)
|
||||
{
|
||||
MetaData = new SkinMetaData(name, string.Empty);
|
||||
MetaData = new SkinMetaData(name, theme);
|
||||
Texture = texture;
|
||||
Model = new SkinModel();
|
||||
Anim = anim ?? new SkinANIM(0);
|
||||
}
|
||||
|
||||
public Skin(string name, Image texture, int capeId)
|
||||
: this(name, texture)
|
||||
public Skin(string name, Image texture, int capeId) : this(name, "", texture, capeId) { }
|
||||
public Skin(string name, string theme, Image texture, int capeId) : this(name, theme, texture)
|
||||
{
|
||||
CapeId = capeId;
|
||||
}
|
||||
|
||||
public Skin(string name, SkinANIM anim, Image texture, IEnumerable<SkinBOX> additionalBoxes, IEnumerable<SkinPartOffset> partOffsets)
|
||||
: this(name, texture)
|
||||
: this(name, "", anim, texture, additionalBoxes, partOffsets) { }
|
||||
|
||||
public Skin(string name, string theme, SkinANIM anim, Image texture, IEnumerable<SkinBOX> additionalBoxes, IEnumerable<SkinPartOffset> partOffsets)
|
||||
: this(name, theme, texture, anim)
|
||||
{
|
||||
Model.AdditionalBoxes.AddRange(additionalBoxes);
|
||||
Model.PartOffsets.AddRange(partOffsets);
|
||||
Anim = anim;
|
||||
}
|
||||
|
||||
public Skin(string name, int id, Image texture, SkinANIM anim, IEnumerable<SkinBOX> additionalBoxes, IEnumerable<SkinPartOffset> partOffsets)
|
||||
: this(name, anim, texture, additionalBoxes, partOffsets)
|
||||
public Skin(string name, string theme, int id, Image texture, SkinANIM anim, IEnumerable<SkinBOX> additionalBoxes, IEnumerable<SkinPartOffset> partOffsets)
|
||||
: this(name, theme, anim, texture, additionalBoxes, partOffsets)
|
||||
{
|
||||
Identifier = new(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user