Fashion is my profession - Procedural jumpsuit variants (#25888)

* add color field to clothing layers

* add support to randomsprite

* bababa

* finalize spriting work

* add to game

* fix

* remove space

* edit patelle, +1 decor variant

* added only pants, some sprite fix

* inflation

* fix mixed

* not tested commit

* Revert "not tested commit"

This reverts commit 4a904df3452263e87c9cb819ab5d8cf411ebe468.

* naked human is fun

* update

* add new style

* some sprite pixel tweak

* Update meta.json
This commit is contained in:
Ed
2024-03-15 10:37:12 +03:00
committed by GitHub
parent 3c814f4652
commit 986ac589b4
46 changed files with 412 additions and 44 deletions

View File

@@ -281,6 +281,9 @@ public sealed class ClientClothingSystem : ClothingSystem
// note that every insertion requires reshuffling & remapping all the existing layers.
sprite.AddBlankLayer(index);
sprite.LayerMapSet(key, index);
if (layerData.Color != null)
sprite.LayerSetColor(key, layerData.Color.Value);
}
else
index = sprite.LayerMapReserveBlank(key);

View File

@@ -1,3 +1,5 @@
using Content.Client.Clothing;
using Content.Shared.Clothing.Components;
using Content.Shared.Sprite;
using Robust.Client.GameObjects;
using Robust.Shared.GameStates;
@@ -8,6 +10,7 @@ namespace Content.Client.Sprite;
public sealed class RandomSpriteSystem : SharedRandomSpriteSystem
{
[Dependency] private readonly IReflectionManager _reflection = default!;
[Dependency] private readonly ClientClothingSystem _clothing = default!;
public override void Initialize()
{
@@ -31,10 +34,29 @@ public sealed class RandomSpriteSystem : SharedRandomSpriteSystem
component.Selected.Add(layer.Key, layer.Value);
}
UpdateAppearance(uid, component);
UpdateSpriteComponentAppearance(uid, component);
UpdateClothingComponentAppearance(uid, component);
}
private void UpdateAppearance(EntityUid uid, RandomSpriteComponent component, SpriteComponent? sprite = null)
private void UpdateClothingComponentAppearance(EntityUid uid, RandomSpriteComponent component, ClothingComponent? clothing = null)
{
if (!Resolve(uid, ref clothing, false))
return;
if (clothing.ClothingVisuals == null)
return;
foreach (var slotPair in clothing.ClothingVisuals)
{
foreach (var keyColorPair in component.Selected)
{
_clothing.SetLayerColor(clothing, slotPair.Key, keyColorPair.Key, keyColorPair.Value.Color);
_clothing.SetLayerState(clothing, slotPair.Key, keyColorPair.Key, keyColorPair.Value.State);
}
}
}
private void UpdateSpriteComponentAppearance(EntityUid uid, RandomSpriteComponent component, SpriteComponent? sprite = null)
{
if (!Resolve(uid, ref sprite, false))
return;
@@ -55,7 +77,6 @@ public sealed class RandomSpriteSystem : SharedRandomSpriteSystem
continue;
}
}
sprite.LayerSetState(index, layer.Value.State);
sprite.LayerSetColor(index, layer.Value.Color ?? Color.White);
}

View File

@@ -217,5 +217,38 @@ public abstract class ClothingSystem : EntitySystem
Dirty(uid, clothing);
}
public void SetLayerColor(ClothingComponent clothing, string slot, string mapKey, Color? color)
{
if (clothing.ClothingVisuals == null)
return;
foreach (var layer in clothing.ClothingVisuals[slot])
{
if (layer.MapKeys == null)
return;
if (!layer.MapKeys.Contains(mapKey))
continue;
layer.Color = color;
}
}
public void SetLayerState(ClothingComponent clothing, string slot, string mapKey, string state)
{
if (clothing.ClothingVisuals == null)
return;
foreach (var layer in clothing.ClothingVisuals[slot])
{
if (layer.MapKeys == null)
return;
if (!layer.MapKeys.Contains(mapKey))
continue;
layer.State = state;
}
}
#endregion
}

View File

