Skip to content

Commit 14f45c8

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 602a247 + f7ae0b0 commit 14f45c8

916 files changed

Lines changed: 23922 additions & 22086 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
/Resources/Prototypes/Maps/** @Emisse @ArtisticRoomba @spanky-spanky
1212
/Resources/Maps/** @Emisse @ArtisticRoomba @spanky-spanky
1313

14-
/Resources/Prototypes/Body/ @DrSmugleaf # suffering
14+
/Resources/Prototypes/Body/ @DrSmugleaf @sowelipililimute # suffering
1515
/Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf
1616
/Resources/Prototypes/Entities/Mobs/Species/ @DrSmugleaf
1717
/Resources/Prototypes/Guidebook/rules.yml @crazybrain23
18-
/Content.*/Body/ @DrSmugleaf
18+
/Content.*/Body/ @DrSmugleaf @sowelipililimute
19+
/Content.*/Humanoid/ @sowelipililimute
20+
/Content.Client/Lobby/UI/Humanoid* @sowelipililimute
1921
/Content.YAMLLinter @DrSmugleaf
2022
/Content.Shared/Damage/ @DrSmugleaf
2123

.github/workflows/close-master-pr.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ name: Close PRs on master
33
on:
44
pull_request_target:
55
types: [ opened, ready_for_review ]
6-
6+
77
jobs:
88
run:
99
runs-on: ubuntu-latest
10-
if: ${{github.head_ref == 'master' || github.head_ref == 'main' || github.head_ref == 'develop'}}
11-
12-
steps:
10+
if: ${{(github.head_ref == 'master' || github.head_ref == 'main' || github.head_ref == 'develop' || github.head_ref == 'stable' || github.head_ref == 'staging')
11+
&& github.event.pull_request.head.repo.fork}}
12+
13+
steps:
1314
- uses: superbrothers/close-pull-request@v3
1415
with:
15-
comment: "Thank you for your contribution! It appears you created a PR from your master branch, this is [something you should avoid doing](https://jmeridth.com/posts/do-not-issue-pull-requests-from-your-master-branch/), and thus this PR has been automatically closed. \n \n We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html). \n \n You can move your current work from the master branch to another branch by following [these commands](https://ohshitgit.com/#accidental-commit-master). And then you may recreate your PR using the new branch."
16+
comment: "Thank you for your contribution! It appears you created a pull request from the master branch or another main development branch. This is [something you should avoid doing](https://jmeridth.com/posts/do-not-issue-pull-requests-from-your-master-branch/), and thus this pull request has been automatically closed. \n \n We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html). \n \n You can move your current work to another branch by following [these commands](https://ohshitgit.com/#accidental-commit-master). Then, you may recreate your pull request using the new branch."
17+
18+
# If you prefer to just comment on the pr and not close it, uncomment the below and comment the above
1619

