Skip to content

Commit

Permalink
Merge Stable 8/10/24 (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
LankLTE authored Oct 9, 2024
2 parents 92f87a2 + 848d98e commit 7bab72b
Show file tree
Hide file tree
Showing 119 changed files with 1,330 additions and 337 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ concurrency:

on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *'
# schedule:
# - cron: '0 10 * * *'

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Inventory/StrippableBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void UpdateMenu()
}
}

if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp))
if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp) && handsComp.CanBeStripped)
{
// good ol hands shit code. there is a GuiHands comparer that does the same thing... but these are hands
// and not gui hands... which are different...
Expand Down
2 changes: 2 additions & 0 deletions Content.Client/Paper/UI/PaperWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ protected override DragMode GetDragModeFor(Vector2 relativeMousePos)

private void RunOnSaved()
{
// Prevent further saving while text processing still in
SaveButton.Disabled = true;
OnSaved?.Invoke(Rope.Collapse(Input.TextRope));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Content.Server.CartridgeLoader.Cartridges;

[RegisterComponent]
public sealed partial class MedTekCartridgeComponent : Component
{
}
31 changes: 31 additions & 0 deletions Content.Server/CartridgeLoader/Cartridges/MedTekCartridgeSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Server.Medical.Components;
using Content.Shared.CartridgeLoader;

namespace Content.Server.CartridgeLoader.Cartridges;

public sealed class MedTekCartridgeSystem : EntitySystem
{
[Dependency] private readonly CartridgeLoaderSystem _cartridgeLoaderSystem = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<MedTekCartridgeComponent, CartridgeAddedEvent>(OnCartridgeAdded);
SubscribeLocalEvent<MedTekCartridgeComponent, CartridgeRemovedEvent>(OnCartridgeRemoved);
}

private void OnCartridgeAdded(Entity<MedTekCartridgeComponent> ent, ref CartridgeAddedEvent args)
{
var healthAnalyzer = EnsureComp<HealthAnalyzerComponent>(args.Loader);
}

private void OnCartridgeRemoved(Entity<MedTekCartridgeComponent> ent, ref CartridgeRemovedEvent args)
{
// only remove when the program itself is removed
if (!_cartridgeLoaderSystem.HasProgram<MedTekCartridgeComponent>(args.Loader))
{
RemComp<HealthAnalyzerComponent>(args.Loader);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public sealed partial class HealthAnalyzerComponent : Component
/// Sound played on scanning end
/// </summary>
[DataField]
public SoundSpecifier? ScanningEndSound;
public SoundSpecifier ScanningEndSound = new SoundPathSpecifier("/Audio/Items/Medical/healthscanner.ogg");

/// <summary>
/// Whether to show up the popup
Expand Down
5 changes: 2 additions & 3 deletions Content.Server/Medical/HealthAnalyzerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
using Content.Shared.MedicalScanner;
using Content.Shared.Mobs.Components;
using Content.Shared.Popups;
using Content.Shared.PowerCell;
using Robust.Server.GameObjects;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Timing;

namespace Content.Server.Medical;
Expand Down Expand Up @@ -104,7 +102,8 @@ private void OnDoAfter(Entity<HealthAnalyzerComponent> uid, ref HealthAnalyzerDo
if (args.Handled || args.Cancelled || args.Target == null || !_cell.HasDrawCharge(uid, user: args.User))
return;

_audio.PlayPvs(uid.Comp.ScanningEndSound, uid);
if (!uid.Comp.Silent)
_audio.PlayPvs(uid.Comp.ScanningEndSound, uid);

OpenUserInterface(args.User, uid);
BeginAnalyzingEntity(uid, args.Target.Value);
Expand Down
3 changes: 1 addition & 2 deletions Content.Shared/Doors/Systems/SharedDoorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,7 @@ public IEnumerable<EntityUid> GetColliding(EntityUid uid, PhysicsComponent? phys
var tileRef = _mapSystem.GetTileRef(xform.GridUid.Value, mapGridComp, xform.Coordinates);

_doorIntersecting.Clear();

_entityLookup.GetLocalEntitiesIntersecting(xform.GridUid.Value, tileRef.GridIndices, _doorIntersecting, gridComp: mapGridComp);
_entityLookup.GetLocalEntitiesIntersecting(xform.GridUid.Value, tileRef.GridIndices, _doorIntersecting, gridComp: mapGridComp, flags: (LookupFlags.All & ~LookupFlags.Sensors));

// TODO SLOTH fix electro's code.
// ReSharper disable once InconsistentNaming
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/Hands/Components/HandsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public sealed partial class HandsComponent : Component

[DataField]
public DisplacementData? HandDisplacement;

/// <summary>
/// If false, hands cannot be stripped, and they do not show up in the stripping menu.
/// </summary>
[DataField]
public bool CanBeStripped = true;
}

[Serializable, NetSerializable]
Expand Down
10 changes: 8 additions & 2 deletions Content.Shared/Interaction/SmartEquipSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Shared.Input;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Stacks;
using Content.Shared.Storage;
using Content.Shared.Storage.EntitySystems;
using Content.Shared.Whitelist;
Expand Down Expand Up @@ -151,8 +152,13 @@ private void HandleSmartEquip(ICommonSession? session, string equipmentSlot)
_hands.TryDrop(uid, hands.ActiveHand, handsComp: hands);
_storage.Insert(slotItem, handItem.Value, out var stacked);

if (stacked != null)
_hands.TryPickup(uid, stacked.Value, handsComp: hands);
// if the hand item stacked with the things in inventory, but there's no more space left for the rest
// of the stack, place the stack back in hand rather than dropping it on the floor
if (stacked != null && !_storage.CanInsert(slotItem, handItem.Value, out _))
{
if (TryComp<StackComponent>(handItem.Value, out var handStack) && handStack.Count > 0)
_hands.TryPickup(uid, handItem.Value, handsComp: hands);
}

return;
}
Expand Down
7 changes: 7 additions & 0 deletions Content.Shared/Materials/SharedMaterialStorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Shared.Research.Components;

namespace Content.Shared.Materials;

Expand All @@ -34,6 +35,7 @@ public override void Initialize()

SubscribeLocalEvent<MaterialStorageComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<MaterialStorageComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<MaterialStorageComponent, TechnologyDatabaseModifiedEvent>(OnDatabaseModified);
}

public override void Update(float frameTime)
Expand Down Expand Up @@ -312,6 +314,11 @@ private void OnInteractUsing(EntityUid uid, MaterialStorageComponent component,
args.Handled = TryInsertMaterialEntity(args.User, args.Used, uid, component);
}

private void OnDatabaseModified(Entity<MaterialStorageComponent> ent, ref TechnologyDatabaseModifiedEvent args)
{
UpdateMaterialWhitelist(ent);
}

public int GetSheetVolume(MaterialPrototype material)
{
if (material.StackEntity == null)
Expand Down
9 changes: 9 additions & 0 deletions Content.Shared/Strip/SharedStrippableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ private void StripHand(
!Resolve(target, ref targetStrippable))
return;

if (!target.Comp.CanBeStripped)
return;

if (!_handsSystem.TryGetHand(target.Owner, handId, out var handSlot))
return;

Expand Down Expand Up @@ -349,6 +352,9 @@ private bool CanStripInsertHand(
!Resolve(target, ref target.Comp))
return false;

if (!target.Comp.CanBeStripped)
return false;

if (user.Comp.ActiveHand == null)
return false;

Expand Down Expand Up @@ -449,6 +455,9 @@ private bool CanStripRemoveHand(
if (!Resolve(target, ref target.Comp))
return false;

if (!target.Comp.CanBeStripped)
return false;

if (!_handsSystem.TryGetHand(target, handName, out var handSlot, target.Comp))
{
_popupSystem.PopupCursor(Loc.GetString("strippable-component-item-slot-free-message", ("owner", Identity.Name(target, EntityManager, user))));
Expand Down
2 changes: 1 addition & 1 deletion Resources/Credits/GitHub.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Resources/Locale/en-US/cartridge-loader/cartridges.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ log-probe-label-number = #
astro-nav-program-name = AstroNav
med-tek-program-name = MedTek
# Wanted list cartridge
wanted-list-program-name = Wanted list
wanted-list-label-no-records = It's all right, cowboy
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/tiles/tiles.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ tiles-reinforced-glass-floor = reinforced glass floor
tiles-metal-foam = metal foam floor
tiles-green-circuit-floor = green circuit floor
tiles-blue-circuit-floor = blue circuit floor
tiles-red-circuit-floor = red circuit floor
tiles-snow = snow
tiles-snow-plating = snowed plating
tiles-snow-dug = dug snow
Expand Down
Loading

0 comments on commit 7bab72b

Please sign in to comment.