From: chavonadelal <156101927+chavonadelal@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:05:19 +0000 (+0300) Subject: Localization of the Salvage Expedition Console (#30339) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9e1e9b8c34598aaf463b8294ece53df5d9842aef;p=space-station-14.git Localization of the Salvage Expedition Console (#30339) * Localization of the Salvage Expedition Console * Localization of the Salvage Expedition Console 2 --- diff --git a/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs b/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs index 663bde15b0..fe48b042f3 100644 --- a/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs +++ b/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs @@ -102,12 +102,21 @@ public sealed class SalvageExpeditionConsoleBoundUserInterface : BoundUserInterf offering.AddContent(new Label { - Text = faction, + Text = string.IsNullOrWhiteSpace(Loc.GetString(_protoManager.Index(faction).Description)) + ? LogAndReturnDefaultFactionDescription(faction) + : Loc.GetString(_protoManager.Index(faction).Description), FontColorOverride = StyleNano.NanoGold, HorizontalAlignment = Control.HAlignment.Left, Margin = new Thickness(0f, 0f, 0f, 5f), }); + string LogAndReturnDefaultFactionDescription(string faction) + { + Logger.Error($"Description is null or white space for SalvageFactionPrototype: {faction}"); + return Loc.GetString(_protoManager.Index(faction).ID); + } + + // Duration offering.AddContent(new Label { @@ -132,12 +141,20 @@ public sealed class SalvageExpeditionConsoleBoundUserInterface : BoundUserInterf offering.AddContent(new Label { - Text = Loc.GetString(_protoManager.Index(biome).ID), + Text = string.IsNullOrWhiteSpace(Loc.GetString(_protoManager.Index(biome).Description)) + ? LogAndReturnDefaultBiomDescription(biome) + : Loc.GetString(_protoManager.Index(biome).Description), FontColorOverride = StyleNano.NanoGold, HorizontalAlignment = Control.HAlignment.Left, Margin = new Thickness(0f, 0f, 0f, 5f), }); + string LogAndReturnDefaultBiomDescription(string biome) + { + Logger.Error($"Description is null or white space for SalvageBiomeModPrototype: {biome}"); + return Loc.GetString(_protoManager.Index(biome).ID); + } + // Modifiers offering.AddContent(new Label { diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/ISalvageMod.cs b/Content.Shared/Salvage/Expeditions/Modifiers/ISalvageMod.cs index aa27f83f03..6233b179b3 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/ISalvageMod.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/ISalvageMod.cs @@ -5,7 +5,7 @@ public interface ISalvageMod /// /// Player-friendly version describing this modifier. /// - string Description { get; } + LocId Description { get; } /// /// Cost for difficulty modifiers. diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageAirMod.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageAirMod.cs index c9f038e38f..fda08281b0 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageAirMod.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageAirMod.cs @@ -17,7 +17,7 @@ public sealed partial class SalvageAirMod : IPrototype, IBiomeSpecificMod /// [DataField("desc")] - public string Description { get; private set; } = string.Empty; + public LocId Description { get; private set; } = string.Empty; /// [DataField("cost")] diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageBiomeModPrototype.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageBiomeModPrototype.cs index 1d4efbd18d..3235741f11 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageBiomeModPrototype.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageBiomeModPrototype.cs @@ -12,7 +12,7 @@ public sealed partial class SalvageBiomeModPrototype : IPrototype, ISalvageMod { [IdDataField] public string ID { get; } = default!; - [DataField("desc")] public string Description { get; private set; } = string.Empty; + [DataField("desc")] public LocId Description { get; private set; } = string.Empty; /// /// Cost for difficulty modifiers. diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonModPrototype.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonModPrototype.cs index ee3233c551..713bdf08b3 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonModPrototype.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonModPrototype.cs @@ -10,7 +10,7 @@ public sealed partial class SalvageDungeonModPrototype : IPrototype, IBiomeSpeci { [IdDataField] public string ID { get; } = default!; - [DataField("desc")] public string Description { get; private set; } = string.Empty; + [DataField("desc")] public LocId Description { get; private set; } = string.Empty; /// [DataField("cost")] diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageLightMod.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageLightMod.cs index a7c38b258d..d744d5c308 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageLightMod.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageLightMod.cs @@ -8,7 +8,7 @@ public sealed partial class SalvageLightMod : IPrototype, IBiomeSpecificMod { [IdDataField] public string ID { get; } = default!; - [DataField("desc")] public string Description { get; private set; } = string.Empty; + [DataField("desc")] public LocId Description { get; private set; } = string.Empty; /// [DataField("cost")] diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageMod.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageMod.cs index 3cc4488684..5226824ed5 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageMod.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageMod.cs @@ -10,7 +10,7 @@ public sealed partial class SalvageMod : IPrototype, ISalvageMod { [IdDataField] public string ID { get; } = default!; - [DataField("desc")] public string Description { get; private set; } = string.Empty; + [DataField("desc")] public LocId Description { get; private set; } = string.Empty; /// /// Cost for difficulty modifiers. diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageTemperatureMod.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageTemperatureMod.cs index 17e9af038f..e8b7235511 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageTemperatureMod.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageTemperatureMod.cs @@ -8,7 +8,7 @@ public sealed partial class SalvageTemperatureMod : IPrototype, IBiomeSpecificMo { [IdDataField] public string ID { get; } = default!; - [DataField("desc")] public string Description { get; private set; } = string.Empty; + [DataField("desc")] public LocId Description { get; private set; } = string.Empty; /// [DataField("cost")] diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageWeatherMod.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageWeatherMod.cs index 1629d02b08..fc704d49e4 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageWeatherMod.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageWeatherMod.cs @@ -10,7 +10,7 @@ public sealed partial class SalvageWeatherMod : IPrototype, IBiomeSpecificMod { [IdDataField] public string ID { get; } = default!; - [DataField("desc")] public string Description { get; private set; } = string.Empty; + [DataField("desc")] public LocId Description { get; private set; } = string.Empty; /// [DataField("cost")] diff --git a/Content.Shared/Salvage/Expeditions/SalvageFactionPrototype.cs b/Content.Shared/Salvage/Expeditions/SalvageFactionPrototype.cs index 4c594945f0..71be4f7bd0 100644 --- a/Content.Shared/Salvage/Expeditions/SalvageFactionPrototype.cs +++ b/Content.Shared/Salvage/Expeditions/SalvageFactionPrototype.cs @@ -7,7 +7,7 @@ public sealed partial class SalvageFactionPrototype : IPrototype { [IdDataField] public string ID { get; } = default!; - [DataField("desc")] public string Description { get; private set; } = string.Empty; + [DataField("desc")] public LocId Description { get; private set; } = string.Empty; [ViewVariables(VVAccess.ReadWrite), DataField("entries", required: true)] public List MobGroups = new(); diff --git a/Content.Shared/Salvage/SharedSalvageSystem.cs b/Content.Shared/Salvage/SharedSalvageSystem.cs index 5f5fc875d6..0c56f4f556 100644 --- a/Content.Shared/Salvage/SharedSalvageSystem.cs +++ b/Content.Shared/Salvage/SharedSalvageSystem.cs @@ -55,18 +55,18 @@ public abstract partial class SharedSalvageSystem : EntitySystem if (air.Description != string.Empty) { - mods.Add(air.Description); + mods.Add(Loc.GetString(air.Description)); } // only show the description if there is an atmosphere since wont matter otherwise if (temp.Description != string.Empty && !air.Space) { - mods.Add(temp.Description); + mods.Add(Loc.GetString(temp.Description)); } if (light.Description != string.Empty) { - mods.Add(light.Description); + mods.Add(Loc.GetString(light.Description)); } var duration = TimeSpan.FromSeconds(CfgManager.GetCVar(CCVars.SalvageExpeditionDuration)); diff --git a/Resources/Locale/en-US/procedural/expeditions.ftl b/Resources/Locale/en-US/procedural/expeditions.ftl index b7bbdbce2f..56776e351d 100644 --- a/Resources/Locale/en-US/procedural/expeditions.ftl +++ b/Resources/Locale/en-US/procedural/expeditions.ftl @@ -32,3 +32,34 @@ salvage-expedition-announcement-countdown-seconds = {$duration} seconds remainin salvage-expedition-announcement-dungeon = Dungeon is located {$direction}. salvage-expedition-completed = Expedition is completed. salvage-expedition-reward-description = Mission completion reward + +# Salvage biome mod +salvage-biome-mod-caves = Caves +salvage-biome-mod-grasslands = Grasslands +salvage-biome-mod-snow = Snow +salvage-biome-mod-lava = Lava + +# Salvage mods +salvage-light-mod-daylight = Daylight +salvage-light-mod-evening = Evening +salvage-light-mod-night = Night time + +salvage-temperature-mod-room-temperature = Room temperature +salvage-temperature-mod-hot = Hot +salvage-temperature-mod-high-temperature = High temperature +salvage-temperature-mod-extreme-heat = Extreme heat +salvage-temperature-mod-cold = Cold +salvage-temperature-mod-low-temperature = Low temperature +salvage-temperature-mod-extreme-cold = Extreme cold + +salvage-air-mod-no-atmosphere = No atmosphere +salvage-air-mod-breathable-atmosphere = Breathable atmosphere +salvage-air-mod-dangerous-atmosphere = Dangerous atmosphere +salvage-air-mod-toxic-atmosphere = Toxic atmosphere +salvage-air-mod-volatile-atmosphere = Volatile atmosphere + +salvage-dungeon-mod-lava-brig = Lava Brig +salvage-dungeon-mod-snowy-labs = Snowy labs +salvage-dungeon-mod-experiment = Experiment +salvage-dungeon-mod-haunted = Haunted +salvage-dungeon-mod-mineshaft = Mineshaft diff --git a/Resources/Locale/en-US/procedural/salvage-faction.ftl b/Resources/Locale/en-US/procedural/salvage-faction.ftl new file mode 100644 index 0000000000..d3bed816f6 --- /dev/null +++ b/Resources/Locale/en-US/procedural/salvage-faction.ftl @@ -0,0 +1,2 @@ +salvage-faction-xenos = Xenos +salvage-faction-carps = Carps diff --git a/Resources/Prototypes/Procedural/salvage_factions.yml b/Resources/Prototypes/Procedural/salvage_factions.yml index 847a40ac02..f1e29375aa 100644 --- a/Resources/Prototypes/Procedural/salvage_factions.yml +++ b/Resources/Prototypes/Procedural/salvage_factions.yml @@ -1,5 +1,6 @@ - type: salvageFaction id: Xenos + desc: salvage-faction-xenos entries: - proto: MobXeno - proto: MobXenoDrone @@ -24,6 +25,7 @@ - type: salvageFaction id: Carps + desc: salvage-faction-carps entries: - proto: MobCarpDungeon # These do too much damage for salvage, need nerfs diff --git a/Resources/Prototypes/Procedural/salvage_mods.yml b/Resources/Prototypes/Procedural/salvage_mods.yml index f03c926383..ca64d29a52 100644 --- a/Resources/Prototypes/Procedural/salvage_mods.yml +++ b/Resources/Prototypes/Procedural/salvage_mods.yml @@ -7,19 +7,23 @@ # Biome mods -> at least 1 required - type: salvageBiomeMod id: Caves + desc: salvage-biome-mod-caves biome: Caves - type: salvageBiomeMod id: Grasslands + desc: salvage-biome-mod-grasslands biome: Grasslands - type: salvageBiomeMod id: Snow + desc: salvage-biome-mod-snow cost: 1 biome: Snow - type: salvageBiomeMod id: Lava + desc: salvage-biome-mod-lava cost: 2 biome: Lava @@ -32,36 +36,38 @@ # Light mods -> required - type: salvageLightMod id: Daylight - desc: Daylight + desc: salvage-light-mod-daylight color: "#D8B059" biomes: - Grasslands - type: salvageLightMod id: Lavalight - desc: Daylight + desc: salvage-light-mod-daylight color: "#A34931" biomes: - Lava - type: salvageLightMod id: Evening - desc: Evening + desc: salvage-light-mod-evening color: "#2b3143" - type: salvageLightMod id: Night - desc: Night time + desc: salvage-light-mod-night cost: 1 color: null # Temperatures - type: salvageTemperatureMod id: RoomTemp + desc: salvage-temperature-mod-room-temperature cost: 0 - type: salvageTemperatureMod id: Hot + desc: salvage-temperature-mod-hot cost: 1 temperature: 323.15 # 50C biomes: @@ -72,7 +78,7 @@ - type: salvageTemperatureMod id: Burning - desc: High temperature + desc: salvage-temperature-mod-high-temperature cost: 2 temperature: 423.15 # 200C biomes: @@ -82,7 +88,7 @@ - type: salvageTemperatureMod id: Melting - desc: Extreme heat + desc: salvage-temperature-mod-extreme-heat cost: 4 temperature: 1273.15 # 1000C hot hot hot biomes: @@ -90,6 +96,7 @@ - type: salvageTemperatureMod id: Cold + desc: salvage-temperature-mod-cold cost: 1 temperature: 275.15 # 2C biomes: @@ -100,7 +107,7 @@ - type: salvageTemperatureMod id: Tundra - desc: Low temperature + desc: salvage-temperature-mod-low-temperature cost: 2 temperature: 263.15 # -40C biomes: @@ -109,7 +116,7 @@ - type: salvageTemperatureMod id: Frozen - desc: Extreme cold + desc: salvage-temperature-mod-extreme-cold cost: 4 temperature: 123.15 # -150C biomes: @@ -118,7 +125,7 @@ # Air mixtures - type: salvageAirMod id: Space - desc: No atmosphere + desc: salvage-air-mod-no-atmosphere space: true cost: 2 biomes: @@ -128,6 +135,7 @@ - type: salvageAirMod id: Breathable cost: 0 + desc: salvage-air-mod-breathable-atmosphere gases: - 21.824779 # oxygen - 82.10312 # nitrogen @@ -135,7 +143,7 @@ - type: salvageAirMod id: Sleepy cost: 1 - desc: Dangerous atmosphere + desc: salvage-air-mod-dangerous-atmosphere gases: - 21.824779 # oxygen - 72.10312 # nitrogen @@ -155,7 +163,7 @@ - type: salvageAirMod id: Poisoned cost: 2 - desc: Dangerous atmosphere + desc: salvage-air-mod-dangerous-atmosphere gases: - 21.824779 # oxygen - 77.10312 # nitrogen @@ -170,7 +178,7 @@ - type: salvageAirMod id: Poison cost: 3 - desc: Toxic atmosphere + desc: salvage-air-mod-toxic-atmosphere gases: - 21.824779 # oxygen - 0 @@ -183,7 +191,7 @@ - type: salvageAirMod id: Plasma cost: 4 - desc: Toxic atmosphere + desc: salvage-air-mod-toxic-atmosphere gases: - 0 - 0 @@ -196,7 +204,7 @@ - type: salvageAirMod id: Burnable cost: 5 - desc: Volatile atmosphere + desc: salvage-air-mod-volatile-atmosphere gases: - 21.824779 # oxygen - 0 @@ -220,6 +228,7 @@ # For now just simple 1-dungeon setups - type: salvageDungeonMod id: Experiment + desc: salvage-dungeon-mod-experiment proto: Experiment biomes: #- LowDesert @@ -227,24 +236,28 @@ - type: salvageDungeonMod id: LavaBrig + desc: salvage-dungeon-mod-lava-brig proto: LavaBrig biomes: - Lava - type: salvageDungeonMod id: Mineshaft + desc: salvage-dungeon-mod-mineshaft proto: Mineshaft biomes: - Caves - type: salvageDungeonMod id: SnowyLabs + desc: salvage-dungeon-mod-snowy-labs proto: SnowyLabs biomes: - Snow - + - type: salvageDungeonMod id: Haunted + desc: salvage-dungeon-mod-haunted proto: Haunted biomes: - Caves