17-
# If you prefer to just comment on the pr and not close it, uncomment the bellow and comment the above
18-
1920
# - uses: actions/github-script@v7
2021
# with:
2122
# script: |
2223
# github.rest.issues.createComment({
2324
# issue_number: ${{ github.event.number }},
2425
# owner: context.repo.owner,
2526
# repo: context.repo.repo,
26-
# body: "Thank you for contributing to the Space Station 14 repository. Unfortunately, it looks like you submitted your pull request from the master branch. We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html) \n\n You can move your current work from the master branch to another branch by doing `git branch <branch_name` and resetting the master branch. \n\n This pr won't be automatically closed. However, a maintainer may close it for this reason."
27-
# })
27+
# body: "Thank you for your contribution! It appears you created a pull request from the master branch or another main development branch. This is [something you should avoid doing](https://jmeridth.com/posts/do-not-issue-pull-requests-from-your-master-branch/)\n\nYou can move your current work to another branch by following [these commands](https://ohshitgit.com/#accidental-commit-master). Then, you may recreate your pull request using the new branch. \n\n This pull request won't be automatically closed. However, a maintainer may close it for this reason."})
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
using System.Threading.Tasks;
2+
using BenchmarkDotNet.Attributes;
3+
using Content.IntegrationTests;
4+
using Content.IntegrationTests.Pair;
5+
using Content.Server.Atmos.EntitySystems;
6+
using Content.Shared.Atmos;
7+
using Robust.Shared;
8+
using Robust.Shared.Analyzers;
9+
using Robust.Shared.GameObjects;
10+
11+
namespace Content.Benchmarks;
12+
13+
[Virtual]
14+
[GcServer(true)]
15+
[MemoryDiagnoser]
16+
public class HeatCapacityBenchmark
17+
{
18+
private TestPair _pair = default!;
19+
private IEntityManager _sEntMan = default!;
20+
private IEntityManager _cEntMan = default!;
21+
private Client.Atmos.EntitySystems.AtmosphereSystem _cAtmos = default!;
22+
private AtmosphereSystem _sAtmos = default!;
23+
private GasMixture _mix;
24+
25+
[GlobalSetup]
26+
public async Task SetupAsync()
27+
{
28+
ProgramShared.PathOffset = "../../../../";
29+
PoolManager.Startup();
30+
_pair = await PoolManager.GetServerClient();
31+
await _pair.Connect();
32+
_cEntMan = _pair.Client.ResolveDependency<IEntityManager>();
33+
_sEntMan = _pair.Server.ResolveDependency<IEntityManager>();
34+
_cAtmos = _cEntMan.System<Client.Atmos.EntitySystems.AtmosphereSystem>();
35+
_sAtmos = _sEntMan.System<AtmosphereSystem>();
36+
37+
const float volume = 2500f;
38+
const float temperature = 293.15f;
39+
40+
const float o2 = 12.3f;
41+
const float n2 = 45.6f;
42+
const float co2 = 0.42f;
43+
const float plasma = 0.05f;
44+
45+
_mix = new GasMixture(volume) { Temperature = temperature };
46+
47+
_mix.AdjustMoles(Gas.Oxygen, o2);
48+
_mix.AdjustMoles(Gas.Nitrogen, n2);
49+
_mix.AdjustMoles(Gas.CarbonDioxide, co2);
50+
_mix.AdjustMoles(Gas.Plasma, plasma);
51+
}
52+
53+
[Benchmark]
54+
public async Task ClientHeatCapacityBenchmark()
55+
{
56+
await _pair.Client.WaitPost(delegate
57+
{
58+
for (var i = 0; i < 10000; i++)
59+
{
60+
_cAtmos.GetHeatCapacity(_mix, applyScaling: true);
61+
}
62+
});
63+
}
64+
65+
[Benchmark]
66+
public async Task ServerHeatCapacityBenchmark()
67+
{
68+
await _pair.Server.WaitPost(delegate
69+
{
70+
for (var i = 0; i < 10000; i++)
71+
{
72+
_sAtmos.GetHeatCapacity(_mix, applyScaling: true);
73+
}
74+
});
75+
}
76+
77+
[GlobalCleanup]
78+
public async Task CleanupAsync()
79+
{
80+
await _pair.DisposeAsync();
81+
PoolManager.Shutdown();
82+
}
83+
}

Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ private void OnAfterHandleState(Entity<InnerBodyAnomalyComponent> ent, ref After
2525

2626
var index = _sprite.LayerMapReserve((ent.Owner, sprite), ent.Comp.LayerMap);
2727

28-
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoidAppearance) &&
29-
ent.Comp.SpeciesSprites.TryGetValue(humanoidAppearance.Species, out var speciesSprite))
28+
if (TryComp<HumanoidProfileComponent>(ent, out var humanoid) &&
29+
ent.Comp.SpeciesSprites.TryGetValue(humanoid.Species, out var speciesSprite))
3030
{
3131
_sprite.LayerSetSprite((ent.Owner, sprite), index, speciesSprite);
3232
}

Content.Client/Anomaly/Ui/AnomalyGeneratorWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<controls:FancyWindow xmlns="https://spacestation14.io"
1+
<controls:FancyWindow xmlns="https://spacestation14.io"
22
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
33
Title="{Loc 'anomaly-generator-ui-title'}"
44

