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))]
|
[TestOf(typeof(EntityUid))]
|
||||||
public sealed class EntityTest
|
public sealed class EntityTest
|
||||||
{
|
{
|
||||||
|
private static readonly ProtoId<EntityCategoryPrototype> SpawnerCategory = "Spawner";
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public async Task SpawnAndDeleteAllEntitiesOnDifferentMaps()
|
public async Task SpawnAndDeleteAllEntitiesOnDifferentMaps()
|
||||||
{
|
{
|
||||||
@@ -234,14 +236,6 @@ namespace Content.IntegrationTests.Tests
|
|||||||
"StationEvent",
|
"StationEvent",
|
||||||
"TimedDespawn",
|
"TimedDespawn",
|
||||||
|
|
||||||
// Spawner entities
|
|
||||||
"DragonRift",
|
|
||||||
"RandomHumanoidSpawner",
|
|
||||||
"RandomSpawner",
|
|
||||||
"ConditionalSpawner",
|
|
||||||
"GhostRoleMobSpawner",
|
|
||||||
"NukeOperativeSpawner",
|
|
||||||
"TimedSpawner",
|
|
||||||
// makes an announcement on mapInit.
|
// makes an announcement on mapInit.
|
||||||
"AnnounceOnSpawn",
|
"AnnounceOnSpawn",
|
||||||
};
|
};
|
||||||
@@ -253,6 +247,7 @@ namespace Content.IntegrationTests.Tests
|
|||||||
.Where(p => !p.Abstract)
|
.Where(p => !p.Abstract)
|
||||||
.Where(p => !pair.IsTestPrototype(p))
|
.Where(p => !pair.IsTestPrototype(p))
|
||||||
.Where(p => !excluded.Any(p.Components.ContainsKey))
|
.Where(p => !excluded.Any(p.Components.ContainsKey))
|
||||||
|
.Where(p => p.Categories.All(x => x.ID != SpawnerCategory))
|
||||||
.Select(p => p.ID)
|
.Select(p => p.ID)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Server.GameTicking.Rules.Components;
|
namespace Content.Server.GameTicking.Rules.Components;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -5,6 +7,5 @@ namespace Content.Server.GameTicking.Rules.Components;
|
|||||||
/// and providing loadout + name for the operative on spawn.
|
/// and providing loadout + name for the operative on spawn.
|
||||||
/// TODO: Remove once systems can request spawns from the ghost role system directly.
|
/// TODO: Remove once systems can request spawns from the ghost role system directly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent, EntityCategory("Spawner")]
|
||||||
public sealed partial class NukeOperativeSpawnerComponent : Component;
|
public sealed partial class NukeOperativeSpawnerComponent : Component;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Content.Server.Ghost.Roles.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows a ghost to take this role, spawning a new entity.
|
/// Allows a ghost to take this role, spawning a new entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent, EntityCategory("Spawner")]
|
||||||
[Access(typeof(GhostRoleSystem))]
|
[Access(typeof(GhostRoleSystem))]
|
||||||
public sealed partial class GhostRoleMobSpawnerComponent : Component
|
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
|
/// This is added to a marker entity in order to spawn a randomized
|
||||||
/// humanoid ingame.
|
/// humanoid ingame.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent, EntityCategory("Spawner")]
|
||||||
public sealed partial class RandomHumanoidSpawnerComponent : Component
|
public sealed partial class RandomHumanoidSpawnerComponent : Component
|
||||||
{
|
{
|
||||||
[DataField("settings", customTypeSerializer: typeof(PrototypeIdSerializer<RandomHumanoidSettingsPrototype>))]
|
[DataField("settings", customTypeSerializer: typeof(PrototypeIdSerializer<RandomHumanoidSettingsPrototype>))]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Robust.Shared.Prototypes;
|
|||||||
|
|
||||||
namespace Content.Server.Spawners.Components
|
namespace Content.Server.Spawners.Components
|
||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent, EntityCategory("Spawner")]
|
||||||
[Virtual]
|
[Virtual]
|
||||||
public partial class ConditionalSpawnerComponent : Component
|
public partial class ConditionalSpawnerComponent : Component
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Robust.Shared.Prototypes;
|
|||||||
|
|
||||||
namespace Content.Server.Spawners.Components
|
namespace Content.Server.Spawners.Components
|
||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent, EntityCategory("Spawner")]
|
||||||
public sealed partial class RandomSpawnerComponent : ConditionalSpawnerComponent
|
public sealed partial class RandomSpawnerComponent : ConditionalSpawnerComponent
|
||||||
{
|
{
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Content.Server.Spawners.Components;
|
|||||||
/// Can configure the set of entities, spawn timing, spawn chance,
|
/// Can configure the set of entities, spawn timing, spawn chance,
|
||||||
/// and min/max number of entities to spawn.
|
/// and min/max number of entities to spawn.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent, EntityCategory("Spawner")]
|
||||||
public sealed partial class TimedSpawnerComponent : Component, ISerializationHooks
|
public sealed partial class TimedSpawnerComponent : Component, ISerializationHooks
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Shared.Actions;
|
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 ACTIONS convert to auto comp state?
|
||||||
|
|
||||||
// TODO add access attribute. Need to figure out what to do with decal & mapping actions.
|
// TODO add access attribute. Need to figure out what to do with decal & mapping actions.
|
||||||
// [Access(typeof(SharedActionsSystem))]
|
// [Access(typeof(SharedActionsSystem))]
|
||||||
|
[EntityCategory("Actions")]
|
||||||
public abstract partial class BaseActionComponent : Component
|
public abstract partial class BaseActionComponent : Component
|
||||||
{
|
{
|
||||||
public abstract BaseActionEvent? BaseEvent { get; }
|
public abstract BaseActionEvent? BaseEvent { get; }
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public sealed class BodyPrototypeSerializer : ITypeReader<BodyPrototype, Mapping
|
|||||||
|
|
||||||
foreach (var (slotId, (part, connections, organs)) in allConnections)
|
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);
|
slots.Add(slotId, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.Dragon;
|
namespace Content.Shared.Dragon;
|
||||||
|
|
||||||
[NetworkedComponent]
|
[NetworkedComponent, EntityCategory("Spawner")]
|
||||||
public abstract partial class SharedDragonRiftComponent : Component
|
public abstract partial class SharedDragonRiftComponent : Component
|
||||||
{
|
{
|
||||||
[DataField("state")]
|
[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
|
- type: entity
|
||||||
id: AlertSpriteView
|
id: AlertSpriteView
|
||||||
categories: [ hideSpawnMenu ]
|
categories: [ HideSpawnMenu ]
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
layers:
|
layers:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: AlertEssenceSpriteView
|
id: AlertEssenceSpriteView
|
||||||
categories: [ hideSpawnMenu ]
|
categories: [ HideSpawnMenu ]
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: /Textures/Interface/Alerts/essence_counter.rsi
|
sprite: /Textures/Interface/Alerts/essence_counter.rsi
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
name: base flatpack
|
name: base flatpack
|
||||||
description: A flatpack used for constructing something.
|
description: A flatpack used for constructing something.
|
||||||
categories:
|
categories:
|
||||||
- hideSpawnMenu
|
- HideSpawnMenu
|
||||||
components:
|
components:
|
||||||
- type: Item
|
- type: Item
|
||||||
size: Large
|
size: Large
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
id: FlatpackerNoBoardEffect
|
id: FlatpackerNoBoardEffect
|
||||||
categories:
|
categories:
|
||||||
- hideSpawnMenu
|
- HideSpawnMenu
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Structures/Machines/autolathe.rsi
|
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