Localize material names (#11059)

This commit is contained in:
Morb
2022-09-14 06:00:08 +03:00
committed by GitHub
parent ebcce52abe
commit 89367f71e4
5 changed files with 42 additions and 16 deletions

View File

@@ -13,6 +13,8 @@ namespace Content.Shared.Materials
[Prototype("material")]
public sealed class MaterialPrototype : IPrototype, IInheritingPrototype
{
private string _name = string.Empty;
[ViewVariables]
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<MaterialPrototype>))]
public string[]? Parents { get; }
@@ -31,7 +33,11 @@ namespace Content.Shared.Materials
[ViewVariables]
[DataField("name")]
public string Name { get; } = "unobtanium";
public string Name
{
get => _name;
private set => _name = Loc.GetString(value);
}
[ViewVariables]
[DataField("color")]

View File

@@ -0,0 +1,20 @@
# Glass
materials-glass = glass
materials-reinforced-glass = reinforced glass
materials-plasma-glass = plasma glass
materials-reinforced-plasma-glass = reinforced plasma glass
# Metals
materials-steel = steel
materials-gold = gold
materials-silver = silver
materials-plasteel = plasteel
# Other
materials-biomass = biomass
materials-cloth = cloth
materials-durathread = durathread
materials-plasma = plasma
materials-plastic = plastic
materials-wood = wood
materials-uranium = uranium

View File

@@ -1,7 +1,7 @@
- type: material
id: Glass
stack: Glass
name: glass
name: materials-glass
icon: Objects/Materials/Sheets/glass.rsi/glass.png
color: "#a8ccd7"
price: 0.0025
@@ -9,7 +9,7 @@
- type: material
id: ReinforcedGlass
stack: ReinforcedGlass
name: reinforced glass
name: materials-reinforced-glass
icon: Objects/Materials/Sheets/glass.rsi/rglass.png
color: "#549bb0"
price: 0.00375 # 2-1 mix of glass and metal.
@@ -17,7 +17,7 @@
- type: material
id: PlasmaGlass
stack: PlasmaGlass
name: plasma glass
name: materials-plasma-glass
icon: Objects/Materials/Sheets/glass.rsi/pglass.png
color: "#b35989"
price: 0.1025 # 1-1 mix of plasma and glass.
@@ -25,7 +25,7 @@
- type: material
id: ReinforcedPlasmaGlass
stack: ReinforcedPlasmaGlass
name: reinforced plasma glass
name: materials-reinforced-plasma-glass
icon: Objects/Materials/Sheets/glass.rsi/rpglass.png
color: "#8c4069"
price: 0.10375 # 2-2-1 mix of plasma, glass, and metal.

View File

@@ -1,7 +1,7 @@
- type: material
id: Biomass
stack: Biomass
name: biomass
name: materials-biomass
icon: /Textures/Objects/Misc/monkeycube.rsi/cube.png
color: "#8A9A5B"
price: 0.05
@@ -9,7 +9,7 @@
- type: material
id: Cloth
stack: Cloth
name: cloth
name: materials-cloth
icon: /Textures/Objects/Materials/materials.rsi/cloth.png
color: "#e7e7de"
price: 0.005
@@ -17,7 +17,7 @@
- type: material
id: Durathread
stack: Durathread
name: durathread
name: materials-durathread
icon: /Textures/Objects/Materials/materials.rsi/durathread.png
color: "#8291a1"
price: 0.0175 # 1-1 mix of plastic and cloth.
@@ -25,7 +25,7 @@
- type: material
id: Plasma
stack: Plasma
name: plasma
name: materials-plasma
icon: Objects/Materials/Sheets/other.rsi/plasma.png
color: "#7e009e"
price: 0.1
@@ -33,7 +33,7 @@
- type: material
id: Plastic
stack: Plastic
name: plastic
name: materials-plastic
icon: Objects/Materials/Sheets/other.rsi/plastic.png
color: "#d9d9d9"
price: 0.0125
@@ -41,7 +41,7 @@
- type: material
id: Wood
stack: WoodPlank
name: wood
name: materials-wood
icon: Objects/Materials/materials.rsi/wood.png
color: "#966F33"
price: 0.01
@@ -49,7 +49,7 @@
- type: material
id: Uranium
stack: Uranium
name: uranium
name: materials-uranium
icon: Objects/Materials/Sheets/other.rsi/uranium.png
color: "#32a852"
price: 0.05

View File

@@ -1,14 +1,14 @@
- type: material
id: Steel
stack: Steel
name: steel
name: materials-steel
icon: Objects/Materials/Sheets/metal.rsi/steel.png
price: 0.0025
- type: material
id: Gold
stack: Gold
name: gold
name: materials-gold
icon: Objects/Materials/ingots.rsi/gold.png
color: "#FFD700"
price: 0.0625
@@ -16,7 +16,7 @@
- type: material
id: Silver
stack: Silver
name: silver
name: materials-silver
icon: Objects/Materials/ingots.rsi/silver.png
color: "#C0C0C0"
price: 0.025
@@ -24,7 +24,7 @@
- type: material
id: Plasteel
stack: Plasteel
name: plasteel
name: materials-plasteel
icon: Objects/Materials/Sheets/metal.rsi/plasteel.png
color: "#696969" #Okay, this is epic
price: 0.1025 # 1-1 mix of plasma and steel.