Skip to content

Commit

Permalink
Merge branch 'master' into corvax
Browse files Browse the repository at this point in the history
# Conflicts:
#	Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
#	Resources/Textures/Effects/speech.rsi/meta.json
  • Loading branch information
DEATHB4DEFEAT committed Aug 25, 2023
2 parents b5498b3 + 1ab6db8 commit 2cd00c9
Show file tree
Hide file tree
Showing 2,791 changed files with 52,067 additions and 52,130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
shell: pwsh
run: |
$env:DOTNET_gcServer=1
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
ci-success:
name: Build & Test Debug
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
shell: pwsh
run: |
$env:DOTNET_gcServer=1
dotnet test --configuration Tools --no-build Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0
dotnet test --configuration Tools --no-build Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
ci-success:
name: Build & Test Release
needs:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
environment: "publish"

steps:
- name: Install dependencies
run: sudo apt-get install -y python3-paramiko

- uses: actions/checkout@v2
with:
submodules: 'recursive'
Expand Down Expand Up @@ -60,8 +63,13 @@ jobs:
port: ${{ secrets.PUBLISH_PORT }}
script: /home/${{ secrets.PUBLISH_PUSH_USER }}/push.s1 ${{ github.sha }}

- name: Publish changelog
- name: Publish changelog (Discord)
run: Tools/actions_changelogs_since_last_run.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}

- name: Publish changelog (RSS)
run: Tools/actions_changelog_rss.py
env:
CHANGELOG_RSS_KEY: ${{ secrets.CHANGELOG_RSS_KEY }}
18 changes: 13 additions & 5 deletions Content.Benchmarks/DeviceNetworkingBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public class DeviceNetworkingBenchmark


private NetworkPayload _payload = default!;

[TestPrototypes]
private const string Prototypes = @"
- type: entity
name: DummyNetworkDevice
id: DummyNetworkDevice
name: DummyNetworkDevicePrivate
id: DummyNetworkDevicePrivate
components:
- type: DeviceNetwork
transmitFrequency: 100
Expand All @@ -56,7 +58,7 @@ public class DeviceNetworkingBenchmark
public async Task SetupAsync()
{
ProgramShared.PathOffset = "../../../../";
_pair = await PoolManager.GetServerClient(new PoolSettings { NoClient = true, ExtraPrototypes = Prototypes });
_pair = await PoolManager.GetServerClient();
var server = _pair.Pair.Server;

await server.WaitPost(() =>
Expand All @@ -73,17 +75,23 @@ await server.WaitPost(() =>
["testbool"] = true
};
_sourceEntity = entityManager.SpawnEntity("DummyNetworkDevice", MapCoordinates.Nullspace);
_sourceEntity = entityManager.SpawnEntity("DummyNetworkDevicePrivate", MapCoordinates.Nullspace);
_sourceWirelessEntity = entityManager.SpawnEntity("DummyWirelessNetworkDevice", MapCoordinates.Nullspace);
for (var i = 0; i < EntityCount; i++)
{
_targetEntities.Add(entityManager.SpawnEntity("DummyNetworkDevice", MapCoordinates.Nullspace));
_targetEntities.Add(entityManager.SpawnEntity("DummyNetworkDevicePrivate", MapCoordinates.Nullspace));
_targetWirelessEntities.Add(entityManager.SpawnEntity("DummyWirelessNetworkDevice", MapCoordinates.Nullspace));
}
});
}

[GlobalCleanup]
public async Task Cleanup()
{
await _pair.DisposeAsync();
}

[Benchmark(Baseline = true, Description = "Entity Events")]
public async Task EventSentBaseline()
{
Expand Down
3 changes: 3 additions & 0 deletions Content.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static void Main(string[] args)

public static async Task MainAsync(string[] args)
{
PoolManager.Startup(typeof(Program).Assembly);
var pair = await PoolManager.GetServerClient();
var gameMaps = pair.Pair.Server.ResolveDependency<IPrototypeManager>().EnumeratePrototypes<GameMapPrototype>().ToList();
MapLoadBenchmark.MapsSource = gameMaps.Select(x => x.ID);
Expand All @@ -33,6 +34,8 @@ public static async Task MainAsync(string[] args)
var config = Environment.GetEnvironmentVariable("ROBUST_BENCHMARKS_ENABLE_SQL") != null ? DefaultSQLConfig.Instance : null;
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
#endif

PoolManager.Shutdown();
}
}
}
6 changes: 4 additions & 2 deletions Content.Client/Access/AccessOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ public sealed class AccessOverlay : Overlay
{
private readonly IEntityManager _entityManager;
private readonly EntityLookupSystem _lookup;
private readonly SharedTransformSystem _xform;
private readonly Font _font;

public override OverlaySpace Space => OverlaySpace.ScreenSpace;

public AccessOverlay(IEntityManager entManager, IResourceCache cache, EntityLookupSystem lookup)
public AccessOverlay(IEntityManager entManager, IResourceCache cache, EntityLookupSystem lookup, SharedTransformSystem xform)
{
_entityManager = entManager;
_lookup = lookup;
_xform = xform;

_font = cache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 12);
}
Expand Down Expand Up @@ -71,7 +73,7 @@ protected override void Draw(in OverlayDrawArgs args)
textStr = "";
}

