Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/wizards/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Jun 29, 2024
2 parents 2d4e8f5 + 21a93eb commit e143d83
Show file tree
Hide file tree
Showing 14 changed files with 1,705 additions and 1,687 deletions.
12 changes: 4 additions & 8 deletions Content.Client/Clothing/UI/ChameleonMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using System.Numerics;
using Content.Client.Clothing.Systems;
using Content.Client.Stylesheets;
Expand Down Expand Up @@ -74,13 +74,9 @@ private void UpdateGrid()
};
button.OnPressed += _ => OnIdSelected?.Invoke(id);
Grid.AddChild(button);

var texture = _sprite.GetPrototypeIcon(proto);
button.AddChild(new TextureRect
{
Stretch = TextureRect.StretchMode.KeepAspectCentered,
Texture = texture.Default
});
var entityPrototypeView = new EntityPrototypeView();
entityPrototypeView.SetPrototype(proto);
button.AddChild(entityPrototypeView);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public sealed partial class GasMinerComponent : Component
[DataField("spawnTemperature")]
public float SpawnTemperature { get; set; } = Atmospherics.T20C;

/// <summary>
/// Number of moles created per second when the miner is working.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("spawnAmount")]
public float SpawnAmount { get; set; } = Atmospherics.MolesCellStandard * 20f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ public override void Initialize()
private void OnMinerUpdated(Entity<GasMinerComponent> ent, ref AtmosDeviceUpdateEvent args)
{
var miner = ent.Comp;
if (!CheckMinerOperation(ent, out var environment) || !miner.Enabled || !miner.SpawnGas.HasValue || miner.SpawnAmount <= 0f)

// SpawnAmount is declared in mol/s so to get the amount of gas we hope to mine, we have to multiply this by
// how long we have been waiting to spawn it.
var toSpawn = miner.SpawnAmount * args.dt;
if (!CheckMinerOperation(ent, toSpawn, out var environment) || !miner.Enabled || !miner.SpawnGas.HasValue || toSpawn <= 0f)
return;

// Time to mine some gas.

var merger = new GasMixture(1) { Temperature = miner.SpawnTemperature };
merger.SetMoles(miner.SpawnGas.Value, miner.SpawnAmount);
merger.SetMoles(miner.SpawnGas.Value, toSpawn);

_atmosphereSystem.Merge(environment, merger);
}

private bool CheckMinerOperation(Entity<GasMinerComponent> ent, [NotNullWhen(true)] out GasMixture? environment)
private bool CheckMinerOperation(Entity<GasMinerComponent> ent, float toSpawn, [NotNullWhen(true)] out GasMixture? environment)
{
var (uid, miner) = ent;
var transform = Transform(uid);
Expand All @@ -59,7 +63,7 @@ private bool CheckMinerOperation(Entity<GasMinerComponent> ent, [NotNullWhen(tru

// External pressure above threshold.
if (!float.IsInfinity(miner.MaxExternalPressure) &&
environment.Pressure > miner.MaxExternalPressure - miner.SpawnAmount * miner.SpawnTemperature * Atmospherics.R / environment.Volume)
environment.Pressure > miner.MaxExternalPressure - toSpawn * miner.SpawnTemperature * Atmospherics.R / environment.Volume)
{
miner.Broken = true;
return false;
Expand Down
11 changes: 10 additions & 1 deletion Content.Shared/Armor/AllowSuitStorageComponent.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Content.Shared.Whitelist;

namespace Content.Shared.Armor;

/// <summary>
Expand All @@ -6,5 +8,12 @@ namespace Content.Shared.Armor;
[RegisterComponent]
public sealed partial class AllowSuitStorageComponent : Component
{

/// <summary>
/// Whitelist for what entities are allowed in the suit storage slot.
/// </summary>
[DataField]
public EntityWhitelist Whitelist = new()
{
Components = new[] {"Item"}
};
}
8 changes: 8 additions & 0 deletions Content.Shared/Inventory/InventorySystem.Equip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,17 @@ public bool CanEquip(EntityUid actor, EntityUid target, EntityUid itemUid, strin
return false;

if (slotDefinition.DependsOnComponents is { } componentRegistry)
{
foreach (var (_, entry) in componentRegistry)
{
if (!HasComp(slotEntity, entry.Component.GetType()))
return false;

if (TryComp<AllowSuitStorageComponent>(slotEntity, out var comp) &&
_whitelistSystem.IsWhitelistFailOrNull(comp.Whitelist, itemUid))
return false;
}
}
}

var fittingInPocket = slotDefinition.SlotFlags.HasFlag(SlotFlags.POCKET) &&
Expand Down
45 changes: 21 additions & 24 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
Entries:
- author: Flareguy
changes:
- message: Added emergency nitrogen lockers. You can scarcely find them in public
areas, or scattered around in maintenance tunnels.
type: Add
id: 6330
time: '2024-04-10T21:20:05.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26752
- author: Jark255
changes:
- message: Door electronics now require network configurators to change their access
settings, rather than doing so by hand.
type: Fix
id: 6331
time: '2024-04-11T12:21:15.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26888
- author: lunarcomets
changes:
- message: Cryogenic sleep units now remove crew members from the manifest, and
announce when crew members go into cryogenic storage.
type: Tweak
id: 6332
time: '2024-04-11T20:48:46.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26813
- author: Vermidia
changes:
- message: Salt and Pepper shakers look like shakers.
Expand Down Expand Up @@ -3832,3 +3808,24 @@
id: 6829
time: '2024-06-28T03:34:24.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29487
- author: slarticodefast
changes:
- message: Passive vents now have the correct sprite.
type: Fix
id: 6830
time: '2024-06-28T12:33:03.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29536
- author: Plykiya
changes:
- message: Icons in the chameleon menu now appear correctly.
type: Fix
id: 6831
time: '2024-06-28T21:21:36.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29539
- author: DogZeroX
changes:
- message: Bananium no longer emit rads
type: Remove
id: 6832
time: '2024-06-28T23:28:27.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29545
Loading

0 comments on commit e143d83

Please sign in to comment.