Adds even more smites and a bunch of tools. (#9825)
* Adds three new smites, headstand, locker stuff, and reptilian species swap. * Localize all the smites. * save work * More smites... * Final tweaks. * oops * !PLEH * Adds disarm prone and improved hand removal options. * fix chances. * take out the trash. * Add some admin TRICKS instead of more smites. * oop * Implements the admin test arena and associated trick. * Tricks for granting/revoking access. * e * mfw * Implement quick dialogs, for when you don't want to spend 20 minutes writing a simple dialog prompt. * Forgot the rejuv icon. * E * docs * augh * Add rename/redescribe buttons. * Adds objects menu, implements a couple tricks for stations. * 1984 * Adds a trick for effectively infinite power. * fixes some icon uggo. * a * HALT! * Pause/unpause buttons. * Forgor the textures. * they broke every bone in their body. * i added more * more battery actions, touch up battery icon. * Address reviews.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<Control xmlns="https://spacestation14.io"
|
||||
xmlns:pt="clr-namespace:Content.Client.Administration.UI.Tabs.PlayerTab"
|
||||
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:}" />
|
||||
<OptionButton Name="ObjectTypeOptions" HorizontalExpand="True" SizeFlagsStretchRatio="0.25"/>
|
||||
</BoxContainer>
|
||||
<cc:HSeparator/>
|
||||
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
|
||||
<BoxContainer Orientation="Vertical" Name="ObjectList">
|
||||
</BoxContainer>
|
||||
</ScrollContainer>
|
||||
</BoxContainer>
|
||||
</Control>
|
||||
@@ -0,0 +1,73 @@
|
||||
using System.Linq;
|
||||
using Content.Client.Station;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.Administration.UI.Tabs.ObjectsTab;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ObjectsTab : Control
|
||||
{
|
||||
[Dependency] private readonly EntityManager _entityManager = default!;
|
||||
|
||||
private readonly List<ObjectsTabEntry> _objects = new();
|
||||
private List<ObjectsTabSelection> _selections = new();
|
||||
|
||||
public event Action<BaseButton.ButtonEventArgs>? OnEntryPressed;
|
||||
|
||||
public ObjectsTab()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
ObjectTypeOptions.OnItemSelected += ev =>
|
||||
{
|
||||
ObjectTypeOptions.SelectId(ev.Id);
|
||||
RefreshObjectList(_selections[ev.Id]);
|
||||
};
|
||||
|
||||
foreach (var type in Enum.GetValues(typeof(ObjectsTabSelection)))
|
||||
{
|
||||
_selections.Add((ObjectsTabSelection)type!);
|
||||
ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type!)!);
|
||||
}
|
||||
|
||||
RefreshObjectList(_selections[ObjectTypeOptions.SelectedId]);
|
||||
}
|
||||
|
||||
private void RefreshObjectList(ObjectsTabSelection selection)
|
||||
{
|
||||
var entities = selection switch
|
||||
{
|
||||
ObjectsTabSelection.Stations => _entityManager.EntitySysManager.GetEntitySystem<StationSystem>().Stations.ToList(),
|
||||
ObjectsTabSelection.Grids => _entityManager.EntityQuery<IMapGridComponent>(true).Select(x => x.Owner).ToList(),
|
||||
ObjectsTabSelection.Maps => _entityManager.EntityQuery<IMapComponent>(true).Select(x => x.Owner).ToList(),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null)
|
||||
};
|
||||
|
||||
foreach (var control in _objects)
|
||||
{
|
||||
ObjectList.RemoveChild(control);
|
||||
}
|
||||
|
||||
_objects.Clear();
|
||||
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
var ctrl = new ObjectsTabEntry(_entityManager.GetComponent<MetaDataComponent>(entity).EntityName, entity);
|
||||
_objects.Add(ctrl);
|
||||
ObjectList.AddChild(ctrl);
|
||||
ctrl.OnPressed += args => OnEntryPressed?.Invoke(args);
|
||||
}
|
||||
}
|
||||
|
||||
private enum ObjectsTabSelection
|
||||
{
|
||||
Grids,
|
||||
Maps,
|
||||
Stations,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<ContainerButton xmlns="https://spacestation14.io"
|
||||
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
|
||||
EnableAllKeybinds="True">
|
||||
<PanelContainer Name="BackgroundColorPanel"/>
|
||||
<BoxContainer Orientation="Horizontal"
|
||||
HorizontalExpand="True"
|
||||
SeparationOverride="4">
|
||||
<Label Name="NameLabel"
|
||||
SizeFlagsStretchRatio="3"
|
||||
HorizontalExpand="True"
|
||||
ClipText="True"/>
|
||||
<customControls:VSeparator/>
|
||||
<Label Name="EIDLabel"
|
||||
SizeFlagsStretchRatio="3"
|
||||
HorizontalExpand="True"
|
||||
ClipText="True"/>
|
||||
</BoxContainer>
|
||||
</ContainerButton>
|
||||
@@ -0,0 +1,19 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.Administration.UI.Tabs.ObjectsTab;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ObjectsTabEntry : ContainerButton
|
||||
{
|
||||
public EntityUid AssocEntity;
|
||||
|
||||
public ObjectsTabEntry(string name, EntityUid euid)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
AssocEntity = euid;
|
||||
EIDLabel.Text = euid.ToString();
|
||||
NameLabel.Text = name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user