mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix chest display names
This commit is contained in:
parent
9601462f6c
commit
1d0c861e19
@ -115,6 +115,8 @@ Is the client up to date?"#,
|
|||||||
"common.material.stone": "Stone",
|
"common.material.stone": "Stone",
|
||||||
"common.material.cloth": "Cloth",
|
"common.material.cloth": "Cloth",
|
||||||
"common.material.hide": "Hide",
|
"common.material.hide": "Hide",
|
||||||
|
|
||||||
|
"common.sprite.chest": "Chest",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -1743,9 +1743,13 @@ impl Hud {
|
|||||||
let over_pos = pos + Vec3::unit_z() * 0.7;
|
let over_pos = pos + Vec3::unit_z() * 0.7;
|
||||||
|
|
||||||
// This is only done once per frame, so it's not a performance issue
|
// This is only done once per frame, so it's not a performance issue
|
||||||
if let Some(sprite) = block.get_sprite().filter(|s| s.is_container()) {
|
if let Some(desc) = block
|
||||||
|
.get_sprite()
|
||||||
|
.filter(|s| s.is_container())
|
||||||
|
.and_then(|s| get_sprite_desc(s, i18n))
|
||||||
|
{
|
||||||
overitem::Overitem::new(
|
overitem::Overitem::new(
|
||||||
format!("{:?}", sprite).into(),
|
desc,
|
||||||
overitem::TEXT_COLOR,
|
overitem::TEXT_COLOR,
|
||||||
pos.distance_squared(player_pos),
|
pos.distance_squared(player_pos),
|
||||||
&self.fonts,
|
&self.fonts,
|
||||||
@ -4333,6 +4337,14 @@ pub fn get_sprite_desc(sprite: SpriteKind, localized_strings: &Localization) ->
|
|||||||
SpriteKind::SpinningWheel => "hud.crafting.spinning_wheel",
|
SpriteKind::SpinningWheel => "hud.crafting.spinning_wheel",
|
||||||
SpriteKind::TanningRack => "hud.crafting.tanning_rack",
|
SpriteKind::TanningRack => "hud.crafting.tanning_rack",
|
||||||
SpriteKind::DismantlingBench => "hud.crafting.salvaging_station",
|
SpriteKind::DismantlingBench => "hud.crafting.salvaging_station",
|
||||||
|
SpriteKind::ChestBuried
|
||||||
|
| SpriteKind::Chest
|
||||||
|
| SpriteKind::DungeonChest0
|
||||||
|
| SpriteKind::DungeonChest1
|
||||||
|
| SpriteKind::DungeonChest2
|
||||||
|
| SpriteKind::DungeonChest3
|
||||||
|
| SpriteKind::DungeonChest4
|
||||||
|
| SpriteKind::DungeonChest5 => "common.sprite.chest",
|
||||||
sprite => return Some(Cow::Owned(format!("{:?}", sprite))),
|
sprite => return Some(Cow::Owned(format!("{:?}", sprite))),
|
||||||
};
|
};
|
||||||
Some(Cow::Borrowed(localized_strings.get(i18n_key)))
|
Some(Cow::Borrowed(localized_strings.get(i18n_key)))
|
||||||
|
Loading…
Reference in New Issue
Block a user