-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #878 from DebugOk/25394
Early merge
- Loading branch information
Showing
112 changed files
with
1,688 additions
and
790 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" | ||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4=" | ||
fi | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
<DefaultWindow xmlns="https://spacestation14.io"> | ||
<controls:FancyWindow | ||
xmlns="https://spacestation14.io" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:style="clr-namespace:Content.Client.Stylesheets"> | ||
<BoxContainer Orientation="Vertical"> | ||
<LineEdit Name="SearchBar" PlaceHolder="{Loc 'vending-machine-component-search-filter'}" HorizontalExpand="True" Margin ="0 4" Access="Public"/> | ||
<LineEdit Name="SearchBar" PlaceHolder="{Loc 'vending-machine-component-search-filter'}" HorizontalExpand="True" Margin ="4 4" Access="Public"/> | ||
<ItemList Name="VendingContents" | ||
SizeFlagsStretchRatio="8" | ||
VerticalExpand="True" | ||
SelectMode="Button"> | ||
ItemSeparation="2" | ||
Margin="4 0" | ||
SelectMode="Button" | ||
StyleClasses="transparentBackgroundItemList"> | ||
</ItemList> | ||
<!-- Footer --> | ||
<BoxContainer Orientation="Vertical"> | ||
<PanelContainer StyleClasses="LowDivider" /> | ||
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom"> | ||
<Label Text="{Loc 'vending-machine-flavor-left'}" StyleClasses="WindowFooterText" /> | ||
<Label Text="{Loc 'vending-machine-flavor-right'}" StyleClasses="WindowFooterText" | ||
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" /> | ||
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered" | ||
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</DefaultWindow> | ||
</controls:FancyWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Content.IntegrationTests/Tests/Actions/ActionPvsDetachTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System.Linq; | ||
using Content.Shared.Actions; | ||
using Content.Shared.Eye; | ||
using Robust.Server.GameObjects; | ||
using Robust.Shared.GameObjects; | ||
|
||
namespace Content.IntegrationTests.Tests.Actions; | ||
|
||
[TestFixture] | ||
public sealed class ActionPvsDetachTest | ||
{ | ||
[Test] | ||
public async Task TestActionDetach() | ||
{ | ||
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true }); | ||
var (server, client) = pair; | ||
var sys = server.System<SharedActionsSystem>(); | ||
var cSys = client.System<SharedActionsSystem>(); | ||
|
||
// Spawn mob that has some actions | ||
EntityUid ent = default; | ||
var map = await pair.CreateTestMap(); | ||
await server.WaitPost(() => ent = server.EntMan.SpawnAtPosition("MobHuman", map.GridCoords)); | ||
await pair.RunTicksSync(5); | ||
var cEnt = pair.ToClientUid(ent); | ||
|
||
// Verify that both the client & server agree on the number of actions | ||
var initActions = sys.GetActions(ent).Count(); | ||
Assert.That(initActions, Is.GreaterThan(0)); | ||
Assert.That(initActions, Is.EqualTo(cSys.GetActions(cEnt).Count())); | ||
|
||
// PVS-detach action entities | ||
// We do this by just giving them the ghost layer | ||
var visSys = server.System<VisibilitySystem>(); | ||
var enumerator = server.Transform(ent).ChildEnumerator; | ||
while (enumerator.MoveNext(out var child)) | ||
{ | ||
visSys.AddLayer(child, (int) VisibilityFlags.Ghost); | ||
} | ||
await pair.RunTicksSync(5); | ||
|
||
// Client's actions have left been detached / are out of view, but action comp state has not changed | ||
Assert.That(sys.GetActions(ent).Count(), Is.EqualTo(initActions)); | ||
Assert.That(cSys.GetActions(cEnt).Count(), Is.EqualTo(initActions)); | ||
|
||
// Re-enter PVS view | ||
enumerator = server.Transform(ent).ChildEnumerator; | ||
while (enumerator.MoveNext(out var child)) | ||
{ | ||
visSys.RemoveLayer(child, (int) VisibilityFlags.Ghost); | ||
} | ||
await pair.RunTicksSync(5); | ||
Assert.That(sys.GetActions(ent).Count(), Is.EqualTo(initActions)); | ||
Assert.That(cSys.GetActions(cEnt).Count(), Is.EqualTo(initActions)); | ||
|
||
await server.WaitPost(() => server.EntMan.DeleteEntity(map.MapUid)); | ||
await pair.CleanReturnAsync(); | ||
} | ||
} |
Oops, something went wrong.