]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Localization of the Salvage Expedition Console (#30339)
authorchavonadelal <156101927+chavonadelal@users.noreply.github.com>
Tue, 30 Jul 2024 14:05:19 +0000 (17:05 +0300)
committerGitHub <noreply@github.com>
Tue, 30 Jul 2024 14:05:19 +0000 (10:05 -0400)
* Localization of the Salvage Expedition Console

* Localization of the Salvage Expedition Console 2

15 files changed:
Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs
Content.Shared/Salvage/Expeditions/Modifiers/ISalvageMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageAirMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageBiomeModPrototype.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonModPrototype.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageLightMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageTemperatureMod.cs
Content.Shared/Salvage/Expeditions/Modifiers/SalvageWeatherMod.cs
Content.Shared/Salvage/Expeditions/SalvageFactionPrototype.cs
Content.Shared/Salvage/SharedSalvageSystem.cs
Resources/Locale/en-US/procedural/expeditions.ftl
Resources/Locale/en-US/procedural/salvage-faction.ftl [new file with mode: 0644]
Resources/Prototypes/Procedural/salvage_factions.yml
Resources/Prototypes/Procedural/salvage_mods.yml

index 663bde15b0db5b0366d9b4d60c0ac518ca227ab5..fe48b042f3e4d5f6aefaf04a6f345789b787cea2 100644 (file)
@@ -102,12 +102,21 @@ public sealed class SalvageExpeditionConsoleBoundUserInterface : BoundUserInterf
 
             offering.AddContent(new Label
             {
-                Text = faction,
+                Text = string.IsNullOrWhiteSpace(Loc.GetString(_protoManager.Index<SalvageFactionPrototype>(faction).Description))
+                        ? LogAndReturnDefaultFactionDescription(faction)
+                        : Loc.GetString(_protoManager.Index<SalvageFactionPrototype>(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<SalvageFactionPrototype>(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<SalvageBiomeModPrototype>(biome).ID),
+                Text = string.IsNullOrWhiteSpace(Loc.GetString(_protoManager.Index<SalvageBiomeModPrototype>(biome).Description))
+                        ? LogAndReturnDefaultBiomDescription(biome)
+                        : Loc.GetString(_protoManager.Index<SalvageBiomeModPrototype>(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<SalvageBiomeModPrototype>(biome).ID);
+            }
+
             // Modifiers
             offering.AddContent(new Label
             {
index aa27f83f03fc94509e014f90dacfe965c5a57ede..6233b179b3d6d0d9356b29012cd64e0a458f4523 100644 (file)
@@ -5,7 +5,7 @@ public interface ISalvageMod
     /// <summary>
     /// Player-friendly version describing this modifier.
     /// </summary>
-    string Description { get; }
+    LocId Description { get; }
 
     /// <summary>
     /// Cost for difficulty modifiers.
index c9f038e38f28fb54cd20f97fd11e423032d48579..fda08281b0635b16d0da5635c5a02b2ff4202b15 100644 (file)
@@ -17,7 +17,7 @@ public sealed partial class SalvageAirMod : IPrototype, IBiomeSpecificMod
 
     /// <inheritdoc/>
     [DataField("desc")]
-    public string Description { get; private set; } = string.Empty;
+    public LocId Description { get; private set; } = string.Empty;
 
     /// <inheritdoc/>
     [DataField("cost")]
index 1d4efbd18d3df2abfcc7b2fcca746f9b1ee1d4e4..3235741f117a29ee056b5e94f562e222c0b24633 100644 (file)
@@ -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;
 
     /// <summary>
     /// Cost for difficulty modifiers.
index ee3233c551276031e5759ba46a1e64dfa02a4821..713bdf08b31a57c93b30b345990be5156e55f40c 100644 (file)
@@ -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;
 
     /// <inheridoc/>
     [DataField("cost")]
index a7c38b258dd5a25e27f538f2525aa1d8303c4d8a..d744d5c308c4986b6b08dc25fa21644e72e8f9b9 100644 (file)
@@ -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;
 
     /// <inheritdoc/>
     [DataField("cost")]
index 3cc4488684e25c88fe624e4940e419d38a549b20..5226824ed5270dd4c15e27ec768efe92644a0d7a 100644 (file)
@@ -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;
 
     /// <summary>
     /// Cost for difficulty modifiers.
index 17e9af038f3d737049083ff886655fa08a8ff347..e8b7235511da1d9a3fa7d987bfdb10d61d4c55ed 100644 (file)
@@ -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;
 
     /// <inheritdoc/>
     [DataField("cost")]
index 1629d02b088c3fde05429eaf0f92511a08af8bd9..fc704d49e4b3e36071f8c687512bc4444161bb16 100644 (file)
@@ -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;
 
     /// <inheritdoc/>
     [DataField("cost")]
index 4c594945f0d4610204bdc1e9fe83c83fa56c3a58..71be4f7bd089024ae53a6f13e144f83865602a56 100644 (file)
@@ -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<SalvageMobEntry> MobGroups = new();
index 5f5fc875d62a34ec4acef082d7ee781080fdc533..0c56f4f556e8e01eca9f24d2b65ed1e379eeffed 100644 (file)
@@ -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));
index b7bbdbce2f99fb423faaa08f5b75e5b8184251a5..56776e351d2bd06d9e8ed4e8ce776c18907c93d1 100644 (file)
@@ -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 (file)
index 0000000..d3bed81
--- /dev/null
@@ -0,0 +1,2 @@
+salvage-faction-xenos = Xenos
+salvage-faction-carps = Carps
index 847a40ac02512cb48a3f083c733c9df4860d36eb..f1e29375aa2cdabd6ab4220836dd305a7e6f2d7f 100644 (file)
@@ -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
index f03c9263839823810785b298c62c3f60eed20071..ca64d29a52acffbe375052a235cc7002b33f1796 100644 (file)
@@ -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
 
 # 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:
 
 - type: salvageTemperatureMod
   id: Tundra
-  desc: Low temperature
+  desc: salvage-temperature-mod-low-temperature
   cost: 2
   temperature: 263.15 # -40C
   biomes:
 
 - type: salvageTemperatureMod
   id: Frozen
-  desc: Extreme cold
+  desc: salvage-temperature-mod-extreme-cold
   cost: 4
   temperature: 123.15 # -150C
   biomes:
 # Air mixtures
 - type: salvageAirMod
   id: Space
-  desc: No atmosphere
+  desc: salvage-air-mod-no-atmosphere
   space: true
   cost: 2
   biomes:
 - type: salvageAirMod
   id: Breathable
   cost: 0
+  desc: salvage-air-mod-breathable-atmosphere
   gases:
     - 21.824779 # oxygen
     - 82.10312 # nitrogen
 - type: salvageAirMod
   id: Sleepy
   cost: 1
-  desc: Dangerous atmosphere
+  desc: salvage-air-mod-dangerous-atmosphere
   gases:
     - 21.824779 # oxygen
     - 72.10312 # nitrogen
 - type: salvageAirMod
   id: Poisoned
   cost: 2
-  desc: Dangerous atmosphere
+  desc: salvage-air-mod-dangerous-atmosphere
   gases:
     - 21.824779 # oxygen
     - 77.10312 # nitrogen
 - type: salvageAirMod
   id: Poison
   cost: 3
-  desc: Toxic atmosphere
+  desc: salvage-air-mod-toxic-atmosphere
   gases:
     - 21.824779 # oxygen
     - 0
 - type: salvageAirMod
   id: Plasma
   cost: 4
-  desc: Toxic atmosphere
+  desc: salvage-air-mod-toxic-atmosphere
   gases:
     - 0
     - 0
 - type: salvageAirMod
   id: Burnable
   cost: 5
-  desc: Volatile atmosphere
+  desc: salvage-air-mod-volatile-atmosphere
   gases:
     - 21.824779 # oxygen
     - 0
 #  For now just simple 1-dungeon setups
 - type: salvageDungeonMod
   id: Experiment
+  desc: salvage-dungeon-mod-experiment
   proto: Experiment
   biomes:
     #- LowDesert
 
 - 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