@@ -24,46 +24,6 @@
components:
- type: StorageFill
contents:
- id: ClothingUniformJumpsuitColorWhite
prob: 0.25
- id: ClothingUniformJumpskirtColorWhite
prob: 0.25
- id: ClothingUniformJumpsuitColorBlue
prob: 0.25
- id: ClothingUniformJumpskirtColorBlue
prob: 0.25
- id: ClothingUniformJumpsuitColorYellow
prob: 0.25
- id: ClothingUniformJumpskirtColorYellow
prob: 0.25
- id: ClothingUniformJumpsuitColorGreen
prob: 0.25
- id: ClothingUniformJumpskirtColorGreen
prob: 0.25
- id: ClothingUniformJumpsuitColorOrange
prob: 0.25
- id: ClothingUniformJumpskirtColorOrange
prob: 0.25
- id: ClothingUniformJumpsuitColorPink
prob: 0.25
- id: ClothingUniformJumpskirtColorPink
prob: 0.25
- id: ClothingUniformJumpsuitColorRed
prob: 0.25
- id: ClothingUniformJumpskirtColorRed
prob: 0.25
- id: ClothingUniformJumpsuitColorDarkBlue
prob: 0.25
- id: ClothingUniformJumpskirtColorDarkBlue
prob: 0.25
- id: ClothingUniformJumpsuitColorTeal
prob: 0.25
- id: ClothingUniformJumpskirtColorTeal
prob: 0.25
- id: ClothingUniformJumpsuitColorPurple
prob: 0.25
- id: ClothingUniformJumpskirtColorPurple
prob: 0.25
- id: ClothingShoesColorBlack
amount: 1
- id: ClothingShoesColorBrown
@@ -74,6 +34,16 @@
prob: 0.4
- id: ClothingOuterCoatGentle
prob: 0.3
- id: ClothingUniformRandomShorts
amount: 3
- id: ClothingUniformRandomArmless
amount: 5
- id: ClothingUniformRandomStandart
amount: 5
- id: ClothingUniformRandomBra
amount: 5
- id: ClothingUniformRandomShirt
amount: 4
- type: entity
id: WardrobeYellowFilled

View File

@@ -6,6 +6,7 @@
ClothingBackpackDuffel: 5
ClothingBackpackSatchel: 3
ClothingBackpackSatchelLeather: 2
ClothingRandomSpawner: 8
ClothingHeadHatBeret: 4
ClothingHeadBandBlack: 2
ClothingHeadBandBlue: 2

View File

@@ -0,0 +1,169 @@
- type: entity
parent: ClothingUniformBase
id: ClothingUniformRandom
abstract: true
description: Generated by neural networks based on the latest fashion trends.
suffix: Random visual
components:
- type: SuitSensor
- type: Sprite
sprite: Clothing/Uniforms/procedural.rsi
layers:
- state: base_torso_standart
map: [ "torso" ]
- state: base_leg_standart
map: [ "leg" ]
- state: mask_null
map: [ "decor" ]
- state: mask_null
map: [ "overlay" ]
- type: Clothing
femaleMask: UniformTop
maleMask: UniformTop
sprite: Clothing/Uniforms/procedural.rsi
clothingVisuals:
jumpsuit:
- state: base_torso_standart
map: [ "torso" ]
- state: base_leg_standart
map: [ "leg" ]
- state: mask_null
map: [ "decor" ]
- state: mask_null
map: [ "overlay" ]
- type: entity
parent: ClothingUniformRandom
id: ClothingRandomSpawner
name: random colorful costume
components:
- type: RandomSpawner
offset: 0
prototypes:
- ClothingUniformRandomArmless
- ClothingUniformRandomStandart
- ClothingUniformRandomBra
- ClothingUniformRandomShorts
- ClothingUniformRandomShirt
- type: entity
parent: ClothingUniformRandom
id: ClothingUniformRandomArmless
name: colorful hands-free costume
components:
- type: RandomSprite
available:
- torso:
base_torso_armless: Sixteen
leg:
base_leg_standart: Sixteen
base_leg_short: Sixteen
base_leg_skirt: Sixteen
base_leg_skirt_long: Sixteen
decor:
decor_torso_armless1: Sixteen
decor_torso_armless2: Sixteen
decor_torso_armless3: Sixteen
decor_torso_armless4: Sixteen
decor_torso_armless5: Sixteen
decor_torso_armless6: Sixteen
decor_torso_armless7: Sixteen
decor_torso_armless8: Sixteen
decor_torso_armless9: Sixteen
decor_torso_armless10: Sixteen
mask_null: ""
- type: entity
parent: ClothingUniformRandom
id: ClothingUniformRandomStandart
name: colorful costume
components:
- type: RandomSprite
available:
- torso:
base_torso_standart: Sixteen
base_torso_standart2: Sixteen
leg:
base_leg_standart: Sixteen
base_leg_short: Sixteen
base_leg_skirt: Sixteen
base_leg_skirt_long: Sixteen
decor:
decor_torso_armless1: Sixteen
decor_torso_armless2: Sixteen
decor_torso_armless3: Sixteen
decor_torso_armless4: Sixteen
decor_torso_armless5: Sixteen
decor_torso_armless6: Sixteen
decor_torso_armless7: Sixteen
decor_torso_armless8: Sixteen
decor_torso_armless9: Sixteen
decor_torso_armless10: Sixteen
decor_torso_standart1: Sixteen
decor_torso_standart2: Sixteen
decor_torso_standart3: Sixteen
decor_torso_standart4: Sixteen
decor_torso_standart5: Sixteen
decor_torso_standart6: Sixteen
decor_torso_standart7: Sixteen
decor_torso_standart8: Sixteen
decor_torso_standart9: Sixteen
mask_null: ""
- type: entity
parent: ClothingUniformRandom
id: ClothingUniformRandomBra
name: colorful bra
components:
- type: RandomSprite
available:
- torso:
base_torso_bra: Sixteen
leg:
base_leg_standart: Sixteen
base_leg_short: Sixteen
base_leg_skirt: Sixteen
base_leg_skirt_long: Sixteen
decor:
decor_torso_bra1: Sixteen
decor_torso_bra2: Sixteen
decor_torso_bra3: Sixteen
decor_torso_bra4: Sixteen
decor_torso_bra5: Sixteen
mask_null: ""
- type: entity
parent: ClothingUniformRandom
id: ClothingUniformRandomShorts
name: colorful pants
components:
- type: RandomSprite
available:
- torso:
mask_null: ""
leg:
base_leg_standart: Sixteen
base_leg_short: Sixteen
base_leg_skirt: Sixteen
base_leg_skirt_long: Sixteen
- type: entity
parent: ClothingUniformRandom
id: ClothingUniformRandomShirt
name: colorful costume
components:
- type: RandomSprite
available:
- torso:
base_torso_armless: Sixteen
mask_null: ""
leg:
base_leg_standart: Sixteen
base_leg_short: Sixteen
decor:
base_torso_shirt: Sixteen
overlay:
decor_torso_shirt1: Sixteen
decor_torso_shirt2: Sixteen
decor_torso_shirt3: Sixteen