var screenPos = args.ViewportControl.WorldToScreen(xform.WorldPosition);
var screenPos = args.ViewportControl.WorldToScreen(_xform.GetWorldPosition(xform));

args.ScreenHandle.DrawString(_font, screenPos, textStr, Color.Gold);
}
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/Access/AccessSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

namespace Content.Client.Access;

public sealed class AccessSystem : SharedAccessSystem {}
public sealed class AccessSystem : SharedAccessSystem
{
}
8 changes: 5 additions & 3 deletions Content.Client/Access/Commands/ShowAccessReadersCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var collection = IoCManager.Instance;

if (collection == null) return;
if (collection == null)
return;

var overlay = collection.Resolve<IOverlayManager>();

Expand All @@ -25,9 +26,10 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)

var entManager = collection.Resolve<IEntityManager>();
var cache = collection.Resolve<IResourceCache>();
var system = entManager.EntitySysManager.GetEntitySystem<EntityLookupSystem>();
var lookup = entManager.System<EntityLookupSystem>();
var xform = entManager.System<SharedTransformSystem>();

overlay.AddOverlay(new AccessOverlay(entManager, cache, system));
overlay.AddOverlay(new AccessOverlay(entManager, cache, lookup, xform));
shell.WriteLine($"Set access reader debug overlay to true");
}
}
5 changes: 3 additions & 2 deletions Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ protected override void UpdateState(BoundUserInterfaceState state)
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing) return;
if (!disposing)
return;

_window?.Dispose();
}
}

}
4 changes: 3 additions & 1 deletion Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ protected override void Open()
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing) return;
if (!disposing)
return;

_window?.Dispose();
}

Expand Down
10 changes: 7 additions & 3 deletions Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace Content.Client.Access.UI
public sealed partial class IdCardConsoleWindow : DefaultWindow
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private readonly ISawmill _logMill = default!;

private readonly IdCardConsoleBoundUserInterface _owner;

Expand All @@ -30,6 +32,7 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_logMill = _logManager.GetSawmill(SharedIdCardConsoleSystem.Sawmill);

_owner = owner;

