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

Commit

Permalink
Merge pull request #35 from Corvax-Frontier/Patch
Browse files Browse the repository at this point in the history
Админы теперь следят за вами
  • Loading branch information
Zekins3366 authored Apr 18, 2024
2 parents 6a0175d + 4b83905 commit 2451d6f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
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
{
}

0 comments on commit 2451d6f

Please sign in to comment.