[SHEKELS]reider207 ghost

This commit is contained in:
RavMorgan
2023-05-14 02:35:20 +03:00
committed by Aviu00
parent 36185582b4
commit f1c9f1ba2b
6 changed files with 39 additions and 1 deletions

View File

@@ -21,5 +21,10 @@ public sealed class CustomGhostVisualizer : VisualizerSystem<GhostComponent>
{
args.Sprite.Color = args.Sprite.Color.WithAlpha(alpha);
}
if (AppearanceSystem.TryGetData<Vector2>(uid, CustomGhostAppearance.SizeOverride, out var size, args.Component))
{
args.Sprite.Scale = size;
}
}
}

View File

@@ -40,6 +40,7 @@ public sealed class CustomGhostSpriteSystem : EntitySystem
if (string.Equals(customGhostPrototype.Ckey, ckey, StringComparison.CurrentCultureIgnoreCase))
{
_appearanceSystem.SetData(ghostUid, CustomGhostAppearance.Sprite, customGhostPrototype.CustomSpritePath.ToString());
_appearanceSystem.SetData(ghostUid, CustomGhostAppearance.SizeOverride, customGhostPrototype.SizeOverride);
if(customGhostPrototype.AlphaOverride > 0)
{
@@ -56,6 +57,9 @@ public sealed class CustomGhostSpriteSystem : EntitySystem
_metaData.SetEntityDescription(ghostUid, customGhostPrototype.GhostDescription);
}
return;
}

View File

@@ -28,11 +28,15 @@ public sealed class CustomGhostPrototype : IPrototype
[DataField("ghostDescription")]
public string GhostDescription = string.Empty;
[DataField("size")]
public Vector2 SizeOverride = Vector2.One;
}
[Serializable, NetSerializable]
public enum CustomGhostAppearance
{
Sprite,
AlphaOverride
AlphaOverride,
SizeOverride
}

View File

@@ -54,3 +54,13 @@
alpha: 0.8
ghostName: Фырчало
ghostDescription: Инженерный борг
#reider207
- type: customGhost
id: reider207-ghost
ckey: reider207
sprite: White/Ghosts/reider207-ghost.rsi
alpha: 0.8
ghostName: Гань Юй
ghostDescription: Священная Крио Лань
size: 0.8, 0.8

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,15 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "reider207",
"size": {
"x": 64,
"y": 64
},
"states": [
{
"name": "animated",
"directions": 4
}
]
}