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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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>))]
|
||||
|
||||
@@ -2,7 +2,7 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Spawners.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, EntityCategory("Spawner")]
|
||||
[Virtual]
|
||||
public partial class ConditionalSpawnerComponent : Component
|
||||
{
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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")]
|
||||
|
||||
1
Resources/Locale/en-US/entity-categories.ftl
Normal file
1
Resources/Locale/en-US/entity-categories.ftl
Normal file
@@ -0,0 +1 @@
|
||||
entity-category-name-actions = Actions
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
- type: entity
|
||||
id: AlertSpriteView
|
||||
categories: [ hideSpawnMenu ]
|
||||
categories: [ HideSpawnMenu ]
|
||||
components:
|
||||
- type: Sprite
|
||||
layers:
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
- type: entity
|
||||
id: AlertEssenceSpriteView
|
||||
categories: [ hideSpawnMenu ]
|
||||
categories: [ HideSpawnMenu ]
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: /Textures/Interface/Alerts/essence_counter.rsi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
name: base flatpack
|
||||
description: A flatpack used for constructing something.
|
||||
categories:
|
||||
- hideSpawnMenu
|
||||
- HideSpawnMenu
|
||||
components:
|
||||
- type: Item
|
||||
size: Large
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
- type: entity
|
||||
id: FlatpackerNoBoardEffect
|
||||
categories:
|
||||
- hideSpawnMenu
|
||||
- HideSpawnMenu
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Structures/Machines/autolathe.rsi
|
||||
|
||||
4
Resources/Prototypes/Entities/categories.yml
Normal file
4
Resources/Prototypes/Entities/categories.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- type: entityCategory
|
||||
id: Actions
|
||||
name: entity-category-name-actions
|
||||
hideSpawnMenu: true
|
||||
Reference in New Issue
Block a user