Merge remote-tracking branch 'upstream/master' into upstream-sync

This commit is contained in:
Morb0 2023-08-07 02:36:25 +03:00
commit 3271fe050a
3 changed files with 46 additions and 4 deletions

View file

@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Numerics;
using Content.Client.ContextMenu.UI;
using Content.Client.Examine;
@ -155,7 +156,7 @@ public sealed partial class GuideEntityEmbed : BoxContainer, IDocumentTag
if (args.TryGetValue("Scale", out var scaleStr))
{
var scale = float.Parse(scaleStr);
var scale = float.Parse(scaleStr, CultureInfo.InvariantCulture);
Scale = new Vector2(scale, scale);
}
else

View file

@ -1,3 +1,11 @@
using Content.Client.IoC;
using Content.Client.Parallax.Managers;
using Robust.Client;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.UnitTesting;
namespace Content.IntegrationTests.Tests.Utility;
@ -6,9 +14,41 @@ public sealed class SandboxTest
[Test]
public async Task Test()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings { Destructive = true });
var client = pairTracker.Pair.Client;
// Not using PoolManager.GetServerClient() because we want to avoid having to unnecessarily create & destroy a
// server. This all becomes unnecessary if ever the test becomes non-destructive or the no-server option
// actually creates a pair without a server.
var logHandler = new PoolTestLogHandler("CLIENT");
logHandler.ActivateContext(TestContext.Out);
var options = new RobustIntegrationTest.ClientIntegrationOptions
{
ContentStart = true,
OverrideLogHandler = () => logHandler,
ContentAssemblies = new[]
{
typeof(Shared.Entry.EntryPoint).Assembly,
typeof(Client.Entry.EntryPoint).Assembly
},
Options = new GameControllerOptions { LoadConfigAndUserData = false }
};
options.BeforeStart += () =>
{
IoCManager.Resolve<IModLoader>().SetModuleBaseCallbacks(new ClientModuleTestingCallbacks
{
ClientBeforeIoC = () =>
{
IoCManager.Register<IParallaxManager, DummyParallaxManager>(true);
IoCManager.Resolve<ILogManager>().GetSawmill("loc").Level = LogLevel.Error;
IoCManager.Resolve<IConfigurationManager>()
.OnValueChanged(RTCVars.FailureLogLevel, value => logHandler.FailureLevel = value, true);
}
});
};
using var client = new RobustIntegrationTest.ClientIntegrationInstance(options);
await client.WaitIdleAsync();
await client.CheckSandboxed(typeof(Client.Entry.EntryPoint).Assembly);
await pairTracker.CleanReturnAsync();
await client.CheckSandboxed(typeof(Shared.IoC.SharedContentIoC).Assembly);
}
}

View file

@ -475,6 +475,7 @@
types:
Blunt: 14
- type: Item
size: 90
sprite: Objects/Tools/shovel.rsi
- type: PhysicalComposition
materialComposition: