more params in component
This commit is contained in:
@@ -53,11 +53,11 @@ public sealed partial class StencilOverlay
|
||||
worldHandle.UseShader(_protoManager.Index<ShaderPrototype>("StencilMask").Instance());
|
||||
worldHandle.DrawTextureRect(_blep!.Texture, worldBounds);
|
||||
var curTime = _timing.RealTime;
|
||||
var sprite = _sprite.GetFrame(new SpriteSpecifier.Texture(new ResPath("/Textures/Parallaxes/AspidParallaxNeb.png")), curTime);
|
||||
var sprite = _sprite.GetFrame(new SpriteSpecifier.Texture(new ResPath(cloudComp.ParallaxPath)), curTime);
|
||||
|
||||
// Draw the rain
|
||||
worldHandle.UseShader(_protoManager.Index<ShaderPrototype>("StencilDraw").Instance());
|
||||
_parallax.DrawParallax(worldHandle, worldAABB, sprite, curTime, position, cloudComp.CloudSpeed, modulate: Color.White.WithAlpha(cloudComp.Alpha));
|
||||
_parallax.DrawParallax(worldHandle, worldAABB, sprite, curTime, position, cloudComp.CloudSpeed, modulate: Color.White.WithAlpha(cloudComp.Alpha), scale: cloudComp.Scale);
|
||||
|
||||
worldHandle.SetTransform(Matrix3x2.Identity);
|
||||
worldHandle.UseShader(null);
|
||||
|
||||
24
Content.Server/_CP14/DayCycle/CP14CloudShadowsSystem.cs
Normal file
24
Content.Server/_CP14/DayCycle/CP14CloudShadowsSystem.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared._CP14.DayCycle;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server._CP14.DayCycle;
|
||||
|
||||
public sealed partial class CP14CloudShadowsSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<CP14CloudShadowsComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<CP14CloudShadowsComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
ent.Comp.CloudSpeed = new Vector2(
|
||||
_random.NextFloat(-ent.Comp.MaxSpeed, ent.Comp.MaxSpeed),
|
||||
_random.NextFloat(-ent.Comp.MaxSpeed, ent.Comp.MaxSpeed));
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,15 @@ public sealed partial class CP14CloudShadowsComponent : Component
|
||||
[DataField, AutoNetworkedField]
|
||||
public Vector2 CloudSpeed = new Vector2(0.5f, 0f);
|
||||
|
||||
[DataField]
|
||||
public float MaxSpeed = 1.5f;
|
||||
|
||||
[DataField, AutoNetworkedField]
|
||||
public float Alpha = 1f;
|
||||
|
||||
[DataField]
|
||||
public float Scale = 2.5f;
|
||||
|
||||
[DataField]
|
||||
public string ParallaxPath = "/Textures/_CP14/Parallaxes/Shadows.png";
|
||||
}
|
||||
|
||||
BIN
Resources/Textures/_CP14/Parallaxes/Shadows.png
Normal file
BIN
Resources/Textures/_CP14/Parallaxes/Shadows.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 629 KiB |
4
Resources/Textures/_CP14/Parallaxes/attributions.yml
Normal file
4
Resources/Textures/_CP14/Parallaxes/attributions.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- files: ["Shadows.png"]
|
||||
license: "CC-BY-SA-3.0"
|
||||
copyright: "Created by TheShuEd for CrystallPunk14"
|
||||
source: "https://github.com/crystallpunk-14/crystall-punk-14"
|
||||
Reference in New Issue
Block a user