Cache translated item name

This commit is contained in:
Joshua Thome 2025-02-17 11:58:37 -06:00
parent e97ef7eb16
commit fec5ae1c92

View File

@ -20,6 +20,8 @@ namespace NewHorizons.Components.Props
public bool ClearPickupConditionOnDrop;
public string PickupFact;
string _translatedName;
public ItemType ItemType
{
get => _type;
@ -28,7 +30,11 @@ namespace NewHorizons.Components.Props
public override string GetDisplayName()
{
return TranslationHandler.GetTranslation(DisplayName, TranslationHandler.TextType.UI);
if (_translatedName == null)
{
_translatedName = TranslationHandler.GetTranslation(DisplayName, TranslationHandler.TextType.UI);
}
return _translatedName;
}
public override bool CheckIsDroppable()