Beacon localization (#24138)

* 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
This commit is contained in:
Errant
2024-01-20 09:59:41 +01:00
committed by GitHub
parent 18a111bb36
commit efdc6f8d4c
6 changed files with 153 additions and 72 deletions

View File

@@ -225,7 +225,7 @@ public sealed class NavMapSystem : SharedNavMapSystem
// TODO: Make warp points use metadata name instead. // TODO: Make warp points use metadata name instead.
string? name = beacon.Text; string? name = beacon.Text;
if (name == null) if (string.IsNullOrEmpty(name))
{ {
if (TryComp<WarpPointComponent>(beaconUid, out var warpPoint) && warpPoint.Location != null) if (TryComp<WarpPointComponent>(beaconUid, out var warpPoint) && warpPoint.Location != null)
{ {

View File

@@ -8,6 +8,13 @@ public abstract class SharedNavMapSystem : EntitySystem
{ {
public const byte ChunkSize = 4; public const byte ChunkSize = 4;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NavMapBeaconComponent, MapInitEvent>(OnNavMapBeaconMapInit);
}
/// <summary> /// <summary>
/// Converts the chunk's tile into a bitflag for the slot. /// Converts the chunk's tile into a bitflag for the slot.
/// </summary> /// </summary>
@@ -31,6 +38,13 @@ public abstract class SharedNavMapSystem : EntitySystem
return new Vector2i(x, y); 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] [Serializable, NetSerializable]
protected sealed class NavMapComponentState : ComponentState protected sealed class NavMapComponentState : ComponentState
{ {

View File

@@ -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

View File

@@ -22,7 +22,7 @@
False: {state: icon} False: {state: icon}
- type: ConfigurableNavMapBeacon - type: ConfigurableNavMapBeacon
- type: NavMapBeacon - type: NavMapBeacon
text: general text: station-beacon-general
color: "#D4D4D496" color: "#D4D4D496"
- type: WarpPoint - type: WarpPoint
- type: ActivatableUI - type: ActivatableUI
@@ -118,7 +118,7 @@
suffix: Command suffix: Command
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Command text: station-beacon-command
color: "#FFFF00" color: "#FFFF00"
- type: entity - type: entity
@@ -127,7 +127,7 @@
suffix: Bridge suffix: Bridge
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Bridge text: station-beacon-bridge
- type: entity - type: entity
parent: DefaultStationBeaconCommand parent: DefaultStationBeaconCommand
@@ -135,7 +135,7 @@
suffix: Vault suffix: Vault
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Vault text: station-beacon-vault
- type: entity - type: entity
parent: DefaultStationBeaconCommand parent: DefaultStationBeaconCommand
@@ -143,7 +143,7 @@
suffix: Captain's Quarters suffix: Captain's Quarters
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Captain text: station-beacon-captain
- type: entity - type: entity
parent: DefaultStationBeaconCommand parent: DefaultStationBeaconCommand
@@ -151,7 +151,7 @@
suffix: HOP's Office suffix: HOP's Office
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: HOP text: station-beacon-hop
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -159,7 +159,7 @@
suffix: Security suffix: Security
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Security text: station-beacon-security
color: "#DE3A3A" color: "#DE3A3A"
- type: entity - type: entity
@@ -168,7 +168,7 @@
suffix: Brig suffix: Brig
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Brig text: station-beacon-brig
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -176,7 +176,7 @@
suffix: Warden's Office suffix: Warden's Office
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Warden text: station-beacon-warden
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -184,7 +184,7 @@
suffix: HOSs Room suffix: HOSs Room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: HOS text: station-beacon-hos
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -192,7 +192,7 @@
suffix: Armory suffix: Armory
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Armory text: station-beacon-armory
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -200,7 +200,7 @@
suffix: Perma Brig suffix: Perma Brig
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Perma text: station-beacon-perma-brig
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -208,7 +208,7 @@
suffix: Detective's Room suffix: Detective's Room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Detective text: station-beacon-detective
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -216,7 +216,7 @@
suffix: Courtroom suffix: Courtroom
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Courtroom text: station-beacon-courtroom
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -224,7 +224,7 @@
suffix: Law Office suffix: Law Office
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Law Office text: station-beacon-law
- type: entity - type: entity
parent: DefaultStationBeaconSecurity parent: DefaultStationBeaconSecurity
@@ -232,7 +232,7 @@
suffix: Sec Checkpoint suffix: Sec Checkpoint
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Checkpoint text: station-beacon-security-checkpoint
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -240,7 +240,7 @@
suffix: Medical suffix: Medical
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Medical text: station-beacon-medical
color: "#52B4E9" color: "#52B4E9"
- type: entity - type: entity
@@ -249,7 +249,7 @@
suffix: Medbay suffix: Medbay
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Medbay text: station-beacon-medbay
- type: entity - type: entity
parent: DefaultStationBeaconMedical parent: DefaultStationBeaconMedical
@@ -257,7 +257,7 @@
suffix: Chemistry suffix: Chemistry
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Chem text: station-beacon-chemistry
- type: entity - type: entity
parent: DefaultStationBeaconMedical parent: DefaultStationBeaconMedical
@@ -265,7 +265,7 @@
suffix: Cryonics suffix: Cryonics
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Cryo text: station-beacon-cryonics
- type: entity - type: entity
parent: DefaultStationBeaconMedical parent: DefaultStationBeaconMedical
@@ -273,7 +273,7 @@
suffix: CMO's room suffix: CMO's room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: CMO text: station-beacon-cmo
- type: entity - type: entity
parent: DefaultStationBeaconMedical parent: DefaultStationBeaconMedical
@@ -281,7 +281,7 @@
suffix: Morgue suffix: Morgue
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Morgue text: station-beacon-morgue
- type: entity - type: entity
parent: DefaultStationBeaconMedical parent: DefaultStationBeaconMedical
@@ -289,7 +289,7 @@
suffix: Surgery suffix: Surgery
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Surgery text: station-beacon-surgery
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -297,7 +297,7 @@
suffix: Science suffix: Science
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Science text: station-beacon-science
color: "#D381C9" color: "#D381C9"
- type: entity - type: entity
@@ -306,7 +306,7 @@
suffix: Research and Development suffix: Research and Development
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Research text: station-beacon-research-and-development
- type: entity - type: entity
parent: DefaultStationBeaconScience parent: DefaultStationBeaconScience
@@ -314,7 +314,7 @@
suffix: Research Server Room suffix: Research Server Room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Server text: station-beacon-research-server
- type: entity - type: entity
parent: DefaultStationBeaconScience parent: DefaultStationBeaconScience
@@ -322,7 +322,7 @@
suffix: RD's Room suffix: RD's Room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: RD text: station-beacon-research-director
- type: entity - type: entity
parent: DefaultStationBeaconScience parent: DefaultStationBeaconScience
@@ -330,7 +330,7 @@
suffix: Robotics suffix: Robotics
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Robotics text: station-beacon-robotics
- type: entity - type: entity
parent: DefaultStationBeaconScience parent: DefaultStationBeaconScience
@@ -338,7 +338,7 @@
suffix: Artifact Lab suffix: Artifact Lab
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Artifact text: station-beacon-artifact-lab
- type: entity - type: entity
parent: DefaultStationBeaconScience parent: DefaultStationBeaconScience
@@ -346,7 +346,7 @@
suffix: Anomaly Generator suffix: Anomaly Generator
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Anomaly text: station-beacon-anomaly-gen
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -354,7 +354,7 @@
suffix: Supply suffix: Supply
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Supply text: station-beacon-supply
color: "#A46106" color: "#A46106"
- type: entity - type: entity
@@ -363,7 +363,7 @@
suffix: Cargo Reception suffix: Cargo Reception
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Cargo text: station-beacon-cargo
- type: entity - type: entity
parent: DefaultStationBeaconSupply parent: DefaultStationBeaconSupply
@@ -371,7 +371,7 @@
suffix: Cargo Bay suffix: Cargo Bay
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Cargo Bay text: station-beacon-cargo-bay
- type: entity - type: entity
parent: DefaultStationBeaconSupply parent: DefaultStationBeaconSupply
@@ -379,7 +379,7 @@
suffix: QM's Room suffix: QM's Room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: QM text: station-beacon-qm
- type: entity - type: entity
parent: DefaultStationBeaconSupply parent: DefaultStationBeaconSupply
@@ -387,7 +387,7 @@
suffix: Salvage suffix: Salvage
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Salvage text: station-beacon-salvage
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -395,7 +395,7 @@
suffix: Engineering suffix: Engineering
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Engineering text: station-beacon-engineering
color: "#EFB341" color: "#EFB341"
- type: entity - type: entity
@@ -404,7 +404,7 @@
suffix: CE's Room suffix: CE's Room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: CE text: station-beacon-ce
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -412,7 +412,7 @@
suffix: AME suffix: AME
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: AME text: station-beacon-ame
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -420,7 +420,7 @@
suffix: Solars suffix: Solars
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Solars text: station-beacon-solars
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -428,7 +428,7 @@
suffix: Grav Gen suffix: Grav Gen
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Grav text: station-beacon-gravgen
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -436,7 +436,7 @@
suffix: PA Control suffix: PA Control
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: PA Control text: station-beacon-pa
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -444,7 +444,7 @@
suffix: SMES Power Bank suffix: SMES Power Bank
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: SMES text: station-beacon-smes
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -452,7 +452,7 @@
suffix: Telecoms suffix: Telecoms
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Telecoms text: station-beacon-telecoms
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -460,7 +460,7 @@
suffix: Atmospherics suffix: Atmospherics
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Atmos text: station-beacon-atmos
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -468,15 +468,7 @@
suffix: TEG suffix: TEG
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: TEG text: station-beacon-teg
- type: entity
parent: DefaultStationBeaconEngineering
id: DefaultStationBeaconTeslaEngine
suffix: Tesla Engine (Do Not Map - use PA Control instead)
components:
- type: NavMapBeacon
text: Tesla
- type: entity - type: entity
parent: DefaultStationBeaconEngineering parent: DefaultStationBeaconEngineering
@@ -484,7 +476,7 @@
suffix: Tech Vault suffix: Tech Vault
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Tech Vault text: station-beacon-tech-vault
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -492,7 +484,7 @@
suffix: Service suffix: Service
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Service text: station-beacon-service
color: "#9FED58" color: "#9FED58"
- type: entity - type: entity
@@ -501,7 +493,7 @@
suffix: Kitchen suffix: Kitchen
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Kitchen text: station-beacon-kitchen
- type: entity - type: entity
parent: DefaultStationBeaconService parent: DefaultStationBeaconService
@@ -509,7 +501,7 @@
suffix: Bar suffix: Bar
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Bar text: station-beacon-bar
- type: entity - type: entity
parent: DefaultStationBeaconService parent: DefaultStationBeaconService
@@ -517,7 +509,7 @@
suffix: Botany suffix: Botany
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Botany text: station-beacon-botany
- type: entity - type: entity
parent: DefaultStationBeaconService parent: DefaultStationBeaconService
@@ -525,7 +517,7 @@
suffix: Janitor's Closet suffix: Janitor's Closet
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Janitor text: station-beacon-janitor
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -533,7 +525,7 @@
suffix: AI suffix: AI
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: AI text: station-beacon-ai
color: "#2ed2fd" color: "#2ed2fd"
- type: entity - type: entity
@@ -542,7 +534,7 @@
suffix: AI Satellite suffix: AI Satellite
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: AI Sat text: station-beacon-ai-sat
- type: entity - type: entity
parent: DefaultStationBeaconAI parent: DefaultStationBeaconAI
@@ -550,7 +542,7 @@
suffix: AI Core suffix: AI Core
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: AI Core text: station-beacon-ai-core
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -558,7 +550,7 @@
suffix: Arrivals suffix: Arrivals
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Arrivals text: station-beacon-arrivals
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -566,7 +558,7 @@
suffix: Evac suffix: Evac
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Evac text: station-beacon-evac
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -574,7 +566,7 @@
suffix: EVA Storage suffix: EVA Storage
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: EVA Storage text: station-beacon-eva-storage
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -582,7 +574,7 @@
suffix: Chapel suffix: Chapel
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Chapel text: station-beacon-chapel
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -590,7 +582,7 @@
suffix: Library suffix: Library
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Library text: station-beacon-library
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -598,7 +590,7 @@
suffix: Theater suffix: Theater
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Theater text: station-beacon-theater
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -606,7 +598,7 @@
suffix: Dorms suffix: Dorms
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Dorms text: station-beacon-dorms
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -614,7 +606,7 @@
suffix: Tool Room suffix: Tool Room
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Tools text: station-beacon-tools
- type: entity - type: entity
parent: DefaultStationBeacon parent: DefaultStationBeacon
@@ -622,5 +614,5 @@
suffix: Disposals suffix: Disposals
components: components:
- type: NavMapBeacon - type: NavMapBeacon
text: Disposals text: station-beacon-disposals

View File

@@ -162,3 +162,6 @@ SpaceMedipen: null
# 2024-01-18 # 2024-01-18
ClothingHeadHelmetVoidParamed: null ClothingHeadHelmetVoidParamed: null
# 2024-01-19
DefaultStationBeaconTeslaEngine: null