]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Beacon localization (#24138)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Sat, 20 Jan 2024 08:59:41 +0000 (09:59 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Jan 2024 08:59:41 +0000 (19:59 +1100)
* localize beacons

* No not like that

* Tesla beacons were already depreciated, time to give the reaper their due

* Entity name fallback

* The real treasure was the far easier solution we missed along the way

* weh

* Shared mapinit

* fix RT version

* a single line break

Content.Server/Pinpointer/NavMapSystem.cs
Content.Shared/Pinpointer/SharedNavMapSystem.cs
Resources/Locale/en-US/navmap-beacons/station-beacons.ftl [new file with mode: 0644]
Resources/Locale/en-US/navmap-beacons/station_map.ftl [moved from Resources/Locale/en-US/pinpointer/station_map.ftl with 100% similarity]
Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml
Resources/migration.yml

index f2a23693a882cc2d4df52550aa67c42d02f5d26b..bf3a3b2998880655232a57b88ce8562b54151d8e 100644 (file)
@@ -225,7 +225,7 @@ public sealed class NavMapSystem : SharedNavMapSystem
             // TODO: Make warp points use metadata name instead.
             string? name = beacon.Text;
 
-            if (name == null)
+            if (string.IsNullOrEmpty(name))
             {
                 if (TryComp<WarpPointComponent>(beaconUid, out var warpPoint) && warpPoint.Location != null)
                 {
index 17f86ac7e6807210a1a75d3b9e92c660114f4318..7a62e6aabed53b55455f2ef72742635f25aa339f 100644 (file)
@@ -8,6 +8,13 @@ public abstract class SharedNavMapSystem : EntitySystem
 {
     public const byte ChunkSize = 4;
 
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<NavMapBeaconComponent, MapInitEvent>(OnNavMapBeaconMapInit);
+    }
+
     /// <summary>
     /// Converts the chunk's tile into a bitflag for the slot.
     /// </summary>
@@ -31,6 +38,13 @@ public abstract class SharedNavMapSystem : EntitySystem
         return new Vector2i(x, y);
     }
 
+    private void OnNavMapBeaconMapInit(EntityUid uid, NavMapBeaconComponent component, MapInitEvent args)
+    {
+        component.Text ??= string.Empty;
+        component.Text = Loc.GetString(component.Text);
+        Dirty(uid, component);
+    }
+
     [Serializable, NetSerializable]
     protected sealed class NavMapComponentState : ComponentState
     {
diff --git a/Resources/Locale/en-US/navmap-beacons/station-beacons.ftl b/Resources/Locale/en-US/navmap-beacons/station-beacons.ftl
new file mode 100644 (file)
index 0000000..48f75cb
--- /dev/null
@@ -0,0 +1,72 @@
+station-beacon-general = General
+
+station-beacon-command = Command
+station-beacon-bridge = Bridge
+station-beacon-vault = Vault
+station-beacon-captain = Captain
+station-beacon-hop = HOP
+
+station-beacon-security = Security
+station-beacon-brig = Brig
+station-beacon-warden = Warden
+station-beacon-hos = HOS
+station-beacon-armory = Armory
+station-beacon-perma-brig = Perma
+station-beacon-detective = Detective
+station-beacon-courtroom = Courtroom
+station-beacon-law = Law Office
+station-beacon-security-checkpoint = Checkpoint
+
+station-beacon-medical = Medical
+station-beacon-medbay = Medbay
+station-beacon-chemistry = Chem
+station-beacon-cryonics = Cryo
+station-beacon-cmo = CMO
+station-beacon-morgue = Morgue
+station-beacon-surgery = Surgery
+
+station-beacon-science = Science
+station-beacon-research-and-development = Research
+station-beacon-research-server = Server
+station-beacon-research-director = RD
+station-beacon-robotics = Robotics
+station-beacon-artifact-lab = Artifact
+station-beacon-anomaly-gen = Anomaly
+
+station-beacon-supply = Supply
+station-beacon-cargo = Cargo
+station-beacon-cargo-bay = Cargo Bay
+station-beacon-qm = QM
+station-beacon-salvage = Salvage
+
+station-beacon-engineering = Engineering
+station-beacon-ce = CE
+station-beacon-ame = AME
+station-beacon-solars = Solars
+station-beacon-gravgen = Grav
+station-beacon-pa = PA Control
+station-beacon-smes = SMES
+station-beacon-telecoms = Telecoms
+station-beacon-atmos = Atmos
+station-beacon-teg = TEG
+station-beacon-tech-vault = Tech Vault
+
+station-beacon-service = Service
+station-beacon-kitchen = Kitchen
+station-beacon-bar = Bar
+station-beacon-botany = Botany
+station-beacon-janitor = Janitor
+
+station-beacon-ai = AI
+station-beacon-ai-sat = AI Sat
+station-beacon-ai-core = AI Core
+
+station-beacon-arrivals = Arrivals
+station-beacon-evac = Evac
+station-beacon-eva-storage = EVA Storage
+station-beacon-chapel = Chapel
+station-beacon-library = Library
+station-beacon-dorms = Dorms
+station-beacon-theater = Theater
+station-beacon-tools = Tools
+station-beacon-disposals = Disposals
index ac457c95475b22fc0daf9070bd9684bcde4f1db1..bdf869d9b11a4e4679c49d8f59b4b288b77ca0ac 100644 (file)
@@ -22,7 +22,7 @@
           False: {state: icon}
   - type: ConfigurableNavMapBeacon
   - type: NavMapBeacon
-    text: general
+    text: station-beacon-general
     color: "#D4D4D496"
   - type: WarpPoint
   - type: ActivatableUI
   suffix: Command
   components:
   - type: NavMapBeacon
-    text: Command
+    text: station-beacon-command
     color: "#FFFF00"
 
 - type: entity
   suffix: Bridge
   components:
   - type: NavMapBeacon
-    text: Bridge
+    text: station-beacon-bridge
 
 - type: entity
   parent: DefaultStationBeaconCommand
   suffix: Vault
   components:
   - type: NavMapBeacon
-    text: Vault
+    text: station-beacon-vault
 
 - type: entity
   parent: DefaultStationBeaconCommand
   suffix: Captain's Quarters
   components:
   - type: NavMapBeacon
-    text: Captain
+    text: station-beacon-captain
 
 - type: entity
   parent: DefaultStationBeaconCommand
   suffix: HOP's Office
   components:
   - type: NavMapBeacon
-    text: HOP
+    text: station-beacon-hop
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Security
   components:
   - type: NavMapBeacon
-    text: Security
+    text: station-beacon-security
     color: "#DE3A3A"
 
 - type: entity
   suffix: Brig
   components:
   - type: NavMapBeacon
-    text: Brig
+    text: station-beacon-brig
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: Warden's Office
   components:
   - type: NavMapBeacon
-    text: Warden
+    text: station-beacon-warden
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: HOS’s Room
   components:
   - type: NavMapBeacon
-    text: HOS
+    text: station-beacon-hos
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: Armory
   components:
   - type: NavMapBeacon
-    text: Armory
+    text: station-beacon-armory
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: Perma Brig
   components:
   - type: NavMapBeacon
-    text: Perma
+    text: station-beacon-perma-brig
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: Detective's Room
   components:
   - type: NavMapBeacon
-    text: Detective
+    text: station-beacon-detective
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: Courtroom
   components:
   - type: NavMapBeacon
-    text: Courtroom
+    text: station-beacon-courtroom
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: Law Office
   components:
   - type: NavMapBeacon
-    text: Law Office
+    text: station-beacon-law
 
 - type: entity
   parent: DefaultStationBeaconSecurity
   suffix: Sec Checkpoint
   components:
   - type: NavMapBeacon
-    text: Checkpoint
+    text: station-beacon-security-checkpoint
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Medical
   components:
   - type: NavMapBeacon
-    text: Medical
+    text: station-beacon-medical
     color: "#52B4E9"
 
 - type: entity
   suffix: Medbay
   components:
   - type: NavMapBeacon
-    text: Medbay
+    text: station-beacon-medbay
 
 - type: entity
   parent: DefaultStationBeaconMedical
   suffix: Chemistry
   components:
   - type: NavMapBeacon
-    text: Chem
+    text: station-beacon-chemistry
 
 - type: entity
   parent: DefaultStationBeaconMedical
   suffix: Cryonics
   components:
   - type: NavMapBeacon
-    text: Cryo
+    text: station-beacon-cryonics
 
 - type: entity
   parent: DefaultStationBeaconMedical
   suffix: CMO's room
   components:
   - type: NavMapBeacon
-    text: CMO
+    text: station-beacon-cmo
 
 - type: entity
   parent: DefaultStationBeaconMedical
   suffix: Morgue
   components:
   - type: NavMapBeacon
-    text: Morgue
+    text: station-beacon-morgue
 
 - type: entity
   parent: DefaultStationBeaconMedical
   suffix: Surgery
   components:
   - type: NavMapBeacon
-    text: Surgery
+    text: station-beacon-surgery
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Science
   components:
   - type: NavMapBeacon
-    text: Science
+    text: station-beacon-science
     color: "#D381C9"
 
 - type: entity
   suffix: Research and Development
   components:
   - type: NavMapBeacon
-    text: Research
+    text: station-beacon-research-and-development
 
 - type: entity
   parent: DefaultStationBeaconScience
   suffix: Research Server Room
   components:
   - type: NavMapBeacon
-    text: Server
+    text: station-beacon-research-server
 
 - type: entity
   parent: DefaultStationBeaconScience
   suffix: RD's Room
   components:
   - type: NavMapBeacon
-    text: RD
+    text: station-beacon-research-director
 
 - type: entity
   parent: DefaultStationBeaconScience
   suffix: Robotics
   components:
   - type: NavMapBeacon
-    text: Robotics
+    text: station-beacon-robotics
 
 - type: entity
   parent: DefaultStationBeaconScience
   suffix: Artifact Lab
   components:
   - type: NavMapBeacon
-    text: Artifact
+    text: station-beacon-artifact-lab
 
 - type: entity
   parent: DefaultStationBeaconScience
   suffix: Anomaly Generator
   components:
   - type: NavMapBeacon
-    text: Anomaly
+    text: station-beacon-anomaly-gen
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Supply
   components:
   - type: NavMapBeacon
-    text: Supply
+    text: station-beacon-supply
     color: "#A46106"
 
 - type: entity
   suffix: Cargo Reception
   components:
   - type: NavMapBeacon
-    text: Cargo
+    text: station-beacon-cargo
 
 - type: entity
   parent: DefaultStationBeaconSupply
   suffix: Cargo Bay
   components:
   - type: NavMapBeacon
-    text: Cargo Bay
+    text: station-beacon-cargo-bay
 
 - type: entity
   parent: DefaultStationBeaconSupply
   suffix: QM's Room
   components:
   - type: NavMapBeacon
-    text: QM
+    text: station-beacon-qm
 
 - type: entity
   parent: DefaultStationBeaconSupply
   suffix: Salvage
   components:
   - type: NavMapBeacon
-    text: Salvage
+    text: station-beacon-salvage
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Engineering
   components:
   - type: NavMapBeacon
-    text: Engineering
+    text: station-beacon-engineering
     color: "#EFB341"
 
 - type: entity
   suffix: CE's Room
   components:
   - type: NavMapBeacon
-    text: CE
+    text: station-beacon-ce
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: AME
   components:
   - type: NavMapBeacon
-    text: AME
+    text: station-beacon-ame
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: Solars
   components:
   - type: NavMapBeacon
-    text: Solars
+    text: station-beacon-solars
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: Grav Gen
   components:
   - type: NavMapBeacon
-    text: Grav
+    text: station-beacon-gravgen
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: PA Control
   components:
   - type: NavMapBeacon
-    text: PA Control
+    text: station-beacon-pa
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: SMES Power Bank
   components:
   - type: NavMapBeacon
-    text: SMES
+    text: station-beacon-smes
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: Telecoms
   components:
   - type: NavMapBeacon
-    text: Telecoms
+    text: station-beacon-telecoms
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: Atmospherics
   components:
   - type: NavMapBeacon
-    text: Atmos
+    text: station-beacon-atmos
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: TEG
   components:
   - type: NavMapBeacon
-    text: TEG
-
-- type: entity
-  parent: DefaultStationBeaconEngineering
-  id: DefaultStationBeaconTeslaEngine
-  suffix: Tesla Engine (Do Not Map - use PA Control instead)
-  components:
-  - type: NavMapBeacon
-    text: Tesla
+    text: station-beacon-teg
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   suffix: Tech Vault
   components:
   - type: NavMapBeacon
-    text: Tech Vault
+    text: station-beacon-tech-vault
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Service
   components:
   - type: NavMapBeacon
-    text: Service
+    text: station-beacon-service
     color: "#9FED58"
 
 - type: entity
   suffix: Kitchen
   components:
   - type: NavMapBeacon
-    text: Kitchen
+    text: station-beacon-kitchen
 
 - type: entity
   parent: DefaultStationBeaconService
   suffix: Bar
   components:
   - type: NavMapBeacon
-    text: Bar
+    text: station-beacon-bar
 
 - type: entity
   parent: DefaultStationBeaconService
   suffix: Botany
   components:
   - type: NavMapBeacon
-    text: Botany
+    text: station-beacon-botany
 
 - type: entity
   parent: DefaultStationBeaconService
   suffix: Janitor's Closet
   components:
   - type: NavMapBeacon
-    text: Janitor
+    text: station-beacon-janitor
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: AI
   components:
   - type: NavMapBeacon
-    text: AI
+    text: station-beacon-ai
     color: "#2ed2fd"
 
 - type: entity
   suffix: AI Satellite
   components:
   - type: NavMapBeacon
-    text: AI Sat
+    text: station-beacon-ai-sat
 
 - type: entity
   parent: DefaultStationBeaconAI
   suffix: AI Core
   components:
   - type: NavMapBeacon
-    text: AI Core
+    text: station-beacon-ai-core
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Arrivals
   components:
   - type: NavMapBeacon
-    text: Arrivals
+    text: station-beacon-arrivals
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Evac
   components:
   - type: NavMapBeacon
-    text: Evac
+    text: station-beacon-evac
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: EVA Storage
   components:
   - type: NavMapBeacon
-    text: EVA Storage
+    text: station-beacon-eva-storage
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Chapel
   components:
   - type: NavMapBeacon
-    text: Chapel
+    text: station-beacon-chapel
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Library
   components:
   - type: NavMapBeacon
-    text: Library
+    text: station-beacon-library
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Theater
   components:
   - type: NavMapBeacon
-    text: Theater
+    text: station-beacon-theater
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Dorms
   components:
   - type: NavMapBeacon
-    text: Dorms
+    text: station-beacon-dorms
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Tool Room
   components:
   - type: NavMapBeacon
-    text: Tools
+    text: station-beacon-tools
 
 - type: entity
   parent: DefaultStationBeacon
   suffix: Disposals
   components:
   - type: NavMapBeacon
-    text: Disposals
+    text: station-beacon-disposals
 
index 5d31d34d5f0bf9a47c9ed9123f7a6082a3d587ca..e859bbc7fe6d37ba2ecf9616c6a6aa47c8e47157 100644 (file)
@@ -162,3 +162,6 @@ SpaceMedipen: null
 
 # 2024-01-18
 ClothingHeadHelmetVoidParamed: null
+
+# 2024-01-19
+DefaultStationBeaconTeslaEngine: null