Localize planet dataset names (#33398)
* Localize planet names (borer) * DatasetPrototype -> LocalizedDatasetPrototype * Apply requested changes
This commit is contained in:
@@ -34,10 +34,11 @@ public sealed class GatewayGeneratorSystem : EntitySystem
|
||||
[Dependency] private readonly GatewaySystem _gateway = default!;
|
||||
[Dependency] private readonly MetaDataSystem _metadata = default!;
|
||||
[Dependency] private readonly SharedMapSystem _maps = default!;
|
||||
[Dependency] private readonly SharedSalvageSystem _salvage = default!;
|
||||
[Dependency] private readonly TileSystem _tile = default!;
|
||||
|
||||
[ValidatePrototypeId<DatasetPrototype>]
|
||||
private const string PlanetNames = "names_borer";
|
||||
[ValidatePrototypeId<LocalizedDatasetPrototype>]
|
||||
private const string PlanetNames = "NamesBorer";
|
||||
|
||||
// TODO:
|
||||
// Fix shader some more
|
||||
@@ -102,7 +103,7 @@ public sealed class GatewayGeneratorSystem : EntitySystem
|
||||
var mapId = _mapManager.CreateMap();
|
||||
var mapUid = _mapManager.GetMapEntityId(mapId);
|
||||
|
||||
var gatewayName = SharedSalvageSystem.GetFTLName(_protoManager.Index<DatasetPrototype>(PlanetNames), seed);
|
||||
var gatewayName = _salvage.GetFTLName(_protoManager.Index<LocalizedDatasetPrototype>(PlanetNames), seed);
|
||||
_metadata.SetEntityName(mapUid, gatewayName);
|
||||
|
||||
var origin = new Vector2i(random.Next(-MaxOffset, MaxOffset), random.Next(-MaxOffset, MaxOffset));
|
||||
|
||||
@@ -28,7 +28,7 @@ public sealed partial class SalvageSystem
|
||||
var mission = GetMission(_prototypeManager.Index<SalvageDifficultyPrototype>(missionparams.Difficulty), missionparams.Seed);
|
||||
data.NextOffer = _timing.CurTime + mission.Duration + TimeSpan.FromSeconds(1);
|
||||
|
||||
_labelSystem.Label(cdUid, GetFTLName(_prototypeManager.Index<DatasetPrototype>("names_borer"), missionparams.Seed));
|
||||
_labelSystem.Label(cdUid, GetFTLName(_prototypeManager.Index<LocalizedDatasetPrototype>("NamesBorer"), missionparams.Seed));
|
||||
_audio.PlayPvs(component.PrintSound, uid);
|
||||
|
||||
UpdateConsoles((station.Value, data));
|
||||
|
||||
@@ -104,7 +104,9 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
destComp.BeaconsOnly = true;
|
||||
destComp.RequireCoordinateDisk = true;
|
||||
destComp.Enabled = true;
|
||||
_metaData.SetEntityName(mapUid, SharedSalvageSystem.GetFTLName(_prototypeManager.Index<DatasetPrototype>("names_borer"), _missionParams.Seed));
|
||||
_metaData.SetEntityName(
|
||||
mapUid,
|
||||
_entManager.System<SharedSalvageSystem>().GetFTLName(_prototypeManager.Index<LocalizedDatasetPrototype>("NamesBorer"), _missionParams.Seed));
|
||||
_entManager.AddComponent<FTLBeaconComponent>(mapUid);
|
||||
|
||||
// Saving the mission mapUid to a CD is made optional, in case one is somehow made in a process without a CD entity
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface IGridSpawnGroup
|
||||
public float MaximumDistance { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public ProtoId<DatasetPrototype>? NameDataset { get; }
|
||||
public ProtoId<LocalizedDatasetPrototype>? NameDataset { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
int MinCount { get; set; }
|
||||
@@ -75,7 +75,7 @@ public sealed class DungeonSpawnGroup : IGridSpawnGroup
|
||||
public float MaximumDistance { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public ProtoId<DatasetPrototype>? NameDataset { get; }
|
||||
public ProtoId<LocalizedDatasetPrototype>? NameDataset { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public int MinCount { get; set; } = 1;
|
||||
@@ -106,7 +106,7 @@ public sealed class GridSpawnGroup : IGridSpawnGroup
|
||||
|
||||
/// <inheritdoc />
|
||||
public float MaximumDistance { get; }
|
||||
public ProtoId<DatasetPrototype>? NameDataset { get; }
|
||||
public ProtoId<LocalizedDatasetPrototype>? NameDataset { get; }
|
||||
public int MinCount { get; set; } = 1;
|
||||
public int MaxCount { get; set; } = 1;
|
||||
public ComponentRegistry AddComponents { get; set; } = new();
|
||||
|
||||
@@ -208,7 +208,7 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
if (_protoManager.TryIndex(group.NameDataset, out var dataset))
|
||||
{
|
||||
_metadata.SetEntityName(spawned, SharedSalvageSystem.GetFTLName(dataset, _random.Next()));
|
||||
_metadata.SetEntityName(spawned, _salvage.GetFTLName(dataset, _random.Next()));
|
||||
}
|
||||
|
||||
if (group.Hide)
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Server.Station.Systems;
|
||||
using Content.Server.Stunnable;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Salvage;
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
using Content.Shared.Throwing;
|
||||
using JetBrains.Annotations;
|
||||
@@ -51,6 +52,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedSalvageSystem _salvage = default!;
|
||||
[Dependency] private readonly ShuttleConsoleSystem _console = default!;
|
||||
[Dependency] private readonly StationSystem _station = default!;
|
||||
[Dependency] private readonly StunSystem _stuns = default!;
|
||||
|
||||
@@ -26,10 +26,10 @@ public abstract partial class SharedSalvageSystem : EntitySystem
|
||||
[ValidatePrototypeId<SalvageLootPrototype>]
|
||||
public const string ExpeditionsLootProto = "SalvageLoot";
|
||||
|
||||
public static string GetFTLName(DatasetPrototype dataset, int seed)
|
||||
public string GetFTLName(LocalizedDatasetPrototype dataset, int seed)
|
||||
{
|
||||
var random = new System.Random(seed);
|
||||
return $"{dataset.Values[random.Next(dataset.Values.Count)]}-{random.Next(10, 100)}-{(char) (65 + random.Next(26))}";
|
||||
return $"{Loc.GetString(dataset.Values[random.Next(dataset.Values.Count)])}-{random.Next(10, 100)}-{(char) (65 + random.Next(26))}";
|
||||
}
|
||||
|
||||
public SalvageMission GetMission(SalvageDifficultyPrototype difficulty, int seed)
|
||||
|
||||
69
Resources/Locale/en-US/datasets/names/borer.ftl
Normal file
69
Resources/Locale/en-US/datasets/names/borer.ftl
Normal file
@@ -0,0 +1,69 @@
|
||||
names-borer-dataset-1 = Alcyonium
|
||||
names-borer-dataset-2 = Anomia
|
||||
names-borer-dataset-3 = Aphrodita
|
||||
names-borer-dataset-4 = Arca
|
||||
names-borer-dataset-5 = Argonauta
|
||||
names-borer-dataset-6 = Ascaris
|
||||
names-borer-dataset-7 = Asterias
|
||||
names-borer-dataset-8 = Buccinum
|
||||
names-borer-dataset-9 = Bulla
|
||||
names-borer-dataset-10 = Cardium
|
||||
names-borer-dataset-11 = Chama
|
||||
names-borer-dataset-12 = Chiton
|
||||
names-borer-dataset-13 = Conus
|
||||
names-borer-dataset-14 = Corallina
|
||||
names-borer-dataset-15 = Cypraea
|
||||
names-borer-dataset-16 = Dentalium
|
||||
names-borer-dataset-17 = Donax
|
||||
names-borer-dataset-18 = Doris
|
||||
names-borer-dataset-19 = Echinus
|
||||
names-borer-dataset-20 = Eschara
|
||||
names-borer-dataset-21 = Fasciola
|
||||
names-borer-dataset-22 = Furia
|
||||
names-borer-dataset-23 = Gordius
|
||||
names-borer-dataset-24 = Gorgonia
|
||||
names-borer-dataset-25 = Haliotis
|
||||
names-borer-dataset-26 = Helix
|
||||
names-borer-dataset-27 = Hirudo
|
||||
names-borer-dataset-28 = Holothuria
|
||||
names-borer-dataset-29 = Hydra
|
||||
names-borer-dataset-30 = Isis
|
||||
names-borer-dataset-31 = Lepas
|
||||
names-borer-dataset-32 = Lernaea
|
||||
names-borer-dataset-33 = Limax
|
||||
names-borer-dataset-34 = Lumbricus
|
||||
names-borer-dataset-35 = Madrepora
|
||||
names-borer-dataset-36 = Medusa
|
||||
names-borer-dataset-37 = Millepora
|
||||
names-borer-dataset-38 = Murex
|
||||
names-borer-dataset-39 = Myes
|
||||
names-borer-dataset-40 = Mytilus
|
||||
names-borer-dataset-41 = Myxine
|
||||
names-borer-dataset-42 = Nautilus
|
||||
names-borer-dataset-43 = Nereis
|
||||
names-borer-dataset-44 = Neritha
|
||||
names-borer-dataset-45 = Ostrea
|
||||
names-borer-dataset-46 = Patella
|
||||
names-borer-dataset-47 = Pennatula
|
||||
names-borer-dataset-48 = Pholas
|
||||
names-borer-dataset-49 = Pinna
|
||||
names-borer-dataset-50 = Priapus
|
||||
names-borer-dataset-51 = Scyllaea
|
||||
names-borer-dataset-52 = Sepia
|
||||
names-borer-dataset-53 = Serpula
|
||||
names-borer-dataset-54 = Sertularia
|
||||
names-borer-dataset-55 = Solen
|
||||
names-borer-dataset-56 = Spondylus
|
||||
names-borer-dataset-57 = Strombus
|
||||
names-borer-dataset-58 = Taenia
|
||||
names-borer-dataset-59 = Tellina
|
||||
names-borer-dataset-60 = Teredo
|
||||
names-borer-dataset-61 = Tethys
|
||||
names-borer-dataset-62 = Triton
|
||||
names-borer-dataset-63 = Trochus
|
||||
names-borer-dataset-64 = Tubipora
|
||||
names-borer-dataset-65 = Tubularia
|
||||
names-borer-dataset-66 = Turbo
|
||||
names-borer-dataset-67 = Venus
|
||||
names-borer-dataset-68 = Voluta
|
||||
names-borer-dataset-69 = Volvox
|
||||
@@ -1,72 +1,5 @@
|
||||
- type: dataset
|
||||
id: names_borer
|
||||
- type: localizedDataset
|
||||
id: NamesBorer
|
||||
values:
|
||||
- Alcyonium
|
||||
- Anomia
|
||||
- Aphrodita
|
||||
- Arca
|
||||
- Argonauta
|
||||
- Ascaris
|
||||
- Asterias
|
||||
- Buccinum
|
||||
- Bulla
|
||||
- Cardium
|
||||
- Chama
|
||||
- Chiton
|
||||
- Conus
|
||||
- Corallina
|
||||
- Cypraea
|
||||
- Dentalium
|
||||
- Donax
|
||||
- Doris
|
||||
- Echinus
|
||||
- Eschara
|
||||
- Fasciola
|
||||
- Furia
|
||||
- Gordius
|
||||
- Gorgonia
|
||||
- Haliotis
|
||||
- Helix
|
||||
- Hirudo
|
||||
- Holothuria
|
||||
- Hydra
|
||||
- Isis
|
||||
- Lepas
|
||||
- Lernaea
|
||||
- Limax
|
||||
- Lumbricus
|
||||
- Madrepora
|
||||
- Medusa
|
||||
- Millepora
|
||||
- Murex
|
||||
- Myes
|
||||
- Mytilus
|
||||
- Myxine
|
||||
- Nautilus
|
||||
- Nereis
|
||||
- Neritha
|
||||
- Ostrea
|
||||
- Patella
|
||||
- Pennatula
|
||||
- Pholas
|
||||
- Pinna
|
||||
- Priapus
|
||||
- Scyllaea
|
||||
- Sepia
|
||||
- Serpula
|
||||
- Sertularia
|
||||
- Solen
|
||||
- Spondylus
|
||||
- Strombus
|
||||
- Taenia
|
||||
- Tellina
|
||||
- Teredo
|
||||
- Tethys
|
||||
- Triton
|
||||
- Trochus
|
||||
- Tubipora
|
||||
- Tubularia
|
||||
- Turbo
|
||||
- Venus
|
||||
- Voluta
|
||||
- Volvox
|
||||
prefix: names-borer-dataset-
|
||||
count: 69
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
vgroid: !type:DungeonSpawnGroup
|
||||
minimumDistance: 300
|
||||
maximumDistance: 350
|
||||
nameDataset: names_borer
|
||||
nameDataset: NamesBorer
|
||||
stationGrid: false
|
||||
addComponents:
|
||||
- type: Gravity
|
||||
|
||||
Reference in New Issue
Block a user