Content changes for entity categories PR (#27232)

* Content changes for entity categories PR

* Poke tests

* Why are tests suddenly working?
This commit is contained in:
Leon Friedrich
2024-06-02 16:08:15 +12:00
committed by GitHub
parent b44b159431
commit 6235fa1ac6
16 changed files with 26 additions and 22 deletions

View File

@@ -19,6 +19,8 @@ namespace Content.IntegrationTests.Tests
[TestOf(typeof(EntityUid))]
public sealed class EntityTest
{
private static readonly ProtoId<EntityCategoryPrototype> SpawnerCategory = "Spawner";
[Test]
public async Task SpawnAndDeleteAllEntitiesOnDifferentMaps()
{
@@ -234,14 +236,6 @@ namespace Content.IntegrationTests.Tests
"StationEvent",
"TimedDespawn",
// Spawner entities
"DragonRift",
"RandomHumanoidSpawner",
"RandomSpawner",
"ConditionalSpawner",
"GhostRoleMobSpawner",
"NukeOperativeSpawner",
"TimedSpawner",
// makes an announcement on mapInit.
"AnnounceOnSpawn",
};
@@ -253,6 +247,7 @@ namespace Content.IntegrationTests.Tests
.Where(p => !p.Abstract)
.Where(p => !pair.IsTestPrototype(p))
.Where(p => !excluded.Any(p.Components.ContainsKey))
.Where(p => p.Categories.All(x => x.ID != SpawnerCategory))
.Select(p => p.ID)
.ToList();

View File

@@ -1,3 +1,5 @@
using Robust.Shared.Prototypes;
namespace Content.Server.GameTicking.Rules.Components;
/// <summary>
@@ -5,6 +7,5 @@ namespace Content.Server.GameTicking.Rules.Components;
/// and providing loadout + name for the operative on spawn.
/// TODO: Remove once systems can request spawns from the ghost role system directly.
/// </summary>
[RegisterComponent]
[RegisterComponent, EntityCategory("Spawner")]
public sealed partial class NukeOperativeSpawnerComponent : Component;

View File

@@ -5,7 +5,7 @@ namespace Content.Server.Ghost.Roles.Components
/// <summary>
/// Allows a ghost to take this role, spawning a new entity.
/// </summary>
[RegisterComponent]
[RegisterComponent, EntityCategory("Spawner")]
[Access(typeof(GhostRoleSystem))]
public sealed partial class GhostRoleMobSpawnerComponent : Component
{

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Humanoid.Components;
/// This is added to a marker entity in order to spawn a randomized
/// humanoid ingame.
/// </summary>
[RegisterComponent]
[RegisterComponent, EntityCategory("Spawner")]
public sealed partial class RandomHumanoidSpawnerComponent : Component
{
[DataField("settings", customTypeSerializer: typeof(PrototypeIdSerializer<RandomHumanoidSettingsPrototype>))]

View File

@@ -2,7 +2,7 @@ using Robust.Shared.Prototypes;
namespace Content.Server.Spawners.Components
{
[RegisterComponent]
[RegisterComponent, EntityCategory("Spawner")]
[Virtual]
public partial class ConditionalSpawnerComponent : Component
{

View File

@@ -2,7 +2,7 @@ using Robust.Shared.Prototypes;
namespace Content.Server.Spawners.Components
{
[RegisterComponent]
[RegisterComponent, EntityCategory("Spawner")]
public sealed partial class RandomSpawnerComponent : ConditionalSpawnerComponent
{
[ViewVariables(VVAccess.ReadWrite)]

View File

@@ -9,7 +9,7 @@ namespace Content.Server.Spawners.Components;
/// Can configure the set of entities, spawn timing, spawn chance,
/// and min/max number of entities to spawn.
/// </summary>
[RegisterComponent]
[RegisterComponent, EntityCategory("Spawner")]
public sealed partial class TimedSpawnerComponent : Component, ISerializationHooks
{
/// <summary>

View File

@@ -1,14 +1,16 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Actions;
// TODO ACTIONS make this a seprate component and remove the inheritance stuff.
// TODO ACTIONS make this a separate component and remove the inheritance stuff.
// TODO ACTIONS convert to auto comp state?
// TODO add access attribute. Need to figure out what to do with decal & mapping actions.
// [Access(typeof(SharedActionsSystem))]
[EntityCategory("Actions")]
public abstract partial class BaseActionComponent : Component
{
public abstract BaseActionEvent? BaseEvent { get; }

View File

@@ -182,7 +182,7 @@ public sealed class BodyPrototypeSerializer : ITypeReader<BodyPrototype, Mapping
foreach (var (slotId, (part, connections, organs)) in allConnections)
{
var slot = new BodyPrototypeSlot(part != null ? new EntProtoId(part) : null!, connections ?? new HashSet<string>(), organs ?? new Dictionary<string, string>());
var slot = new BodyPrototypeSlot(part, connections ?? new HashSet<string>(), organs ?? new Dictionary<string, string>());
slots.Add(slotId, slot);
}

View File

@@ -1,9 +1,10 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Dragon;
[NetworkedComponent]
[NetworkedComponent, EntityCategory("Spawner")]
public abstract partial class SharedDragonRiftComponent : Component
{
[DataField("state")]

View File

@@ -0,0 +1 @@
entity-category-name-actions = Actions

View File

@@ -28,7 +28,7 @@
- type: entity
id: AlertSpriteView
categories: [ hideSpawnMenu ]
categories: [ HideSpawnMenu ]
components:
- type: Sprite
layers:

View File

@@ -16,7 +16,7 @@
- type: entity
id: AlertEssenceSpriteView
categories: [ hideSpawnMenu ]
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: /Textures/Interface/Alerts/essence_counter.rsi

View File

@@ -4,7 +4,7 @@
name: base flatpack
description: A flatpack used for constructing something.
categories:
- hideSpawnMenu
- HideSpawnMenu
components:
- type: Item
size: Large

View File

@@ -84,7 +84,7 @@
- type: entity
id: FlatpackerNoBoardEffect
categories:
- hideSpawnMenu
- HideSpawnMenu
components:
- type: Sprite
sprite: Structures/Machines/autolathe.rsi

View File

@@ -0,0 +1,4 @@
- type: entityCategory
id: Actions
name: entity-category-name-actions
hideSpawnMenu: true