Clouds overlay fix + Syringe + Localization visuals (#506)
* fix cloud
* add syringes to alchemist
* remove barrel crafting
* Revert "remove barrel crafting"
This reverts commit d3c5a26136.
* add localization visuals
This commit is contained in:
@@ -76,16 +76,16 @@ public sealed partial class StencilOverlay : Overlay
|
||||
|
||||
|
||||
//CP14 Overlays
|
||||
if (_entManager.TryGetComponent<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
|
||||
if (_entManager.TryGetComponent<CP14CloudShadowsComponent>(mapUid, out var shadows))
|
||||
{
|
||||
DrawWorldEdge(args, worldEdge, invMatrix);
|
||||
DrawCloudShadows(args, shadows, invMatrix);
|
||||
}
|
||||
//CP14 Overlays end
|
||||
|
||||
//CP14 Overlays
|
||||
if (_entManager.TryGetComponent<CP14CloudShadowsComponent>(mapUid, out var shadows))
|
||||
if (_entManager.TryGetComponent<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
|
||||
{
|
||||
DrawCloudShadows(args, shadows, invMatrix);
|
||||
DrawWorldEdge(args, worldEdge, invMatrix);
|
||||
}
|
||||
//CP14 Overlays end
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace Content.Client._CP14.Localization;
|
||||
|
||||
/// <summary>
|
||||
/// Controls the visual of the sprite, depending on the localization. Useful for drawn lettering
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class CP14LocalizationVisualsComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// map(map,(lang, state))
|
||||
/// in yml:
|
||||
///
|
||||
/// - type: Sprite
|
||||
/// layers:
|
||||
/// - state: stateName0
|
||||
/// map: ["map1"]
|
||||
/// - state: stateName0
|
||||
/// map: ["map2"]
|
||||
/// - type: CP14LocalizationVisuals
|
||||
/// mapStates:
|
||||
/// map1:
|
||||
/// ru-RU: stateName1
|
||||
/// en-US: stateName2
|
||||
/// map2:
|
||||
/// ru-RU: stateName3
|
||||
/// en-US: stateName4
|
||||
///
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Dictionary<string, Dictionary<string, string>> MapStates;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Content.Shared.Localizations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client._CP14.Localization;
|
||||
|
||||
public sealed class CP14LocalizationVisualsSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<CP14LocalizationVisualsComponent, ComponentInit>(OnCompInit);
|
||||
}
|
||||
|
||||
private void OnCompInit(Entity<CP14LocalizationVisualsComponent> visuals, ref ComponentInit args)
|
||||
{
|
||||
if (!TryComp<SpriteComponent>(visuals, out var sprite))
|
||||
return;
|
||||
|
||||
foreach (var (map, pDictionary) in visuals.Comp.MapStates)
|
||||
{
|
||||
if (!pDictionary.TryGetValue(ContentLocalizationManager.Culture, out var state))
|
||||
return;
|
||||
|
||||
if (sprite.LayerMapTryGet(map, out _))
|
||||
sprite.LayerSetState(map, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
- type: StorageFill
|
||||
contents:
|
||||
- id: HandLabeler #TODO custom cp14 labeler
|
||||
- id: Syringe #TODO custom cp14 syringe
|
||||
amount: 3
|
||||
- id: CP14Cauldron
|
||||
- id: CP14Pestle
|
||||
amount: 2
|
||||
|
||||
Reference in New Issue
Block a user