From 1862f8aa1745f147fa54428179e568c9298a9fda Mon Sep 17 00:00:00 2001
From: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Date: Thu, 1 Feb 2024 11:13:44 +0100
Subject: [PATCH] Visitor job (#23972)
* Adds Visitor role and ShowInIdCardConsole property
* Add visitor to Agent ID card
* Fixes yaml test
* Fixes based on feedback
* Fixes based on feedback
---
.../Access/UI/IdCardConsoleWindow.xaml.cs | 2 +-
Content.Shared/Roles/JobPrototype.cs | 7 +++++++
Resources/Locale/en-US/job/job-description.ftl | 1 +
Resources/Locale/en-US/job/job-names.ftl | 2 ++
.../Objects/Misc/identification_cards.yml | 1 +
.../Prototypes/Roles/Jobs/Civilian/visitor.yml | 11 +++++++++++
Resources/Prototypes/Roles/Jobs/departments.yml | 1 +
Resources/Prototypes/Roles/play_time_trackers.yml | 3 +++
Resources/Prototypes/StatusEffects/job.yml | 7 +++++++
.../Interface/Misc/job_icons.rsi/Visitor.png | Bin 0 -> 147 bytes
.../Interface/Misc/job_icons.rsi/meta.json | 3 +++
11 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 Resources/Prototypes/Roles/Jobs/Civilian/visitor.yml
create mode 100644 Resources/Textures/Interface/Misc/job_icons.rsi/Visitor.png
diff --git a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
index 670ba08871..bf5984e809 100644
--- a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
+++ b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
@@ -55,7 +55,7 @@ namespace Content.Client.Access.UI
foreach (var job in jobs)
{
- if (!job.SetPreference)
+ if (!job.OverrideConsoleVisibility.GetValueOrDefault(job.SetPreference))
{
continue;
}
diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs
index 64cd2c6643..acb88e16f0 100644
--- a/Content.Shared/Roles/JobPrototype.cs
+++ b/Content.Shared/Roles/JobPrototype.cs
@@ -53,6 +53,13 @@ namespace Content.Shared.Roles
[DataField("setPreference")]
public bool SetPreference { get; private set; } = true;
+ ///
+ /// Whether this job should show in the ID Card Console.
+ /// If set to null, it will default to SetPreference's value.
+ ///
+ [DataField]
+ public bool? OverrideConsoleVisibility { get; private set; } = null;
+
[DataField("canBeAntag")]
public bool CanBeAntag { get; private set; } = true;
diff --git a/Resources/Locale/en-US/job/job-description.ftl b/Resources/Locale/en-US/job/job-description.ftl
index 01f588897b..2a094fb0ad 100644
--- a/Resources/Locale/en-US/job/job-description.ftl
+++ b/Resources/Locale/en-US/job/job-description.ftl
@@ -42,5 +42,6 @@ job-description-salvagespec = Use the salvage magnet to draw in detatched scraps
job-description-scientist = Research alien artifacts, unlock new technologies, build newer and better machines around the station, and make everything run more efficiently.
job-description-security = Catch criminals and enemies of the station, enforce the law, and ensure that the station does not fall into disarray.
job-description-serviceworker = Learn the basics of bartending, cooking, and growing plants.
+job-description-visitor = Enjoy your visit to the station.
job-description-warden = Patrol the security department, ensure that no one is stealing from the armory, and make sure that all prisoners are processed and let out when their time is up.
job-description-zookeeper = Put on a joyful display of cute animals and space carps for all the crew to see. Currently available on Gemini Station.
diff --git a/Resources/Locale/en-US/job/job-names.ftl b/Resources/Locale/en-US/job/job-names.ftl
index 1f7e1c1e0e..8cd35cac88 100644
--- a/Resources/Locale/en-US/job/job-names.ftl
+++ b/Resources/Locale/en-US/job/job-names.ftl
@@ -44,6 +44,7 @@ job-name-ertmedic = ERT Medic
job-name-ertjanitor = ERT Janitor
job-name-boxer = Boxer
job-name-zookeeper = Zookeeper
+job-name-visitor = Visitor
# Role timers - Make these alphabetical or I cut you
JobAtmosphericTechnician = Atmospheric Technician
@@ -90,5 +91,6 @@ JobSecurityOfficer = Security Officer
JobServiceWorker = Service Worker
JobStationEngineer = Station Engineer
JobTechnicalAssistant = Technical Assistant
+JobVisitor = Visitor
JobWarden = Warden
JobZookeeper = Zookeeper
diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
index c9615d514c..553fdd3362 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
@@ -646,6 +646,7 @@
- JobIconServiceWorker
- JobIconSecurityCadet
- JobIconZookeeper
+ - JobIconVisitor
- type: ActivatableUI
key: enum.AgentIDCardUiKey.Key
inHandsOnly: true
diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/visitor.yml b/Resources/Prototypes/Roles/Jobs/Civilian/visitor.yml
new file mode 100644
index 0000000000..d16be5c350
--- /dev/null
+++ b/Resources/Prototypes/Roles/Jobs/Civilian/visitor.yml
@@ -0,0 +1,11 @@
+- type: job
+ id: Visitor
+ name: job-name-visitor
+ description: job-description-visitor
+ playTimeTracker: JobVisitor
+ canBeAntag: false
+ icon: JobIconVisitor
+ setPreference: false
+ overrideConsoleVisibility: true
+ access:
+ - Maintenance
diff --git a/Resources/Prototypes/Roles/Jobs/departments.yml b/Resources/Prototypes/Roles/Jobs/departments.yml
index 20b1847699..9be98be950 100644
--- a/Resources/Prototypes/Roles/Jobs/departments.yml
+++ b/Resources/Prototypes/Roles/Jobs/departments.yml
@@ -28,6 +28,7 @@
- Musician
- Passenger
- Reporter
+ - Visitor
- Zookeeper
- ServiceWorker
diff --git a/Resources/Prototypes/Roles/play_time_trackers.yml b/Resources/Prototypes/Roles/play_time_trackers.yml
index 0e344780f1..242dc81fa8 100644
--- a/Resources/Prototypes/Roles/play_time_trackers.yml
+++ b/Resources/Prototypes/Roles/play_time_trackers.yml
@@ -130,6 +130,9 @@
- type: playTimeTracker
id: JobTechnicalAssistant
+- type: playTimeTracker
+ id: JobVisitor
+
- type: playTimeTracker
id: JobWarden
diff --git a/Resources/Prototypes/StatusEffects/job.yml b/Resources/Prototypes/StatusEffects/job.yml
index 8be71cc615..2e8e5bc255 100644
--- a/Resources/Prototypes/StatusEffects/job.yml
+++ b/Resources/Prototypes/StatusEffects/job.yml
@@ -367,3 +367,10 @@
icon:
sprite: Interface/Misc/job_icons.rsi
state: SeniorResearcher
+
+- type: statusIcon
+ parent: JobIcon
+ id: JobIconVisitor
+ icon:
+ sprite: Interface/Misc/job_icons.rsi
+ state: Visitor
diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/Visitor.png b/Resources/Textures/Interface/Misc/job_icons.rsi/Visitor.png
new file mode 100644
index 0000000000000000000000000000000000000000..5644edb607f289b5a1ca7973173e7382c0acb388
GIT binary patch
literal 147
zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|d_7$pLnNlQ
z_8;UuV8Frb8-AqPp!@rWzAsZdR!ppt7r5c(Qr?{Mxan=jnVj1U4XbW>dn$B3e>O*k
u$fX{I~aimGkCiCxvX