View File

@@ -53,6 +53,18 @@
components:
- type: StorageFill
contents:
- id: ClothingUniformRandomArmless
prob: 0.05
orGroup: dressermainloot
- id: ClothingUniformRandomStandart
prob: 0.05
orGroup: dressermainloot
- id: ClothingUniformRandomBra
prob: 0.05
orGroup: dressermainloot
- id: ClothingUniformRandomShorts
prob: 0.05
orGroup: dressermainloot
- id: ClothingNeckLGBTPin
prob: 0.06
orGroup: dressermainloot

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

View File

@@ -0,0 +1,159 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "The sprite base is taken from tgstation at commit https://github.com/tgstation/tgstation/commit/c838ba21dae97db345e0113f99596decd1d66039, separated into layers and added new ones by TheShuEd (github)",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "base_leg_short",
"directions": 4
},
{
"name": "base_leg_skirt",
"directions": 4
},
{
"name": "base_leg_skirt_long",
"directions": 4
},
{
"name": "base_leg_standart",
"directions": 4
},
{
"name": "base_torso_armless",
"directions": 4
},
{
"name": "base_torso_bra",
"directions": 4
},
{
"name": "base_torso_shirt",
"directions": 4
},
{
"name": "base_torso_standart",
"directions": 4
},
{
"name": "base_torso_standart2",
"directions": 4
},
{
"name": "decor_torso_armless1",
"directions": 4
},
{
"name": "decor_torso_armless2",
"directions": 4
},
{
"name": "decor_torso_armless3",
"directions": 4
},
{
"name": "decor_torso_armless4",
"directions": 4
},
{
"name": "decor_torso_armless5",
"directions": 4
},
{
"name": "decor_torso_armless6",
"directions": 4
},
{
"name": "decor_torso_armless7",
"directions": 4
},
{
"name": "decor_torso_armless8",
"directions": 4
},
{
"name": "decor_torso_armless9",
"directions": 4
},
{
"name": "decor_torso_armless10",
"directions": 4
},
{
"name": "decor_torso_bra1",
"directions": 4
},
{
"name": "decor_torso_bra2",
"directions": 4
},
{
"name": "decor_torso_bra3",
"directions": 4
},
{
"name": "decor_torso_bra4",
"directions": 4
},
{
"name": "decor_torso_bra5",
"directions": 4
},
{
"name": "decor_torso_shirt1",
"directions": 4
},
{
"name": "decor_torso_shirt2",
"directions": 4
},
{
"name": "decor_torso_shirt3",
"directions": 4
},
{
"name": "decor_torso_standart1",
"directions": 4
},
{
"name": "decor_torso_standart2",
"directions": 4
},
{
"name": "decor_torso_standart3",
"directions": 4
},
{
"name": "decor_torso_standart4",
"directions": 4
},
{
"name": "decor_torso_standart5",
"directions": 4
},
{
"name": "decor_torso_standart6",
"directions": 4
},
{
"name": "decor_torso_standart7",
"directions": 4
},
{
"name": "decor_torso_standart8",
"directions": 4
},
{
"name": "decor_torso_standart9",
"directions": 4
},
{
"name": "mask_null",
"directions": 4
}
]
}