Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Админы теперь следят за вами #35

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label HorizontalExpand="True" SizeFlagsStretchRatio="0.50"
Text="{Loc Object type:}" />
<Label Name="ShuttlesCount" HorizontalExpand="True" SizeFlagsStretchRatio="0.15"
Text="{Loc Shuttles Count}" />
<Label Name="DebrisCount" HorizontalExpand="True" SizeFlagsStretchRatio="0.15"
Text="{Loc Debris Count}" />
<Label Name="ExpeditionCount" HorizontalExpand="True" SizeFlagsStretchRatio="0.15"
Text="{Loc Expedition Count}" />
<OptionButton Name="ObjectTypeOptions" HorizontalExpand="True" SizeFlagsStretchRatio="0.25"/>
</BoxContainer>
<cc:HSeparator/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Content.Client.Salvage;
using Content.Client.Station;
using Content.Server.Worldgen.Components.Debris;
using Content.Shared.Shipyard.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
Expand Down Expand Up @@ -95,6 +98,33 @@ private void RefreshObjectList(ObjectsTabSelection selection)
ObjectList.AddChild(ctrl);
ctrl.OnKeyBindDown += args => OnEntryKeyBindDown?.Invoke(ctrl, args);
}

var shuttlesCount = 0;
var shuttlesQuery = _entityManager.AllEntityQueryEnumerator<ShuttleDeedComponent, MapGridComponent>();
while (shuttlesQuery.MoveNext(out var uid, out _, out _))
{
shuttlesCount++;
}

ShuttlesCount.Text = $"Шаттлы: {shuttlesCount}";

var debrisCount = 0;
var debrisQuery = _entityManager.AllEntityQueryEnumerator<SpaceDebrisComponent, MetaDataComponent>();
while (debrisQuery.MoveNext(out var uid, out _, out _))
{
debrisCount++;
}

DebrisCount.Text = $"Обломки: {debrisCount}";

var expeditionCount = 0;
var expeditionQuery = _entityManager.AllEntityQueryEnumerator<SalvageExpeditionComponent, MetaDataComponent>();
while (expeditionQuery.MoveNext(out var uid, out _, out _))
{
expeditionCount++;
}

ExpeditionCount.Text = $"Экспедиции: {expeditionCount}";
}

protected override void FrameUpdate(FrameEventArgs args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ private void OnChunkLoaded(EntityUid uid, DebrisFeaturePlacerControllerComponent
var owned = EnsureComp<OwnedDebrisComponent>(ent);
owned.OwningController = uid;
owned.LastKey = point;
EnsureComp<SpaceDebrisComponent>(ent);
}

if (failures > 0)
Expand Down
8 changes: 8 additions & 0 deletions Content.Shared/SpaceDebrisComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Robust.Shared.GameStates;

namespace Content.Server.Worldgen.Components.Debris;

[RegisterComponent, NetworkedComponent]
public sealed partial class SpaceDebrisComponent : Component
{
}
Loading