Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engine Update & EE Surgery #481

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
029b763
Shitmed: Implementing Existing Newmed Code Into SS14 (#1159)
gluesniffler Nov 17, 2024
ea9a076
Automatic Changelog Update (#1159)
SimpleStation14 Nov 17, 2024
bdbc394
Update Credits (#1235)
github-actions[bot] Nov 17, 2024
f95774b
Mass Engine Update (#1220)
sleepyyapril Nov 17, 2024
bf6019f
Pirate Radio Heisentest Fix (#1225)
VMSolidus Nov 17, 2024
2eea0f7
Fix Loadout Subcategories Not Being Found (#1233)
DEATHB4DEFEAT Nov 17, 2024
bea5f13
Hotfix Stamina System (#1245)
sleepyyapril Nov 18, 2024
3f8194a
Automatic Changelog Update (#1245)
SimpleStation14 Nov 18, 2024
ab0fa7c
Day/Night Time Cycle For Maps (#1234)
DocNITE Nov 18, 2024
460f444
Automatic Changelog Update (#1234)
SimpleStation14 Nov 18, 2024
860d7c6
Shitmed Update 1 (#1240)
gluesniffler Nov 18, 2024
eb0121f
Automatic Changelog Update (#1240)
SimpleStation14 Nov 18, 2024
aec89a5
Fix Self-Aware Crashing Client (#1247)
angelofallars Nov 18, 2024
ddee61c
Automatic Changelog Update (#1247)
SimpleStation14 Nov 18, 2024
bb13e39
Shitmed Surgery Popups (#1241)
angelofallars Nov 18, 2024
59d2695
AlertsComponentTest Fix (#1246)
sleepyyapril Nov 18, 2024
4fe41ef
Automatic Changelog Update (#1241)
SimpleStation14 Nov 18, 2024
1170399
Merge commit 'ea9a07616fb2b419e89811fa2f753a19aee0da73' into floof/ch…
Mnemotechnician Jan 13, 2025
0fd837f
Merge commit 'bdbc394a8ee4599ab783e83047abf9fa4db6bec8' into floof/ch…
Mnemotechnician Jan 13, 2025
8a64e87
Merge commit 'f95774b3ce4300012b8dbaa60829499ba6a68203' into floof/ch…
Mnemotechnician Jan 13, 2025
d2f8b9d
Migrate Floofstation rules to the new format
Mnemotechnician Jan 13, 2025
3ee02e9
Migrate old StorageFills to the new EntityTableContainerFill
Mnemotechnician Jan 13, 2025
36df059
-- Marker: compiles & runs with a few bugs --
Mnemotechnician Jan 13, 2025
6a511ab
Merge commit '3f8194a879035866199771121262e7ffca3ae2ae' into floof/ch…
Mnemotechnician Jan 13, 2025
0d7d3ce
Merge commit '4fe41eff5edd756aea6899e94f8637607dfec456' into floof/ch…
Mnemotechnician Jan 13, 2025
4d3ecb6
Mass Bug Fixing (#1256)
sleepyyapril Nov 22, 2024
ad3f4dd
Buff Medical Due to Shitmed Changes Cherry-Pick (#1259)
Tmanzxd Nov 22, 2024
1cf936b
Fix ointment caustic healing amount
Mnemotechnician Jan 13, 2025
ddb5ffa
Shitmed Update 2 - [Insert Snarky Remark] (#1271)
gluesniffler Nov 30, 2024
df96cdb
Fix Lobotomy (#1306)
angelofallars Dec 3, 2024
40cadff
Fix health analyzer and RehydratableSystem improper Dirty() call
Mnemotechnician Jan 13, 2025
5e3a62c
Ok apparently I cannot insert xaml comments inside a guidebook entery.
Mnemotechnician Jan 13, 2025
2a85f55
Fix rules formatting and naming
Mnemotechnician Jan 13, 2025
5b02182
Fix test fail caused by component modification on ComponentInit
Mnemotechnician Jan 13, 2025
5d4988d
Fuck you heisentest.
Mnemotechnician Jan 13, 2025
a616fe2
Made the rules tab collapsed by default (let's hope I don't cause a s…
Mnemotechnician Jan 13, 2025
8a4cca4
Fix pirate radio spawn
Mnemotechnician Jan 15, 2025
423bc3c
Fix standing state/buckle conflict
Mnemotechnician Jan 16, 2025
02360be
Remove collision fixtures from footprint entities
Mnemotechnician Jan 16, 2025
e7f4651
Fix incorrect dragging print orientation
Mnemotechnician Jan 16, 2025
f5837d3
Merge branch 'master' of https://github.com/Fansana/floofstation1 int…
Mnemotechnician Jan 17, 2025
493ee52
Separate spray paints into their own loot table and add them back int…
Mnemotechnician Jan 17, 2025
541190e
Minor syntax error
Mnemotechnician Jan 17, 2025
ed3d59e
Merge branch 'master' into floof/cherrypick/ee-surgery
Mnemotechnician Jan 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void OnPlayerDetached(EntityUid uid, AlertsComponent component, LocalPla
ClearAlerts?.Invoke(this, EventArgs.Empty);
}

public void AlertClicked(AlertType alertType)
public void AlertClicked(ProtoId<AlertPrototype> alertType)
{
RaiseNetworkEvent(new ClickAlertEvent(alertType));
}
Expand Down
6 changes: 5 additions & 1 deletion Content.Client/Audio/AmbientSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ private void ProcessNearbyAmbience(TransformComponent playerXform)
.WithMaxDistance(comp.Range);

var stream = _audio.PlayEntity(comp.Sound, Filter.Local(), uid, false, audioParams);
_playingSounds[comp] = (stream.Value.Entity, comp.Sound, key);

if (stream == null)
continue;

_playingSounds[comp] = (stream!.Value.Entity, comp.Sound, key);
playingCount++;

if (_playingSounds.Count >= _maxAmbientCount)
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Audio/ClientGlobalSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void PlayAdminSound(AdminSoundEvent soundEvent)
if(!_adminAudioEnabled) return;

var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
_adminAudio.Add(stream.Value.Entity);
_adminAudio.Add(stream!.Value.Entity);
}

private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
Expand All @@ -76,7 +76,7 @@ private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
if(!_eventAudioEnabled || _eventAudio.ContainsKey(soundEvent.Type)) return;

var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
_eventAudio.Add(soundEvent.Type, stream.Value.Entity);
_eventAudio.Add(soundEvent.Type, stream!.Value.Entity);
}

private void PlayGameSound(GameGlobalSoundEvent soundEvent)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private void UpdateAmbientMusic()
track.ToString(),
Filter.Local(),
false,
AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider));
AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider))!;

_ambientMusicStream = strim.Value.Entity;

Expand Down
6 changes: 5 additions & 1 deletion Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ private void PlaySoundtrack(string soundtrackFilename)
false,
_lobbySoundtrackParams.WithVolume(_lobbySoundtrackParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume)))
);
if (playResult.Value.Entity == default)

if (playResult == null)
return;

if (playResult!.Value.Entity == default)
{
_sawmill.Warning(
$"Tried to play lobby soundtrack '{{Filename}}' using {nameof(SharedAudioSystem)}.{nameof(SharedAudioSystem.PlayGlobal)} but it returned default value of EntityUid!",
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Body/Components/BrainComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Content.Client.Body.Components;
[RegisterComponent]
public sealed partial class BrainComponent : Component { }
3 changes: 3 additions & 0 deletions Content.Client/Body/Components/LungComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Content.Client.Body.Components;
[RegisterComponent]
public sealed partial class LungComponent : Component { }
3 changes: 3 additions & 0 deletions Content.Client/Body/Components/StomachComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Content.Client.Body.Components;
[RegisterComponent]
public sealed partial class StomachComponent : Component { }
65 changes: 65 additions & 0 deletions Content.Client/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,72 @@
using Content.Shared.Body.Systems;
using Content.Shared.Body.Part;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;
using Content.Shared.Body.Components;

namespace Content.Client.Body.Systems;

public sealed class BodySystem : SharedBodySystem
{
[Dependency] private readonly MarkingManager _markingManager = default!;

private void ApplyMarkingToPart(MarkingPrototype markingPrototype,
IReadOnlyList<Color>? colors,
bool visible,
SpriteComponent sprite)
{
for (var j = 0; j < markingPrototype.Sprites.Count; j++)
{
var markingSprite = markingPrototype.Sprites[j];

if (markingSprite is not SpriteSpecifier.Rsi rsi)
continue;

var layerId = $"{markingPrototype.ID}-{rsi.RsiState}";

if (!sprite.LayerMapTryGet(layerId, out _))
{
var layer = sprite.AddLayer(markingSprite, j + 1);
sprite.LayerMapSet(layerId, layer);
sprite.LayerSetSprite(layerId, rsi);
}

sprite.LayerSetVisible(layerId, visible);

if (!visible)
continue;

// Okay so if the marking prototype is modified but we load old marking data this may no longer be valid
// and we need to check the index is correct. So if that happens just default to white?
if (colors != null && j < colors.Count)
sprite.LayerSetColor(layerId, colors[j]);
else
sprite.LayerSetColor(layerId, Color.White);
}
}

protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceComponent component)
{
if (!TryComp(target, out SpriteComponent? sprite))
return;

if (component.Color != null)
sprite.Color = component.Color.Value;

foreach (var (visualLayer, markingList) in component.Markings)
foreach (var marking in markingList)
{
if (!_markingManager.TryGetMarking(marking, out var markingPrototype))
continue;

ApplyMarkingToPart(markingPrototype, marking.MarkingColors, marking.Visible, sprite);
}
}

protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance)
{
return;
}
}
81 changes: 61 additions & 20 deletions Content.Client/Buckle/BuckleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Shared.Buckle.Components;
using Content.Shared.Rotation;
using Robust.Client.GameObjects;
using Robust.Shared.GameStates;

namespace Content.Client.Buckle;

Expand All @@ -14,37 +15,77 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<BuckleComponent, AfterAutoHandleStateEvent>(OnBuckleAfterAutoHandleState);
SubscribeLocalEvent<BuckleComponent, AppearanceChangeEvent>(OnAppearanceChange);
SubscribeLocalEvent<StrapComponent, MoveEvent>(OnStrapMoveEvent);
SubscribeLocalEvent<BuckleComponent, BuckledEvent>(OnBuckledEvent);
SubscribeLocalEvent<BuckleComponent, UnbuckledEvent>(OnUnbuckledEvent);
}

private void OnBuckleAfterAutoHandleState(EntityUid uid, BuckleComponent component, ref AfterAutoHandleStateEvent args)
/// <summary>
/// Is the strap entity already rotated north? Lower the draw depth of the buckled entity.
/// </summary>
private void OnBuckledEvent(Entity<BuckleComponent> ent, ref BuckledEvent args)
{
ActionBlocker.UpdateCanMove(uid);

if (!TryComp<SpriteComponent>(uid, out var ownerSprite))
if (!TryComp<SpriteComponent>(args.Strap, out var strapSprite) ||
!TryComp<SpriteComponent>(ent.Owner, out var buckledSprite))
return;

// Adjust draw depth when the chair faces north so that the seat back is drawn over the player.
// Reset the draw depth when rotated in any other direction.
// TODO when ECSing, make this a visualizer
// This code was written before rotatable viewports were introduced, so hard-coding Direction.North
// and comparing it against LocalRotation now breaks this in other rotations. This is a FIXME, but
// better to get it working for most people before we look at a more permanent solution.
if (component is { Buckled: true, LastEntityBuckledTo: { } } &&
Transform(component.LastEntityBuckledTo.Value).LocalRotation.GetCardinalDir() == Direction.North &&
TryComp<SpriteComponent>(component.LastEntityBuckledTo, out var buckledSprite))
if (Transform(args.Strap.Owner).LocalRotation.GetCardinalDir() == Direction.North)
{
component.OriginalDrawDepth ??= ownerSprite.DrawDepth;
ownerSprite.DrawDepth = buckledSprite.DrawDepth - 1;
ent.Comp.OriginalDrawDepth ??= buckledSprite.DrawDepth;
buckledSprite.DrawDepth = strapSprite.DrawDepth - 1;
}
}

/// <summary>
/// Was the draw depth of the buckled entity lowered? Reset it upon unbuckling.
/// </summary>
private void OnUnbuckledEvent(Entity<BuckleComponent> ent, ref UnbuckledEvent args)
{
if (!TryComp<SpriteComponent>(ent.Owner, out var buckledSprite))
return;

if (ent.Comp.OriginalDrawDepth.HasValue)
{
buckledSprite.DrawDepth = ent.Comp.OriginalDrawDepth.Value;
ent.Comp.OriginalDrawDepth = null;
}
}

// If here, we're not turning north and should restore the saved draw depth.
if (component.OriginalDrawDepth.HasValue)
private void OnStrapMoveEvent(EntityUid uid, StrapComponent component, ref MoveEvent args)
{
// I'm moving this to the client-side system, but for the sake of posterity let's keep this comment:
// > This is mega cursed. Please somebody save me from Mr Buckle's wild ride

// The nice thing is its still true, this is quite cursed, though maybe not omega cursed anymore.
// This code is garbage, it doesn't work with rotated viewports. I need to finally get around to reworking
// sprite rendering for entity layers & direction dependent sorting.

if (args.NewRotation == args.OldRotation)
return;

if (!TryComp<SpriteComponent>(uid, out var strapSprite))
return;

var isNorth = Transform(uid).LocalRotation.GetCardinalDir() == Direction.North;
foreach (var buckledEntity in component.BuckledEntities)
{
ownerSprite.DrawDepth = component.OriginalDrawDepth.Value;
component.OriginalDrawDepth = null;
if (!TryComp<BuckleComponent>(buckledEntity, out var buckle))
continue;

if (!TryComp<SpriteComponent>(buckledEntity, out var buckledSprite))
continue;

if (isNorth)
{
buckle.OriginalDrawDepth ??= buckledSprite.DrawDepth;
buckledSprite.DrawDepth = strapSprite.DrawDepth - 1;
}
else if (buckle.OriginalDrawDepth.HasValue)
{
buckledSprite.DrawDepth = buckle.OriginalDrawDepth.Value;
buckle.OriginalDrawDepth = null;
}
}
}

Expand Down
Loading
Loading