Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Client/Sprite/RandomSpriteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void UpdateSpriteComponentAppearance(EntityUid uid, RandomSpriteComponen
{
if (layer.Key is not { } strKey || !int.TryParse(strKey, out index))
{
Log.Error($"Invalid key `{layer.Key}` for entity with random sprite {ToPrettyString(uid)}");
// Log.Error($"Invalid key `{layer.Key}` for entity with random sprite {ToPrettyString(uid)}"); // Frontier: spammy
continue;
}
}
Expand Down
14 changes: 7 additions & 7 deletions Content.Server/Sprite/RandomSpriteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

namespace Content.Server.Sprite;

public sealed class RandomSpriteSystem: SharedRandomSpriteSystem // LuaM del: partial
public sealed partial class RandomSpriteSystem: SharedRandomSpriteSystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!; // LuaM add: readonly
[Dependency] private readonly IRobustRandom _random = default!; // LuaM add: readonly
[Dependency] private IPrototypeManager _prototype = default!;
[Dependency] private IRobustRandom _random = default!;

public override void Initialize()
{
Expand All @@ -27,14 +27,14 @@ private void OnMapInit(EntityUid uid, RandomSpriteComponent component, MapInitEv
if (component.Available.Count == 0)
return;

// LuaM start: select mapped colours
// Frontier: select mapped colours
Dictionary<string, Color> mappedColors = new();
foreach (var (key, value) in component.MappedColors)
{
if (_prototype.TryIndex<ColorPalettePrototype>(value, out var palette))
mappedColors[key] = _random.Pick(palette.Colors.Values);
}
// LuaM end
// End Frontier: select mapped colours

var groups = new List<Dictionary<string, Dictionary<string, string?>>>();
if (component.GetAllGroups)
Expand All @@ -61,12 +61,12 @@ private void OnMapInit(EntityUid uid, RandomSpriteComponent component, MapInitEv
{
if (selectedState.Value == $"Inherit")
color = previousColor;
// LuaM start: mapped colours
// Frontier: mapped colours
else if (mappedColors.TryGetValue(selectedState.Value, out var mappedColor))
{
color = mappedColor;
}
// LuaM end Frontier
// End Frontier
else
{
color = _random.Pick(_prototype.Index<ColorPalettePrototype>(selectedState.Value).Colors.Values);
Expand Down
7 changes: 4 additions & 3 deletions Content.Shared/Sprite/RandomSpriteComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ public sealed partial class RandomSpriteComponent : Component
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("selected")]
public Dictionary<string, (string State, Color? Color)> Selected = new();
// LuaM start: mapped random colours

// Frontier: mapped random colours
/// <summary>
/// Maps arbitrary strings to palettes.
/// Keys can be used in <c>Available</c> to refer to a mapped colour in multiple layers.
/// </summary>
[DataField]
public Dictionary<string, string> MappedColors = new();
// LuaM end
}
// End Frontier
}
35 changes: 7 additions & 28 deletions Resources/Prototypes/_NF/Entities/Clothing/Belt/belts_punk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,36 @@
- type: Sprite
sprite: _NF/Clothing/Belt/punk.rsi
layers:
- state: icon_belt_01 # LuaM base_belt_01 > icon_belt_01
map: [ "belt_main" ]
# LuaM-comment-start:
# scale: 1.8, 1.8
# offset: 0,0.1
# LuaM-comment-end.
- state: icon_decor_base_belt_01 # LuaM decor_base_belt_01 > icon_decor_base_belt_01
map: [ "belt_decor" ]
# LuaM-comment-start:
# scale: 1.8, 1.8
# offset: 0,0.1
# - state: mask_null
# map: [ "belt_overlay" ]
# scale: 1.8, 1.8
# offset: 0,0.1
# LuaM-comment-end.
- state: icon_belt_01
map: [ "belt_main" ]
- state: icon_decor_base_belt_01
map: [ "belt_decor" ]
- type: Clothing
sprite: _NF/Clothing/Belt/punk.rsi
clothingVisuals:
belt:
- state: base_belt_01
map: [ "clothing_belt_main" ] # LuaM: belt_main > clothing_belt_main
map: [ "clothing_belt_main" ]
- state: decor_base_belt_01
map: [ "clothing_belt_decor" ] # LuaM: belt_decor > clothing_belt_decor
map: [ "clothing_belt_decor" ]
- state: mask_null
map: [ "clothing_belt_overlay" ] # LuaM: belt_overlay > clothing_belt_overlay
map: [ "clothing_belt_overlay" ]
- type: RandomSprite
available:
- belt_main:
# base_belt_01: CyberpunkDark # Commented by LuaM
# LuaM-start:
icon_belt_01: Base
clothing_belt_main:
base_belt_01: Base
# LuaM-end.
belt_decor:
# decor_base_belt_01: CyberpunkDark # Commented by LuaM
# belt_overlay:
# LuaM-start:
icon_decor_base_belt_01: Decor
clothing_belt_decor:
decor_base_belt_01: Decor
clothing_belt_overlay:
# LuaM-end.
decor_base_belt_02: CyberpunkDark
decor_base_belt_03: CyberpunkDark
decor_base_belt_04: CyberpunkDark
decor_base_belt_05: CyberpunkDark
mask_null: ""
# LuaM-start:
mappedColors:
Base: CyberpunkDark
Decor: CyberpunkDark
# LuaM-end.
54 changes: 12 additions & 42 deletions Resources/Prototypes/_NF/Entities/Clothing/Eyes/glasses_punks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,33 @@
- type: Sprite
sprite: _NF/Clothing/Eyes/Glasses/punk_glasses.rsi
layers:
- state: icon_base_glasses_01 # LuaM base_glasses_01 > icon_base_glasses_01
- state: icon_base_glasses_01
map: [ "glasses_main" ]
# LuaM-comment-start:
# scale: 2.5, 2.5
# offset: 0,-0.6
# LuaM-comment-end.
- state: icon_decor_base_glasses_01 # LuaM decor_base_glasses_01 > icon_decor_base_glasses_01
- state: icon_decor_base_glasses_01
map: [ "glasses_decor" ]
# LuaM-comment-start:
# scale: 2.5, 2.5
# offset: 0,-0.6
# LuaM-comment-end.
shader: unshaded
- type: Clothing
sprite: _NF/Clothing/Eyes/Glasses/punk_glasses.rsi
clothingVisuals:
eyes:
- state: base_glasses_01
map: [ "clothing_glasses_main" ] # LuaM glasses_main > clothing_glasses_main
map: [ "clothing_glasses_main" ]
- state: decor_base_glasses_01
map: [ "clothing_glasses_decor" ] # LuaM glasses_decor > clothing_glasses_decor
map: [ "clothing_glasses_decor" ]
shader: unshaded
- type: RandomSprite
available:
- glasses_main:
# base_glasses_01: CyberpunkDark # Commented by LuaM
# LuaM-start:
icon_base_glasses_01: Base
clothing_glasses_main:
base_glasses_01: Base
# LuaM-end.
glasses_decor:
# decor_base_glasses_01: CyberpunkDark # Commented by LuaM
# LuaM-start:
icon_decor_base_glasses_01: Decor
clothing_glasses_decor:
decor_base_glasses_01: Decor
mappedColors:
Base: CyberpunkDark
Decor: CyberpunkDark
# LuaM-end

# HUDs
- type: entity
Expand All @@ -59,56 +45,40 @@
description: How can you see anything in this with all the lights?
components:
- type: VisionCorrection
# LuaM-comment-start:
# - type: Item
# shape:
# - 0,0,1,0
# storedOffset: -20,-20
# LuaM-comment-end.
- type: Item
shape:
- 0,0,1,0
storedOffset: -20,-20
- type: Sprite
sprite: _NF/Clothing/Eyes/Glasses/punk_glasses.rsi
layers:
- state: icon_base_glasses_02 # LuaM base_glasses_02 > icon_base_glasses_02
- state: icon_base_glasses_02
map: [ "infoshades_main" ]
# LuaM-comment-start:
# scale: 2.5, 2.5
# offset: 0,-0.6
# LuaM-comment-end.
- state: icon_decor_base_glasses_02 # LuaM decor_base_glasses_02 > icon_decor_base_glasses_02
- state: icon_decor_base_glasses_02
map: [ "infoshades_decor" ]
# LuaM-comment-start:
# scale: 2.5, 2.5
# offset: 0,-0.6
# LuaM-comment-end.
shader: unshaded
- type: Clothing
sprite: _NF/Clothing/Eyes/Glasses/punk_glasses.rsi
clothingVisuals:
eyes:
- state: base_glasses_02
map: [ "clothing_infoshades_main" ] # LuaM infoshades_main > clothing_infoshades_main
map: [ "clothing_infoshades_main" ]
- state: decor_base_glasses_02
map: [ "clothing_infoshades_decor" ] # LuaM infoshades_decor > clothing_infoshades_decor
map: [ "clothing_infoshades_decor" ]
shader: unshaded
- type: RandomSprite
available:
- infoshades_main:
# base_glasses_02: CyberpunkNeon # Commented by LuaM
# LuaM-start:
icon_base_glasses_02: Base
clothing_infoshades_main:
base_glasses_02: Base
# LuaM-end.
infoshades_decor:
# decor_base_glasses_02: CyberpunkNeon # Commented by LuaM
# LuaM-start:
icon_decor_base_glasses_02: Decor
clothing_infoshades_decor:
decor_base_glasses_02: Decor
mappedColors:
Base: CyberpunkNeon
Decor: CyberpunkNeon
# LuaM-end
- type: ShowHealthBars
damageContainers:
- Inorganic
Expand Down
22 changes: 4 additions & 18 deletions Resources/Prototypes/_NF/Entities/Clothing/Masks/masks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,47 +90,33 @@
- type: Sprite
sprite: _NF/Clothing/Mask/punkhalfmask.rsi
layers:
- state: icon-base-mask # LuaM equipped-MASK > icon-base-mask
- state: icon-base-mask
map: [ "mask_main" ]
# LuaM-comment-start:
# scale: 2, 2
# offset: 0,-0.6
# LuaM-comment-end.
- state: icon-decor-mask # LuaM decor-equipped-MASK > icon-decor-mask
- state: icon-decor-mask
map: [ "mask_decor" ]
shader: unshaded
# LuaM-comment-start:
# scale: 2, 2
# offset: 0,-0.6
# LuaM-comment-end.
- type: Clothing
sprite: _NF/Clothing/Mask/punkhalfmask.rsi
clothingVisuals:
mask:
- state: equipped-MASK
map: [ "clothing_mask_main" ] # LuaM mask_main > clothing_mask_main
map: [ "clothing_mask_main" ]
- state: decor-equipped-MASK
map: [ "clothing_mask_decor" ] # LuaM mask_decor > clothing_mask_decor
map: [ "clothing_mask_decor" ]
shader: unshaded
- type: RandomSprite
available:
- mask_main:
# equipped-MASK: CyberpunkDark # Commented by LuaM
# LuaM-start:
icon-base-mask: Base
clothing_mask_main:
equipped-MASK: Base
# LuaM-end
mask_decor:
# decor-equipped-MASK: CyberpunkNeon # Commented by LuaM
# LuaM-start:
icon-decor-mask: Decor
clothing_mask_decor:
decor-equipped-MASK: Decor
mappedColors:
Base: CyberpunkDark
Decor: CyberpunkNeon
# LuaM-end
- type: IdentityBlocker
coverage: MOUTH

Expand Down
40 changes: 7 additions & 33 deletions Resources/Prototypes/_NF/Entities/Clothing/Shoes/boots_punk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,35 @@
- type: Sprite
sprite: _NF/Clothing/Shoes/Boots/punk.rsi
layers:
- state: icon_base_boots_01 # LuaM base_boots_01 > icon_base_boots_01
- state: icon_base_boots_01
map: [ "boots_main" ]
# LuaM-comment-start:
# scale: 2, 2
# offset: 0,0.6
# LuaM-comment-end.
- state: icon_decor_base_boots_01 # LuaM decor_base_boots_01 > icon_decor_base_boots_01
- state: icon_decor_base_boots_01
map: [ "boots_decor" ]
# LuaM-comment-start:
# scale: 2, 2
# offset: 0,0.6
# - state: mask_null
# map: [ "boots_overlay" ]
# scale: 2, 2
# offset: 0,0.6
# LuaM-comment-end.
- type: Clothing
sprite: _NF/Clothing/Shoes/Boots/punk.rsi
clothingVisuals:
shoes:
- state: base_boots_01
map: [ "clothing_boots_main" ] # LuaM: boots_main > clothing_boots_main
map: [ "clothing_boots_main" ]
- state: mask_null
map: [ "clothing_boots_decor" ] # LuaM: boots_decor > clothing_boots_decor
map: [ "clothing_boots_decor" ]
- state: mask_null
map: [ "clothing_boots_overlay" ] # LuaM: boots_overlay > clothing_boots_overlay
map: [ "clothing_boots_overlay" ]
- type: RandomSprite
available:
# LuaM-comment-start:
# - boots_main:
# base_boots_01: Cyberpunk
# LuaM-comment-end.
# LuaM-start:
# decor present
- boots_main: &bootsMain
icon_base_boots_01: Base
clothing_boots_main: &clothingBootsMain
base_boots_01: Base
# LuaM-end.
boots_decor:
# LuaM-comment-start:
#
# decor_base_boots_01: Cyberpunk
# mask_null: ""
# boots_overlay:
# LuaM-comment-end.
# LuaM-start:
icon_decor_base_boots_01: Decor
clothing_boots_decor:
decor_base_boots_01: Decor
clothing_boots_overlay: &bootsOverlay
# LuaM-end.
decor_base_boots_02: Cyberpunk
mask_null: ""
# LuaM-comment-start:
# decor absent
- boots_main: *bootsMain
clothing_boots_main: *clothingBootsMain
boots_decor:
Expand All @@ -73,4 +48,3 @@
mappedColors:
Base: Cyberpunk
Decor: Cyberpunk
# LuaM end
Binary file modified Resources/Textures/_NF/Clothing/Belt/punk.rsi/icon_belt_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Resources/Textures/_NF/Clothing/Belt/punk.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Sprited by erhardsteinhauer (discord/github)",
Expand Down
Loading