@@ -32,7 +32,7 @@
3232
</BoxContainer>
3333
<!--Sprite View-->
3434
<PanelContainer Margin="12 0 0 0"
35-
StyleClasses="Inset"
35+
StyleClasses="BackgroundPanelDark"
3636
VerticalAlignment="Center">
3737
<SpriteView Name="EntityView"
3838
SetSize="96 96"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Runtime.CompilerServices;
2+
using Content.Shared.Atmos;
3+
4+
namespace Content.Client.Atmos.EntitySystems;
5+
6+
public sealed partial class AtmosphereSystem
7+
{
8+
/*
9+
Partial class for operations involving GasMixtures.
10+
11+
Any method that is overridden here is usually because the server-sided implementation contains
12+
code that would escape sandbox. As such these methods are overridden here with a safe
13+
implementation.
14+
*/
15+
16+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
17+
protected override float GetHeatCapacityCalculation(float[] moles, bool space)
18+
{
19+
// Little hack to make space gas mixtures have heat capacity, therefore allowing them to cool down rooms.
20+
if (space && MathHelper.CloseTo(NumericsHelpers.HorizontalAdd(moles), 0f))
21+
{
22+
return Atmospherics.SpaceHeatCapacity;
23+
}
24+
25+
// explicit stackalloc call is banned on client tragically.
26+
// the JIT does not stackalloc this during runtime,
27+
// though this isnt the hottest code path so it should be fine
28+
// the gc can eat a little as a treat
29+
var tmp = new float[moles.Length];
30+
NumericsHelpers.Multiply(moles, GasSpecificHeats, tmp);
31+
// Adjust heat capacity by speedup, because this is primarily what
32+
// determines how quickly gases heat up/cool.
33+
return MathF.Max(NumericsHelpers.HorizontalAdd(tmp), Atmospherics.MinimumHeatCapacity);
34+
}
35+
}

Content.Client/Atmos/EntitySystems/AtmosphereSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Content.Client.Atmos.EntitySystems;
77

8-
public sealed class AtmosphereSystem : SharedAtmosphereSystem
8+
public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
99
{
1010
public override void Initialize()
1111
{

Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- Status (pressure, temperature, alarm state, device total, address, etc) -->
88
<BoxContainer Orientation="Horizontal" Margin="0 0 0 2">
99
<!-- Left column (view of entity) -->
10-
<PanelContainer Margin="2 0 6 0" StyleClasses="Inset" VerticalAlignment="Center" VerticalExpand="True">
10+
<PanelContainer Margin="2 0 6 0" StyleClasses="BackgroundPanelDark" VerticalAlignment="Center" VerticalExpand="True">
1111
<SpriteView Name="EntityView" OverrideDirection="South" Scale="2 2" SetSize="64 64"/>
1212
</PanelContainer>
1313
<!-- Center column (pressure, temperature, alarm state) -->

Content.Client/BarSign/BarSignSystem.cs

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Content.Shared.BarSign;
2+
using Content.Shared.Power;
3+
using Robust.Client.GameObjects;
4+
using Robust.Shared.Prototypes;
5+
6+
namespace Content.Client.BarSign;
7+
8+
public sealed class BarSignVisualizerSystem : VisualizerSystem<BarSignComponent>
9+
{
10+
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
11+
12+
protected override void OnAppearanceChange(EntityUid uid, BarSignComponent component, ref AppearanceChangeEvent args)
13+
{
14+
AppearanceSystem.TryGetData<bool>(uid, PowerDeviceVisuals.Powered, out var powered, args.Component);
15+
AppearanceSystem.TryGetData<string>(uid, BarSignVisuals.BarSignPrototype, out var currentSign, args.Component);
16+
17+
if (powered
18+
&& currentSign != null
19+
&& _prototypeManager.Resolve<BarSignPrototype>(currentSign, out var proto))
20+
{
21+
SpriteSystem.LayerSetSprite((uid, args.Sprite), 0, proto.Icon);
22+
args.Sprite?.LayerSetShader(0, "unshaded");
23+
}
24+
else
25+
{
26+
SpriteSystem.LayerSetRsiState((uid, args.Sprite), 0, "empty");
27+
args.Sprite?.LayerSetShader(0, null, null);
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)