]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
make objectives use entityCategory (#28269)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Mon, 3 Jun 2024 13:23:52 +0000 (13:23 +0000)
committerGitHub <noreply@github.com>
Mon, 3 Jun 2024 13:23:52 +0000 (09:23 -0400)
Content.Shared/Objectives/Components/ObjectiveComponent.cs
Resources/Locale/en-US/entity-categories.ftl
Resources/Prototypes/Entities/categories.yml
Resources/Prototypes/Objectives/base_objectives.yml
Resources/Prototypes/Objectives/dragon.yml
Resources/Prototypes/Objectives/ninja.yml
Resources/Prototypes/Objectives/thief.yml
Resources/Prototypes/Objectives/traitor.yml

index 95fbc6856116d2f9c56489adb6f6a3f849254a69..36d3fa0bded7e4ed1f7d2ce2402473b58b636263 100644 (file)
@@ -2,6 +2,7 @@ using Content.Shared.Mind;
 using Content.Shared.Objectives;
 using Content.Shared.Objectives.Systems;
 using Robust.Shared.Utility;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Objectives.Components;
 
@@ -9,32 +10,33 @@ namespace Content.Shared.Objectives.Components;
 /// Required component for an objective entity prototype.
 /// </summary>
 [RegisterComponent, Access(typeof(SharedObjectivesSystem))]
+[EntityCategory("Objectives")]
 public sealed partial class ObjectiveComponent : Component
 {
     /// <summary>
     /// Difficulty rating used to avoid assigning too many difficult objectives.
     /// </summary>
-    [DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
+    [DataField(required: true)]
     public float Difficulty;
 
     /// <summary>
     /// Organisation that issued this objective, used for grouping and as a header above common objectives.
     /// </summary>
-    [DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
+    [DataField(required: true)]
     public string Issuer = string.Empty;
 
     /// <summary>
     /// Unique objectives can only have 1 per prototype id.
     /// Set this to false if you want multiple objectives of the same prototype.
     /// </summary>
-    [DataField, ViewVariables(VVAccess.ReadWrite)]
+    [DataField]
     public bool Unique = true;
 
     /// <summary>
     /// Icon of this objective to display in the character menu.
     /// Can be specified by an <see cref="ObjectiveGetInfoEvent"/> handler but is usually done in the prototype.
     /// </summary>
-    [DataField, ViewVariables(VVAccess.ReadWrite)]
+    [DataField]
     public SpriteSpecifier? Icon;
 }
 
index 457397845dad6692142538f718a9b3b2a7810034..6067830b7aaada729d66954169dcead4310f895c 100644 (file)
@@ -1,2 +1,3 @@
 entity-category-name-actions = Actions
 entity-category-name-game-rules = Game Rules
+entity-category-name-objectives = Objectives
\ No newline at end of file
index 0535a8a4c27a411534689dae01171e7f566dd54f..bc4dd104def761b287346802f549b9074ae38908 100644 (file)
@@ -7,3 +7,8 @@
   id: GameRules
   name: entity-category-name-game-rules
   hideSpawnMenu: true
+
+- type: entityCategory
+  id: Objectives
+  name: entity-category-name-objectives
+  hideSpawnMenu: true
\ No newline at end of file
index 2ab5149213a6a6005f626a97572d1f1cb283e25f..1fbd23dfce22c2338d33db796620faf8e4f9d95a 100644 (file)
@@ -1,6 +1,6 @@
 # OBJECTIVE STYLE
-# in comments anything that says final prototype means the objective that isnt abstract
-# the final prototype must be noSpawn to avoid showing in f5
+# in comments anything that says final prototype means the objective that isnt abstract.
+# you dont need noSpawn because Objectives category is automatically added, which has hideSpawnmenu
 # components are listed in this order:
 # 1. Objective
 # 2. requirement components
@@ -8,7 +8,7 @@
 # 4. the condition component
 
 # all objectives should inherit this at some point
-# then have its difficulty etc fields set in the final objective prototypes
+# then have its icon etc fields set in the final objective prototypes
 - type: entity
   abstract: true
   id: BaseObjective
index 2cf7eb292f799025151b43f9114ec7bdcf8de081..10ca942cb39a7be84e724ac1e5b9c827e9081acd 100644 (file)
@@ -13,7 +13,6 @@
       - DragonRole
 
 - type: entity
-  noSpawn: true
   parent: BaseDragonObjective
   id: CarpRiftsObjective
   components:
@@ -30,7 +29,6 @@
   - type: CarpRiftsCondition
 
 - type: entity
-  noSpawn: true
   parent: [BaseDragonObjective, BaseSurviveObjective]
   id: DragonSurviveObjective
   name: Survive
index bc17992e90dfcfee76fb1e4d3ecf54af7bf64b7b..3c2fbcaca88934b9eed4c3add398961f2ab9dcb3 100644 (file)
@@ -13,7 +13,6 @@
       - NinjaRole
 
 - type: entity
-  noSpawn: true
   parent: BaseNinjaObjective
   id: DoorjackObjective
   components:
@@ -29,7 +28,6 @@
   - type: DoorjackCondition
 
 - type: entity
-  noSpawn: true
   parent: BaseNinjaObjective
   id: StealResearchObjective
   description: Your gloves can be used to hack a research server and steal its precious data. If science has been slacking you'll have to get to work.
@@ -45,7 +43,6 @@
   - type: StealResearchCondition
 
 - type: entity
-  noSpawn: true
   parent: [BaseNinjaObjective, BaseCodeObjective]
   id: SpiderChargeObjective
   description: This bomb can be detonated in a specific location. Note that the bomb will not work anywhere else!
@@ -56,7 +53,6 @@
       state: icon
 
 - type: entity
-  noSpawn: true
   parent: [BaseNinjaObjective, BaseSurviveObjective]
   id: NinjaSurviveObjective
   name: Survive
@@ -68,7 +64,6 @@
       state: icon
 
 - type: entity
-  noSpawn: true
   parent: [BaseNinjaObjective, BaseCodeObjective]
   id: TerrorObjective
   name: Call in a threat
@@ -80,7 +75,6 @@
       state: red_phone
 
 - type: entity
-  noSpawn: true
   parent: [BaseNinjaObjective, BaseCodeObjective]
   id: MassArrestObjective
   name: Set everyone to wanted
index 18154850973bdf2adb7082a0e9f8ef3a6ec0d86a..8b5307e9a0930edae8e9688d2b544d70be7b2152 100644 (file)
@@ -55,7 +55,6 @@
 # Collections
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: FigurineStealCollectionObjective
   components:
@@ -67,7 +66,6 @@
     difficulty: 0.25
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: HeadCloakStealCollectionObjective
   components:
@@ -79,7 +77,6 @@
     difficulty: 1.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: HeadBedsheetStealCollectionObjective
   components:
@@ -91,7 +88,6 @@
     difficulty: 1.0
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: StampStealCollectionObjective
   components:
     difficulty: 1.0
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: DoorRemoteStealCollectionObjective
   components:
     difficulty: 1.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: TechnologyDiskStealCollectionObjective
   components:
     difficulty: 0.8
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: IDCardsStealCollectionObjective
   components:
 
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealCollectionObjective
   id: LAMPStealCollectionObjective
   components:
 # steal item
 
 - type: entity                                      #Security subgroup
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ForensicScannerStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: FlippoEngravedLighterStealObjective
   components:
     difficulty: 0.8
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ClothingHeadHatWardenStealObjective
   components:
     difficulty: 1.2
 
 - type: entity                                      #Medical subgroup
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ClothingOuterHardsuitVoidParamedStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: MedicalTechFabCircuitboardStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ClothingHeadsetAltMedicalStealObjective
   components:
     difficulty: 1
 
 - type: entity                                      #Engineering subgroup
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: FireAxeStealObjective
   components:
     difficulty: 0.8
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: AmePartFlatpackStealObjective
   components:
     difficulty: 1
 
 - type: entity                                      #Cargo subgroup
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ExpeditionsCircuitboardStealObjective
   components:
     difficulty: 0.7
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: CargoShuttleCircuitboardStealObjective
   components:
     difficulty: 0.7
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: SalvageShuttleCircuitboardStealObjective
   components:
     difficulty: 0.7
 
 - type: entity                                      #Service subgroup
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ClothingEyesHudBeerStealObjective
   components:
     difficulty: 0.3
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: BibleStealObjective
   components:
     difficulty: 0.4
 
 - type: entity                                      #Other subgroup
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ClothingNeckGoldmedalStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealObjective
   id: ClothingNeckClownmedalStealObjective
   components:
 # Structures
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: NuclearBombStealObjective
   components:
     difficulty: 2.5 #Good luck
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: FaxMachineCaptainStealObjective
   components:
     difficulty: 2
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: ChemDispenserStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: XenoArtifactStealObjective
   components:
     difficulty: 0.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: FreezerHeaterStealObjective
   components:
     difficulty: 0.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: TegStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: BoozeDispenserStealObjective
   components:
     difficulty: 0.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: AltarNanotrasenStealObjective
   components:
     difficulty: 0.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealStructureObjective
   id: PlantRDStealObjective
   components:
 # Animal
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: IanStealObjective
   components:
     difficulty: 2.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: BingusStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: McGriffStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: WalterStealObjective
   components:
     difficulty: 1
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: MortyStealObjective
   components:
     difficulty: 0.5
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: RenaultStealObjective
   components:
     difficulty: 2
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: ShivaStealObjective
   components:
     difficulty: 2
 
 - type: entity
-  noSpawn: true
   parent: BaseThiefStealAnimalObjective
   id: TropicoStealObjective
   components:
 # Escape
 
 - type: entity
-  noSpawn: true
   parent: [BaseThiefObjective, BaseLivingObjective]
   id: EscapeThiefShuttleObjective
   name: Escape to centcom alive and unrestrained.
index 14397535d4d2451f413598a90e5a60e474ebb1a7..ad5f56a443eae0e661ffddcfcc4a5cb4fdf5f3a3 100644 (file)
@@ -36,7 +36,6 @@
 # state
 
 - type: entity
-  noSpawn: true
   parent: [BaseTraitorObjective, BaseLivingObjective]
   id: EscapeShuttleObjective
   name: Escape to centcom alive and unrestrained.
@@ -50,7 +49,6 @@
   - type: EscapeShuttleCondition
 
 - type: entity
-  noSpawn: true
   parent: BaseTraitorObjective
   id: DieObjective
   name: Die a glorious death
@@ -69,7 +67,6 @@
   - type: DieCondition
 
 #- type: entity
-#  noSpawn: true
 #  parent: [BaseTraitorObjective, BaseLivingObjective]
 #  id: HijackShuttleObjective
 #  name: Hijack emergency shuttle
@@ -85,7 +82,6 @@
 # kill
 
 - type: entity
-  noSpawn: true
   parent: [BaseTraitorObjective, BaseKillObjective]
   id: KillRandomPersonObjective
   description: Do it however you like, just make sure they don't make it to centcom.
@@ -98,7 +94,6 @@
   - type: PickRandomPerson
 
 - type: entity
-  noSpawn: true
   parent: [BaseTraitorObjective, BaseKillObjective]
   id: KillRandomHeadObjective
   description: We need this head gone and you probably know why. Good luck, agent.
 # social
 
 - type: entity
-  noSpawn: true
   parent: [BaseTraitorSocialObjective, BaseKeepAliveObjective]
   id: RandomTraitorAliveObjective
   description: Identify yourself at your own risk. We just need them alive.
   - type: RandomTraitorAlive
 
 - type: entity
-  noSpawn: true
   parent: [BaseTraitorSocialObjective, BaseHelpProgressObjective]
   id: RandomTraitorProgressObjective
   description: Identify yourself at your own risk. We just need them to succeed.
     owner: job-name-cmo
 
 - type: entity
-  noSpawn: true
   parent: BaseCMOStealObjective
   id: CMOHyposprayStealObjective
   components:
     stealGroup: Hypospray
 
 - type: entity
-  noSpawn: true
   parent: BaseCMOStealObjective
   id: CMOCrewMonitorStealObjective
   components:
     owner: job-name-rd
 
 - type: entity
-  noSpawn: true
   parent: BaseRDStealObjective
   id: RDHardsuitStealObjective
   components:
     difficulty: 3
 
 - type: entity
-  noSpawn: true
   parent: BaseRDStealObjective
   id: HandTeleporterStealObjective
   components:
 ## hos
 
 - type: entity
-  noSpawn: true
   parent: BaseTraitorStealObjective
   id: SecretDocumentsStealObjective
   components:
 ## ce
 
 - type: entity
-  noSpawn: true
   parent: BaseTraitorStealObjective
   id: MagbootsStealObjective
   components:
 ## qm
 
 - type: entity
-  noSpawn: true
   parent: BaseTraitorStealObjective
   id: ClipboardStealObjective
   components:
 ## hop
 
 - type: entity
-  noSpawn: true
   parent: BaseTraitorStealObjective
   id: CorgiMeatStealObjective
   components:
     job: Captain
 
 - type: entity
-  noSpawn: true
   parent: BaseCaptainObjective
   id: CaptainIDStealObjective
   components:
     stealGroup: CaptainIDCard
 
 - type: entity
-  noSpawn: true
   parent: BaseCaptainObjective
   id: CaptainJetpackStealObjective
   components:
     stealGroup: JetpackCaptainFilled
 
 - type: entity
-  noSpawn: true
   parent: BaseCaptainObjective
   id: CaptainGunStealObjective
   components:
     owner: job-name-captain
 
 - type: entity
-  noSpawn: true
   parent: BaseCaptainObjective
   id: NukeDiskStealObjective
   components: