RT v265.0.0 update (#39132)

This commit is contained in:
Pieter-Jan Briers
2025-07-23 12:29:27 +02:00
committed by GitHub
26 changed files with 30 additions and 97 deletions

View File

@@ -1,4 +1,5 @@
using Robust.Client.Graphics;
using System.Numerics;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
@@ -36,7 +37,7 @@ namespace Content.Client.Cooldown
if (Progress >= 0f)
{
var hue = (5f / 18f) * lerp;
color = Color.FromHsv((hue, 0.75f, 0.75f, 0.50f));
color = Color.FromHsv(new Vector4(hue, 0.75f, 0.75f, 0.50f));
}
else
{

View File

@@ -1,4 +1,5 @@
using Content.Shared.Disposal;
using System.Numerics;
using Content.Shared.Disposal;
using Content.Shared.Disposal.Unit;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;

View File

@@ -5,6 +5,7 @@ using Robust.Client.Graphics;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using System.Linq;
using System.Numerics;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Holopad;

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Items.Systems;
using Content.Shared.Clothing;
using Content.Shared.Hands;

View File

@@ -3,6 +3,7 @@ using Robust.Client.UserInterface.XAML;
using Robust.Client.GameObjects;
using Robust.Shared.IoC;
using System;
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Shared.APC;
using Robust.Client.Graphics;

View File

@@ -6,7 +6,6 @@ using Robust.Shared.Utility;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using Vector4 = Robust.Shared.Maths.Vector4;
namespace Content.Client.Power;

View File

@@ -10,7 +10,6 @@ using Robust.Shared.Physics;
using Robust.Shared.Threading;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Vector2 = System.Numerics.Vector2;
namespace Content.Client.Shuttles.UI;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Mobs;
using Robust.Client.Graphics;
using Robust.Client.Player;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
@@ -43,7 +44,7 @@ public sealed class ProgressColorSystem : EntitySystem
// lerp
var hue = 5f / 18f * progress;
return Color.FromHsv((hue, 1f, 0.75f, 1f));
return Color.FromHsv(new Vector4(hue, 1f, 0.75f, 1f));
}
return InterpolateColorGaussian(Plasma, progress);

View File

@@ -621,7 +621,7 @@ public sealed class StorageWindow : BaseWindow
{
marked.Add(cell);
cell.ModulateSelfOverride = spotFree
? Color.FromHsv((0.18f, 1 / spot, 0.5f / spot + 0.5f, 1f))
? Color.FromHsv(new Vector4(0.18f, 1 / spot, 0.5f / spot + 0.5f, 1f))
: Color.FromHex("#2222CC");
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using System.Security.Cryptography;
using Microsoft.VisualBasic.CompilerServices;

View File

@@ -1,6 +1,4 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Sound.Components;
@@ -13,25 +11,13 @@ public abstract partial class BaseEmitSoundComponent : Component
/// <summary>
/// The <see cref="SoundSpecifier"/> to play.
/// </summary>
[DataField(required: true)]
[DataField(required: true), AutoNetworkedField]
public SoundSpecifier? Sound;
/// <summary>
/// Play the sound at the position instead of parented to the source entity.
/// Useful if the entity is deleted after.
/// </summary>
[DataField]
[DataField, AutoNetworkedField]
public bool Positional;
}
/// <summary>
/// Represents the state of <see cref="BaseEmitSoundComponent"/>.
/// </summary>
/// <remarks>This is obviously very cursed, but since the BaseEmitSoundComponent is abstract, we cannot network it.
/// AutoGenerateComponentState attribute won't work here, and since everything revolves around inheritance for some fucking reason,
/// there's no better way of doing this.</remarks>
[Serializable, NetSerializable]
public struct EmitSoundComponentState(SoundSpecifier? sound) : IComponentState
{
public SoundSpecifier? Sound { get; } = sound;
}

View File

@@ -5,7 +5,7 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on ActivateInWorld
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnActivateComponent : BaseEmitSoundComponent
{
/// <summary>

View File

@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Sound.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause, AutoGenerateComponentState]
public sealed partial class EmitSoundOnCollideComponent : BaseEmitSoundComponent
{
public static readonly TimeSpan CollideCooldown = TimeSpan.FromSeconds(0.2);

View File

@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on entity drop
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnDropComponent : BaseEmitSoundComponent;

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Whenever this item is used upon by an entity, with a tag or component within a whitelist, in the hand of a user, play a sound
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnInteractUsingComponent : BaseEmitSoundComponent
{
/// <summary>

View File

@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on LandEvent
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnLandComponent : BaseEmitSoundComponent;

View File

@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on entity pickup
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnPickupComponent : BaseEmitSoundComponent;

View File

@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on entity spawn.
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnSpawnComponent : BaseEmitSoundComponent;

View File

@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on ThrowEvent
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnThrowComponent : BaseEmitSoundComponent;

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on AfterActivatableUIOpenEvent
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnUIOpenComponent : BaseEmitSoundComponent
{
/// <summary>

View File

@@ -5,7 +5,7 @@ namespace Content.Shared.Sound.Components;
/// <summary>
/// Simple sound emitter that emits sound on UseInHand
/// </summary>
[RegisterComponent, NetworkedComponent]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitSoundOnUseComponent : BaseEmitSoundComponent
{
/// <summary>

View File

@@ -55,47 +55,6 @@ public abstract class SharedEmitSoundSystem : EntitySystem
SubscribeLocalEvent<EmitSoundOnCollideComponent, StartCollideEvent>(OnEmitSoundOnCollide);
SubscribeLocalEvent<SoundWhileAliveComponent, MobStateChangedEvent>(OnMobState);
// We need to handle state manually here
// BaseEmitSoundComponent isn't registered so we have to subscribe to each one
// TODO: Make it use autonetworking instead of relying on inheritance
SubscribeEmitComponent<EmitSoundOnActivateComponent>();
SubscribeEmitComponent<EmitSoundOnCollideComponent>();
SubscribeEmitComponent<EmitSoundOnDropComponent>();
SubscribeEmitComponent<EmitSoundOnInteractUsingComponent>();
SubscribeEmitComponent<EmitSoundOnLandComponent>();
SubscribeEmitComponent<EmitSoundOnPickupComponent>();
SubscribeEmitComponent<EmitSoundOnSpawnComponent>();
SubscribeEmitComponent<EmitSoundOnThrowComponent>();
SubscribeEmitComponent<EmitSoundOnUIOpenComponent>();
SubscribeEmitComponent<EmitSoundOnUseComponent>();
// Helper method so it's a little less ugly
void SubscribeEmitComponent<T>() where T : BaseEmitSoundComponent
{
SubscribeLocalEvent<T, ComponentGetState>(GetBaseEmitState);
SubscribeLocalEvent<T, ComponentHandleState>(HandleBaseEmitState);
}
}
private static void GetBaseEmitState<T>(Entity<T> ent, ref ComponentGetState args) where T : BaseEmitSoundComponent
{
args.State = new EmitSoundComponentState(ent.Comp.Sound);
}
private static void HandleBaseEmitState<T>(Entity<T> ent, ref ComponentHandleState args) where T : BaseEmitSoundComponent
{
if (args.Current is not EmitSoundComponentState state)
return;
ent.Comp.Sound = state.Sound switch
{
SoundPathSpecifier pathSpec => new SoundPathSpecifier(pathSpec.Path, pathSpec.Params),
SoundCollectionSpecifier collectionSpec => collectionSpec.Collection != null
? new SoundCollectionSpecifier(collectionSpec.Collection, collectionSpec.Params)
: null,
_ => null,
};
}
private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args)

View File

@@ -9,19 +9,13 @@ public sealed partial class ForceGunComponent : BaseForceGunComponent
/// <summary>
/// Maximum distance to throw entities.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("throwDistance"), AutoNetworkedField]
[DataField, AutoNetworkedField]
public float ThrowDistance = 15f;
[ViewVariables(VVAccess.ReadWrite), DataField("throwForce"), AutoNetworkedField]
[DataField, AutoNetworkedField]
public float ThrowForce = 30f;
/// <summary>
/// The entity currently tethered.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("tethered"), AutoNetworkedField]
public override EntityUid? Tethered { get; set; }
[ViewVariables(VVAccess.ReadWrite), DataField("soundLaunch")]
[DataField("soundLaunch")]
public SoundSpecifier? LaunchSound = new SoundPathSpecifier("/Audio/Weapons/soup.ogg")
{
Params = AudioParams.Default.WithVolume(5f),

View File

@@ -5,18 +5,6 @@ namespace Content.Shared.Weapons.Misc;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
public sealed partial class TetherGunComponent : BaseForceGunComponent
{
[ViewVariables(VVAccess.ReadWrite), DataField("maxDistance"), AutoNetworkedField]
[DataField, AutoNetworkedField]
public float MaxDistance = 10f;
/// <summary>
/// The entity the tethered target has a joint to.
/// </summary>
[DataField("tetherEntity"), AutoNetworkedField]
public override EntityUid? TetherEntity { get; set; }
/// <summary>
/// The entity currently tethered.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("tethered"), AutoNetworkedField]
public override EntityUid? Tethered { get; set; }
}