Expand Down Expand Up @@ -67,7 +70,7 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana
{
if (!prototypeManager.TryIndex<AccessLevelPrototype>(access, out var accessLevel))
{
Logger.ErrorS(SharedIdCardConsoleSystem.Sawmill, $"Unable to find accesslevel for {access}");
_logMill.Error($"Unable to find accesslevel for {access}");
continue;
}

Expand Down Expand Up @@ -116,7 +119,7 @@ private void SelectJobPreset(OptionButton.ItemSelectedEventArgs args)
// this is a sussy way to do this
foreach (var access in job.Access)
{
if (_accessButtons.TryGetValue(access, out var button))
if (_accessButtons.TryGetValue(access, out var button) && !button.Disabled)
{
button.Pressed = true;
}
Expand All @@ -131,7 +134,7 @@ private void SelectJobPreset(OptionButton.ItemSelectedEventArgs args)

foreach (var access in groupPrototype.Tags)
{
if (_accessButtons.TryGetValue(access, out var button))
if (_accessButtons.TryGetValue(access, out var button) && !button.Disabled)
{
button.Pressed = true;
}
Expand Down Expand Up @@ -187,6 +190,7 @@ public void UpdateState(IdCardConsoleBoundUserInterfaceState state)
if (interfaceEnabled)
{
button.Pressed = state.TargetIdAccessList?.Contains(accessName) ?? false;
button.Disabled = (!state.AllowedModifyAccessList?.Contains(accessName)) ?? true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Administration/UI/BanPanel/BanPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<LineEdit Name="PlayerNameLine" MinWidth="100" HorizontalExpand="True" PlaceHolder="{Loc ban-panel-player}" />
</BoxContainer>
<BoxContainer Orientation="Horizontal" Margin="2">
<CheckBox Name="IpCheckbox" MinWidth="100" Text="{Loc ban-panel-ip}" Pressed="False" />
<CheckBox Name="IpCheckbox" MinWidth="100" Text="{Loc ban-panel-ip}" Pressed="True" />
<Control MinWidth="50" />
<LineEdit Name="IpLine" MinWidth="100" HorizontalExpand="True" PlaceHolder="{Loc ban-panel-ip}" ToolTip="{Loc ban-panel-ip-hwid-tooltip}" Editable="False" />
</BoxContainer>
Expand Down
51 changes: 0 additions & 51 deletions Content.Client/Animations/AnimationsTestComponent.cs

This file was deleted.

6 changes: 6 additions & 0 deletions Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ protected override void Open()
_window.AtmosDeviceDataChanged += OnDeviceDataChanged;
_window.AtmosAlarmThresholdChanged += OnThresholdChanged;
_window.AirAlarmModeChanged += OnAirAlarmModeChanged;
_window.AutoModeChanged += OnAutoModeChanged;
_window.ResyncAllRequested += ResyncAllDevices;
_window.AirAlarmTabChange += OnTabChanged;
}
Expand All @@ -52,6 +53,11 @@ private void OnAirAlarmModeChanged(AirAlarmMode mode)
SendMessage(new AirAlarmUpdateAlarmModeMessage(mode));
}

private void OnAutoModeChanged(bool enabled)
{
SendMessage(new AirAlarmUpdateAutoModeMessage(enabled));
}

private void OnThresholdChanged(string address, AtmosMonitorThresholdType type, AtmosAlarmThreshold threshold, Gas? gas = null)
{
SendMessage(new AirAlarmUpdateAlarmThresholdMessage(address, type, threshold, gas));
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'air-alarm-ui-window-mode-label'}" Margin="0 0 2 0" />
<OptionButton Name="CModeButton" HorizontalExpand="True" />
<CheckBox Name="AutoModeCheckBox" Text="{Loc 'air-alarm-ui-window-auto-mode-label'}" />
</BoxContainer>
</BoxContainer>
</ui:FancyWindow>
14 changes: 14 additions & 0 deletions Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public sealed partial class AirAlarmWindow : FancyWindow
public event Action<string, IAtmosDeviceData>? AtmosDeviceDataChanged;
public event Action<string, AtmosMonitorThresholdType, AtmosAlarmThreshold, Gas?>? AtmosAlarmThresholdChanged;
public event Action<AirAlarmMode>? AirAlarmModeChanged;
public event Action<bool>? AutoModeChanged;
public event Action<string>? ResyncDeviceRequested;
public event Action? ResyncAllRequested;
public event Action<AirAlarmTab>? AirAlarmTabChange;
Expand All @@ -44,6 +45,8 @@ public sealed partial class AirAlarmWindow : FancyWindow

private OptionButton _modes => CModeButton;

private CheckBox _autoMode => AutoModeCheckBox;

public AirAlarmWindow(BoundUserInterface owner)
{
RobustXamlLoader.Load(this);
Expand All @@ -68,6 +71,11 @@ public AirAlarmWindow(BoundUserInterface owner)
AirAlarmModeChanged!.Invoke((AirAlarmMode) args.Id);
};

_autoMode.OnToggled += args =>
{
AutoModeChanged!.Invoke(_autoMode.Pressed);
};

_tabContainer.SetTabTitle(0, Loc.GetString("air-alarm-ui-window-tab-vents"));
_tabContainer.SetTabTitle(1, Loc.GetString("air-alarm-ui-window-tab-scrubbers"));
_tabContainer.SetTabTitle(2, Loc.GetString("air-alarm-ui-window-tab-sensors"));
Expand Down Expand Up @@ -101,6 +109,7 @@ public void UpdateState(AirAlarmUIState state)
("color", ColorForAlarm(state.AlarmType)),
("state", $"{state.AlarmType}")));
UpdateModeSelector(state.Mode);
UpdateAutoMode(state.AutoMode);
foreach (var (addr, dev) in state.DeviceData)
{
UpdateDeviceData(addr, dev);
Expand All @@ -114,6 +123,11 @@ public void UpdateModeSelector(AirAlarmMode mode)
_modes.SelectId((int) mode);
}

public void UpdateAutoMode(bool enabled)
{
_autoMode.Pressed = enabled;
}

public void UpdateDeviceData(string addr, IAtmosDeviceData device)
{
switch (device)
Expand Down
Loading

0 comments on commit 2cd00c9

Please sign in to comment.